2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2019-04-27 19:12:11 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut, PabstMirror
|
|
|
|
* Adds a medication and it's effects
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
* 1: Medication <STRING>
|
|
|
|
* 2: Time in system for the adjustment to reach its peak <NUMBER>
|
2024-01-22 22:33:30 +00:00
|
|
|
* 3: Duration the adjustment will have an effect <NUMBER>
|
|
|
|
* 4: Heart Rate Adjust <NUMBER>
|
|
|
|
* 5: Pain Suppress Adjust <NUMBER>
|
|
|
|
* 6: Flow Adjust <NUMBER>
|
2019-04-27 19:12:11 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, "Morphine", 120, 60, -10, 0.8, -10] call ace_medical_status_fnc_addMedicationAdjustment
|
2023-04-30 21:03:35 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
2019-04-27 19:12:11 +00:00
|
|
|
*/
|
|
|
|
params ["_unit", "_medication", "_timeToMaxEffect", "_maxTimeInSystem", "_hrAdjust", "_painAdjust", "_flowAdjust"];
|
|
|
|
TRACE_7("addMedicationAdjustment",_unit,_medication,_timeToMaxEffect,_maxTimeInSystem,_hrAdjust,_painAdjust,_flowAdjust);
|
|
|
|
|
|
|
|
if (_maxTimeInSystem <= 0) exitWith { WARNING_1("bad value for _maxTimeInSystem - %1",_this); };
|
|
|
|
_timeToMaxEffect = _timeToMaxEffect max 1;
|
|
|
|
|
|
|
|
|
|
|
|
private _adjustments = _unit getVariable [VAR_MEDICATIONS, []];
|
|
|
|
|
|
|
|
_adjustments pushBack [_medication, CBA_missionTime, _timeToMaxEffect, _maxTimeInSystem, _hrAdjust, _painAdjust, _flowAdjust];
|
|
|
|
|
|
|
|
_unit setVariable [VAR_MEDICATIONS, _adjustments, true];
|