ACE3/addons/medical/functions/fnc_adjustPainLevel.sqf

30 lines
644 B
Plaintext
Raw Normal View History

/*
* Author: PabstMirror
2016-12-05 20:34:20 +00:00
* Interface to allow external modules to affect the pain level
*
* Arguments:
* 0: The patient <OBJECT>
2016-12-05 20:34:20 +00:00
* 1: Desired pain level (0 .. 1) <NUMBER>
*
* Return Value:
2016-12-05 20:34:20 +00:00
* nothing
*
* Example:
* [guy, 0.5] call ace_medical_fnc_adjustPainLevel
*
* Public: Yes
*/
#include "script_component.hpp"
2016-12-05 20:34:20 +00:00
params ["_unit", "_desiredPainLevel"];
2016-12-05 20:34:20 +00:00
if (!local _unit) exitWith { ERROR("unit is not local"); };
TRACE_2("adjustPainLevel",_unit,_desiredPainLevel);
_desiredPainLevel = _desiredPainLevel * GVAR(painCoefficient);
2018-05-08 09:16:12 +00:00
private _pain = GET_PAIN_TOTAL(_unit);
2018-05-08 09:16:12 +00:00
SET_PAIN_TOTAL(_unit,_pain max _desiredPainLevel,false);