ACE3/addons/medical_treatment/functions/fnc_addHeartRateAdjustment.sqf
ulteq 92da5c80a0 Partly fixed Medication
* Brings the heart rate adjustment (due to medication) back to life
* Restores the medication effect loop (needs testing)
2016-12-06 12:58:12 +01:00

27 lines
858 B
Plaintext

/*
* Author: Glowbal, KoffeinFlummi
* Increase the heart rate target of a local unit by given number during the given amount of seconds.
*
* Arguments:
* 0: The unit <OBJECT>
* 1: value <NUMBER>
* 2: time until max. effect (seconds) <NUMBER>
* 3: time in system (seconds) <NUMBER>
* 4: callback <CODE>
*
* Return Value:
* None
*
* Public: Yes
*/
#include "script_component.hpp"
params [["_unit", objNull, [objNull]], ["_value", 0, [0]], ["_timeTillMaxEffect", 1, [0]], ["_timeInSystem", 1, [0]], ["_callBack", {}, [{}]]];
private _adjustment = _unit getVariable [QEGVAR(medical,heartRateAdjustments), []];
_adjustment pushBack [_value, _timeTillMaxEffect, _timeInSystem, 0, _callBack];
_unit setVariable [QEGVAR(medical,heartRateAdjustments), _adjustment];
["ace_heartRateAdjustmentAdded", [_unit, _value, _time]] call CBA_fnc_localEvent;