Add 10% variation to cardiac arrest time

Gaussian distribution favours the average time setting. This introduces some unpredictability to cardiac arrest, but not enough to make users confused. Keeps the settings simple to again reduce confusion and improve overall UX.
This commit is contained in:
SilentSpike 2016-11-15 13:52:09 +00:00
parent 24ada4dab3
commit 39582914f7
3 changed files with 7 additions and 2 deletions

View File

@ -53,7 +53,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

@ -13,4 +13,8 @@
#include "script_component.hpp"
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];