mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
9e5c4a7ed9
* Transfer medical AI to CBA setting * Neuter the old settings module I've left the entry in CfgVehicles so that it doesn't cause errors on older missions, but it's just a dumb logic now and does nothing. * Remove medic setting * Move increaseTraining setting * Move fnc_adjustPainlevel to medical_status * Move pain and bleed coefficients to medical_status * Move advanced bandages to medical_treatment * Move advanced medication to medical_treatment * Move advanced diagnose to medical_treatment * Move wound reopening and screams settings * Move damage threshold settings * Move showPain setting * Move statemachine settings * Move pain visualisation setting * Move all treatment usage settings * Move self IV setting * Move remaining settings * Sort treatment setting string categories
31 lines
684 B
Plaintext
31 lines
684 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* 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_status_fnc_adjustPainLevel
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit", "_desiredPainLevel"];
|
|
|
|
if (!local _unit) exitWith { ERROR("unit is not local"); };
|
|
|
|
TRACE_2("adjustPainLevel",_unit,_desiredPainLevel);
|
|
|
|
_desiredPainLevel = _desiredPainLevel * EGVAR(medical,painCoefficient);
|
|
|
|
private _pain = GET_PAIN(_unit);
|
|
_pain = 0 max (_pain max _desiredPainLevel) min 1;
|
|
|
|
_unit setVariable [VAR_PAIN, _pain];
|