mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleanup
This commit is contained in:
parent
b8d473cdf7
commit
7318aae629
@ -27,7 +27,6 @@ _typeOfInjury = switch (true) do {
|
|||||||
case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"};
|
case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"};
|
||||||
case (_typeOfProjectile iskindof "BombCore"): {"Explosive"};
|
case (_typeOfProjectile iskindof "BombCore"): {"Explosive"};
|
||||||
case (_typeOfProjectile iskindof "Grenade"): {"Grenade"};
|
case (_typeOfProjectile iskindof "Grenade"): {"Grenade"};
|
||||||
case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"};
|
|
||||||
default {_typeOfProjectile};
|
default {_typeOfProjectile};
|
||||||
};
|
};
|
||||||
// TODO replace the capitalization on the switch results instead..
|
// TODO replace the capitalization on the switch results instead..
|
||||||
|
@ -13,42 +13,24 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_unit", "_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"];
|
PARAMS_1(_unit);
|
||||||
_unit = _this select 0;
|
|
||||||
|
|
||||||
if (!local _unit) exitwith {};
|
if (!local _unit) exitwith {};
|
||||||
|
|
||||||
_bodyStatus = _unit getvariable [QGVAR(bodyPartStatus),[0,0,0,0,0,0]];
|
private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"];
|
||||||
|
|
||||||
// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
|
// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
|
||||||
_headDamage = _bodyStatus select 0;
|
_bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
|
||||||
if (_headDamage > 0.95) then {
|
|
||||||
_unit setHitPointDamage ["hitHead", 0.95];
|
|
||||||
} else {
|
|
||||||
_unit setHitPointDamage ["hitHead", _headDamage];
|
|
||||||
};
|
|
||||||
|
|
||||||
_torsoDamage = _bodyStatus select 1;
|
EXPLODE_6_PVT(_bodyStatus,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL);
|
||||||
if (_torsoDamage > 0.95) then {
|
|
||||||
_unit setHitPointDamage ["hitBody", 0.95];
|
|
||||||
} else {
|
|
||||||
_unit setHitPointDamage ["hitBody", _torsoDamage];
|
|
||||||
};
|
|
||||||
|
|
||||||
|
_unit setHitPointDamage ["hitHead", _headDamage min 0.95];
|
||||||
|
_unit setHitPointDamage ["hitBody", _torsoDamage min 0.95];
|
||||||
|
_unit setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95];
|
||||||
|
_unit setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95];
|
||||||
|
|
||||||
_handsDamage = (_bodyStatus select 2) + (_bodyStatus select 3);
|
hintSilent Str(_bodyStatus);
|
||||||
if (_handsDamage > 0.95) then {
|
|
||||||
_unit setHitPointDamage ["hitHands", 0.95];
|
|
||||||
} else {
|
|
||||||
_unit setHitPointDamage ["hitHands", _handsDamage];
|
|
||||||
};
|
|
||||||
|
|
||||||
_legsDamage = (_bodyStatus select 4) + (_bodyStatus select 5);
|
if (_bodyStatus isEqualTo [0,0,0,0,0,0]) then {
|
||||||
if (_legsDamage > 0.95) then {
|
|
||||||
_unit setHitPointDamage ["hitLegs", 0.95];
|
|
||||||
} else {
|
|
||||||
_unit setHitPointDamage ["hitLegs", _legsDamage];
|
|
||||||
};
|
|
||||||
|
|
||||||
if ({_x > 0} count _bodyStatus == 0) then {
|
|
||||||
_unit setDamage 0;
|
_unit setDamage 0;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user