First draft of death prevention

This commit is contained in:
KoffeinFlummi 2015-02-10 13:33:40 +01:00
parent a609d00730
commit fba44f490d
2 changed files with 13 additions and 2 deletions

View File

@ -56,8 +56,18 @@ if (_damageReturn < 0.01) exitWith {0};
if (GVAR(level) >= 1) then {
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_medium);
if (GVAR(level) >= 2) then {
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced);
};
_damageReturn = (_this + [_damageReturn, _typeOfDamage]) call FUNC(handleDamage_advanced);
};
};
if (_unit getVariable [QGVAR(preventDeath), false] and
{_damageReturn >= 0.9} and
{_selection in ["", "head", "body"]}) exitWith {
if (vehicle _unit != _unit and {damage _vehicle >= 1}) then {
// @todo
// [_unit] call FUNC(unload);
};
0.89
};
_damageReturn

View File

@ -43,6 +43,7 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then {
_unit setVariable [QGVAR(hitPoints), []];
_unit setVariable [QGVAR(damages), []];
_unit setVariable [QGVAR(structDamage), 0];
_unit setVariable [QGVAR(preventDeath), false];
};