ACE3/addons/medical/functions/fnc_handleDamage_airway.sqf

33 lines
819 B
Plaintext
Raw Normal View History

/*
* Author: Glowbal
* Handling of the airway injuries upon the handleDamage eventhandler.
*
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter or source of the damage <OBJECT>
* 4: Type of the damage done <STRING>
*
* Return Value:
2015-08-22 14:25:10 +00:00
* None
*
* Public: No
*/
#include "script_component.hpp"
2015-08-22 14:25:10 +00:00
private "_bodyPartn";
params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"];
_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
2015-11-30 16:14:05 +00:00
if (_bodyPartn > 1) exitWith {};
if (_amountOfDamage > 0.5) then {
if (random(1) >= 0.8) then {
if !(_unit getVariable[QGVAR(airwayCollapsed), false]) then {
_unit setVariable [QGVAR(airwayCollapsed), true, true];
2015-02-28 18:28:05 +00:00
};
};
};