2015-02-28 18:22:46 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Sets the hitpoint damage for au nit to the correct values
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit for which the hitpoint damage will be sorted out <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-22 14:25:10 +00:00
|
|
|
* None
|
2015-02-28 18:22:46 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_unit"];
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-04-11 20:29:32 +00:00
|
|
|
if (!local _unit) exitwith {};
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-08-22 15:10:19 +00:00
|
|
|
private "_bodyStatus";
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-06-10 10:47:22 +00:00
|
|
|
// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
|
|
|
|
_bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-08-22 15:10:19 +00:00
|
|
|
_bodyStatus params ["_headDamage", "_torsoDamage", "_handsDamageR", "_handsDamageL", "_legsDamageR", "_legsDamageL"];
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-06-10 10:47:22 +00:00
|
|
|
_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];
|
2015-02-28 18:22:46 +00:00
|
|
|
|
2015-06-10 10:47:22 +00:00
|
|
|
if (_bodyStatus isEqualTo [0,0,0,0,0,0]) then {
|
2015-02-28 18:22:46 +00:00
|
|
|
_unit setDamage 0;
|
|
|
|
};
|