Bundle fire damage into larger chunks (#4223)

This commit is contained in:
PabstMirror 2016-09-03 15:00:45 -05:00 committed by Glowbal
parent 7220d0ee5d
commit 1c5761f845
2 changed files with 18 additions and 8 deletions

View File

@ -9,9 +9,6 @@
* 3: Shooter <OBJECT>
* 4: Projectile <STRING>
* 5: Hit part index of the hit point <NUMBER>
* 6: Current damage to be returned <NUMBER>
*
* //On 1.63 dev:
* 6: Shooter? <OBJECT>
* 7: Current damage to be returned <NUMBER>
*
@ -23,12 +20,23 @@
#include "script_component.hpp"
params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_hitPointNumber", "_newDamage"];
params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_hitPointNumber", "", "_newDamage"];
//Temp fix for 1.63 handleDamage changes
if (_newDamage isEqualType objNull) then {
_newDamage = _this select 7;
};
// For burning damage we will get a ton of very small hits of damage; they are too small to create any wounds
// Save them up in a variable and run when it is over a noticable amount
if ((_typeOfProjectile == "") && {_newDamage < 0.15} && {
_newDamage = _newDamage + (_unit getVariable [QGVAR(trivialDamage), 0]);
if (_newDamage > 0.15) then {
// if the new sum is large enough, reset variable and continue with it added in
_unit setVariable [QGVAR(trivialDamage), 0];
false
} else {
// otherwise just save the new sum into the variable and exit
_unit setVariable [QGVAR(trivialDamage), _newDamage];
true // exit
};
}) exitWith {};
private _part = [_selectionName] call FUNC(selectionNameToNumber);
if (_part < 0) exitWith {};

View File

@ -20,6 +20,8 @@
params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage"];
TRACE_6("ACE_DEBUG: HandleDamage Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage);
if (_typeOfDamage == "") then {_typeOfDamage = "unknown";};
// Administration for open wounds and ids
private _openWounds = _unit getVariable[QGVAR(openWounds), []];
private _woundID = _unit getVariable[QGVAR(lastUniqueWoundID), 1];