mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fa77fb7194
* Fixed medication (morphine, epinephrine, ...) * Fixed CPR * Improved heart rate simulation * Removed deprecated ace settings
46 lines
1.0 KiB
Plaintext
46 lines
1.0 KiB
Plaintext
/*
|
|
* Author: Ruthberg
|
|
* Handle incapacitation due to damage and pain
|
|
*
|
|
* Arguments:
|
|
* 0: The Unit <OBJECT>
|
|
*
|
|
* ReturnValue:
|
|
* nothing
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit"];
|
|
|
|
private _painLevel = [_unit] call FUNC(getPainLevel);
|
|
private _headDamage = 0;
|
|
private _bodyDamage = 0;
|
|
|
|
{
|
|
_x params ["", "", "_bodyPart", "", "", "_damage"];
|
|
switch (_bodyPart) do {
|
|
case 0: {
|
|
_headDamage = _headDamage + _damage;
|
|
};
|
|
case 1: {
|
|
if (_damage > PENETRATION_THRESHOLD) then {
|
|
_bodyDamage = _bodyDamage + _damage;
|
|
};
|
|
};
|
|
};
|
|
} forEach (_unit getVariable [QGVAR(openWounds), []]);
|
|
|
|
// todo: use an ace settings for the thresholds
|
|
if (_headDamage > 0.50) then {
|
|
[QGVAR(CriticalInjury), _unit] call CBA_fnc_localEvent;
|
|
};
|
|
if (_bodyDamage > 1.05) then {
|
|
[QGVAR(CriticalInjury), _unit] call CBA_fnc_localEvent;
|
|
};
|
|
|
|
if ((_painLevel >= PAIN_UNCONSCIOUS) && {random 1 < 0.1}) then {
|
|
[QGVAR(CriticalInjury), _unit] call CBA_fnc_localEvent;
|
|
};
|