2015-02-08 09:01:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Handling of the airway injuries upon the handleDamage eventhandler.
|
2015-02-03 20:48:08 +00:00
|
|
|
*
|
2015-02-08 09:01:32 +00:00
|
|
|
* 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:
|
|
|
|
* None <NIL>
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-02-03 20:48:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage", "_bodyPartn"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_selectionName = _this select 1;
|
|
|
|
_amountOfDamage = _this select 2;
|
|
|
|
_sourceOfDamage = _this select 3;
|
|
|
|
_typeOfDamage = _this select 4;
|
|
|
|
_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber);
|
|
|
|
|
2015-03-08 14:58:35 +00:00
|
|
|
if (_bodyPartn > 1) exitwith {};
|
2015-02-03 20:48:08 +00:00
|
|
|
|
2015-03-08 14:58:35 +00:00
|
|
|
if (_amountOfDamage > 0.5) then {
|
2015-02-03 20:48:08 +00:00
|
|
|
if (random(1) >= 0.8) then {
|
2015-02-28 18:28:05 +00:00
|
|
|
if !(_unit getvariable[QGVAR(airwayCollapsed), false]) then {
|
|
|
|
_unit setvariable [QGVAR(airwayCollapsed), true, true];
|
|
|
|
};
|
2015-02-03 20:48:08 +00:00
|
|
|
};
|
|
|
|
};
|