2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-30 12:00:42 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Damages a body part of a local unit. Does not kill the unit.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Selection, can be "Head", "Body", "Arms" or "Legs" <STRING>
|
2017-06-08 18:50:38 +00:00
|
|
|
* 2: Damaged <BOOLEAN>
|
2016-07-30 12:00:42 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2017-06-08 18:50:38 +00:00
|
|
|
* [player, "HEAD", true] call ace_medical_engine_fnc_damageBodyPart
|
2016-07-30 12:00:42 +00:00
|
|
|
*
|
|
|
|
* Notes:
|
|
|
|
* Head: Blood visuals @ 0.45
|
|
|
|
* Body: Blood visuals @ 0.45
|
|
|
|
* Arms: Blood visuals @ 0.35, increases weapon sway linerarly
|
|
|
|
* Legs: Blood visuals @ 0.35, limping @ 0.5
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-10-07 03:10:43 +00:00
|
|
|
params ["_unit", "_selection", "_damage"];
|
2017-06-08 18:50:38 +00:00
|
|
|
TRACE_3("damageBodyPart",_unit,_selection,_damage);
|
2016-07-30 12:00:42 +00:00
|
|
|
|
2016-10-06 21:44:14 +00:00
|
|
|
_damage = [0, DAMAGED_MIN_THRESHOLD] select _damage;
|
2016-07-30 12:00:42 +00:00
|
|
|
|
|
|
|
switch (toLower _selection) do {
|
|
|
|
case ("head"): {
|
|
|
|
_unit setHitPointDamage ["HitHead", _damage];
|
|
|
|
};
|
|
|
|
case ("body"): {
|
|
|
|
_unit setHitPointDamage ["HitBody", _damage];
|
|
|
|
};
|
|
|
|
case ("arms"): {
|
2016-10-06 21:44:14 +00:00
|
|
|
_unit setHitPointDamage ["HitHands", _damage];
|
2016-07-30 12:00:42 +00:00
|
|
|
};
|
|
|
|
case ("legs"): {
|
2018-07-15 14:24:04 +00:00
|
|
|
_unit setHitPointDamage ["HitLegs", _damage + ([0, LIMPING_MIN_DAMAGE] select (_unit getVariable [QEGVAR(medical,isLimping), false]))];
|
2016-07-30 12:00:42 +00:00
|
|
|
};
|
|
|
|
};
|