mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
151d4a4bfe
New settings: * allowSelfIV * showPainInMenu Converted CBA -> ACE Settings: * advancedBandages * advancedMedication * fatalInjuryCondition * cardiacArrestTime Fixed settings: * useLocation_Epi * medicSetting_Epi * painCoefficient
32 lines
710 B
Plaintext
32 lines
710 B
Plaintext
/*
|
|
* Author: PabstMirror
|
|
* Interface to allow external modules to affect the pain level
|
|
*
|
|
* Arguments:
|
|
* 0: The patient <OBJECT>
|
|
* 1: Desired pain level (0 .. 1) <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* nothing
|
|
*
|
|
* Example:
|
|
* [guy, 0.5] call ace_medical_fnc_adjustPainLevel
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params ["_unit", "_desiredPainLevel"];
|
|
|
|
if (!local _unit) exitWith { ERROR("unit is not local"); };
|
|
|
|
TRACE_2("ACE_DEBUG: adjustPainLevel Called",_unit,_desiredPainLevel);
|
|
|
|
_desiredPainLevel = _desiredPainLevel * GVAR(painCoefficient);
|
|
|
|
private _pain = _unit getVariable [QGVAR(pain), 0];
|
|
|
|
_pain = 0 max (_pain max _desiredPainLevel) min 1;
|
|
|
|
_unit setVariable [QGVAR(pain), _pain];
|