Merge pull request #4668 from acemod/medical-rewrite-cardiacArrestLimits

Introduce small variation to length of cardiac arrest
This commit is contained in:
BaerMitUmlaut 2016-12-08 14:22:11 +01:00 committed by GitHub
commit a48d271368
3 changed files with 7 additions and 2 deletions

View File

@ -46,7 +46,7 @@ GVAR(STATE_MACHINE) = (configFile >> "ACE_Medical_StateMachine") call CBA_statem
[
QGVAR(cardiacArrestTime),
"SLIDER",
["Cardiac Arrest Time", "Sets how long cardiac arrest will last for (in minutes)."], //@todo
["Cardiac Arrest Time", "Sets how long cardiac arrest will last for on average (in minutes)."], //@todo
"ACE Medical", // @todo
[0, 30, 2, 0],
true

View File

@ -14,5 +14,6 @@
params ["_unit"];
private _startTime = _unit getVariable [QGVAR(cardiacArrestStart), CBA_missionTime];
private _lifeTime = _unit getVariable [QGVAR(cardiacArrestTime), GVAR(cardiacArrestTime)];
(CBA_missionTime - _startTime) > (GVAR(cardiacArrestTime) * 60)
(CBA_missionTime - _startTime) > (_lifeTime * 60)

View File

@ -14,6 +14,10 @@
params ["_unit"];
private _time = GVAR(cardiacArrestTime);
_time = _time + random [_time*-0.1, 0, _time*0.1];
_unit setVariable [QGVAR(cardiacArrestTime), _time];
_unit setVariable [QGVAR(cardiacArrestStart), CBA_missionTime];
[_unit] call FUNC(setCardiacArrest);