ACE3/addons/medical_status/functions/fnc_setCardiacArrest.sqf

30 lines
805 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Glowbal
* Marks a unit as in cardiac arrest and sets heart rate to 0.
* Will put the unit in an unconscious state if not already.
2015-02-07 23:08:36 +00:00
*
* Arguments:
* 0: The unit that will be put in cardiac arrest state <OBJECT>
*
* Return Value:
2015-08-22 17:47:23 +00:00
* None
*
* Public: No
2015-02-07 23:08:36 +00:00
*/
params ["_unit", "_active"];
TRACE_2("setCardiacArrest",_unit,_active);
2015-02-07 23:08:36 +00:00
// No change to make
if (_active isEqualTo IN_CRDC_ARRST(_unit)) exitWith {};
// No heart rate in cardiac arrest, low heart rate if revived
_unit setVariable [VAR_CRDC_ARRST, _active, true];
_unit setVariable [VAR_HEART_RATE, [40, 0] select _active, true];
2015-02-07 23:08:36 +00:00
// Cardiac arrest is an extension of unconsciousness
[_unit, _active] call FUNC(setUnconscious);
2015-02-07 23:08:36 +00:00
["ace_cardiacArrest", [_unit, _active]] call CBA_fnc_localEvent;