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>
|
2016-09-30 09:23:07 +00:00
|
|
|
* 2: Damage (optional, default: true) <BOOLEAN>
|
2016-07-30 12:00:42 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, "HEAD"] call ace_medical_engine_fnc_damageBodyPart
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-09-26 17:59:00 +00:00
|
|
|
params [["_unit", objNull, [objNull]], ["_selection", "", [""]], ["_damage", true, [false]]];
|
2016-07-30 12:00:42 +00:00
|
|
|
|
|
|
|
if (!local _unit) exitWith {
|
2016-10-02 15:50:17 +00:00
|
|
|
ERROR("Unit not local or null");
|
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"): {
|
2016-09-30 09:23:07 +00:00
|
|
|
_unit setHitPointDamage ["HitLegs", _damage + ([0, LIMPING_MIN_DAMAGE] select (_unit getVariable [QGVAR(isLimping), false]))];
|
2016-07-30 12:00:42 +00:00
|
|
|
};
|
|
|
|
};
|