ACE3/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf
PabstMirror 7e255bf05b
Tools - Fix header arg types (#9752)
Fix header arg types
2024-01-22 16:33:30 -06:00

35 lines
1.2 KiB
Plaintext

#include "..\script_component.hpp"
/*
* 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>
* 3: Duration the adjustment will have an effect <NUMBER>
* 4: Heart Rate Adjust <NUMBER>
* 5: Pain Suppress Adjust <NUMBER>
* 6: Flow Adjust <NUMBER>
*
* Return Value:
* None
*
* Example:
* [player, "Morphine", 120, 60, -10, 0.8, -10] call ace_medical_status_fnc_addMedicationAdjustment
*
* Public: No
*/
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];