Skip to content

Commit

Permalink
Medical - Make Peripheral Resistance affect blood loss (acemod#8420)
Browse files Browse the repository at this point in the history
Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com>
Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
  • Loading branch information
4 people authored and blake8090 committed Aug 18, 2024
1 parent 64c2a64 commit 4cf8dd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion addons/medical_status/functions/fnc_getBloodLoss.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ private _woundBleeding = GET_WOUND_BLEEDING(_unit);
if (_woundBleeding == 0) exitWith {0};

private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES]; // can use value directly since this is sum of default and adjustments

// even if heart stops blood will still flow slowly (gravity)
private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient));
private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * (DEFAULT_PERIPH_RES / _resistance) * EGVAR(medical,bleedingCoefficient));

private _eventArgs = [_unit, _bloodLoss]; // Pass by reference

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

params ["_unit", "_peripheralResistanceAdjustment", "_deltaT", "_syncValue"];

_unit setVariable [VAR_PERIPH_RES, 0 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue];
_unit setVariable [VAR_PERIPH_RES, 1 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue];

0 comments on commit 4cf8dd4

Please sign in to comment.