Skip to content

Commit

Permalink
Bundle fire damage into bigger chunks
Browse files Browse the repository at this point in the history
Redo #4223
  • Loading branch information
PabstMirror committed Apr 22, 2017
1 parent d932693 commit 6cb81c2
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions addons/medical_engine/functions/fnc_handleDamage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,26 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith {
};
_ammo = "#falling";
} else {
// Assume collision damage.
// @todo, find a method for detecting burning damage.
_woundedHitPoint = "Body";
_ammo = "#collision";
if (_receivedDamage > 0.05) then {
// Assume collision damage.
_woundedHitPoint = "Body";
_ammo = "#vehiclecrash";
} else {
// Probably fire damage:
_woundedHitPoint = selectRandom ["LeftLeg", "RightLeg", "Body"];
_ammo = "#unknown";
private _combinedDamage = _receivedDamage + (_unit getVariable [QGVAR(trivialDamage), 0]);
if (_combinedDamage > 0.15) then {
// if the new sum is large enough, reset variable and continue with it added in
_unit setVariable [QGVAR(trivialDamage), 0];
TRACE_2("Using sum of trivialDamage",_receivedDamage,_combinedDamage);
_receivedDamage = _combinedDamage;
} else {
// otherwise just save the new sum into the variable and exit
_unit setVariable [QGVAR(trivialDamage), _combinedDamage];
_receivedDamage = 0;
};
};
};
};

Expand Down

0 comments on commit 6cb81c2

Please sign in to comment.