ACE3/addons/medical_statemachine/functions/fnc_enteredStateCardiacArrest.sqf

25 lines
552 B
Plaintext
Raw Normal View History

/*
* Author: BaerMitUmlaut
* Handles a unit entering cardiac arrest.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
2016-12-05 20:34:20 +00:00
params ["_unit"];
// 10% possible variance in cardiac arrest time
2018-05-09 12:37:07 +00:00
private _time = EGVAR(medical,cardiacArrestTime);
_time = _time + random [_time*-0.1, 0, _time*0.1];
2018-05-09 12:37:07 +00:00
_unit setVariable [QEGVAR(medical,cardiacArrestTime), _time];
_unit setVariable [QEGVAR(medical,cardiacArrestStart), CBA_missionTime];
2016-12-05 20:34:20 +00:00
2018-05-08 09:16:12 +00:00
[_unit] call EFUNC(medical_status,setCardiacArrest);