2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-10-05 22:54:57 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Handles full heal of a patient.
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
2016-10-05 22:54:57 +00:00
|
|
|
* Arguments:
|
2018-07-29 21:43:14 +00:00
|
|
|
* 0: The patient <OBJECT>
|
2016-10-05 22:54:57 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Succesful treatment started <BOOL>
|
|
|
|
*
|
|
|
|
* Public: No
|
2016-07-15 10:23:47 +00:00
|
|
|
*/
|
|
|
|
|
2018-07-29 21:43:14 +00:00
|
|
|
params ["_target"];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
if (!alive _target) exitWith {};
|
|
|
|
|
2019-04-03 13:17:17 +00:00
|
|
|
// Treatment conditions would normally limit this to non-unconc units, but treatment event may be called externally (zeus)
|
|
|
|
if (_target getVariable [QEGVAR(medical,inCardiacArrest), false]) then {
|
|
|
|
TRACE_1("exiting cardiac arrest",_target);
|
|
|
|
[QEGVAR(medical,CPRSucceeded), _target] call CBA_fnc_localEvent;
|
|
|
|
};
|
|
|
|
if (_target getVariable ["ACE_isUnconscious",false]) then {
|
|
|
|
TRACE_1("waking up",_target); // wake up first or unconc variables will be reset
|
|
|
|
[QEGVAR(medical,WakeUp), _target] call CBA_fnc_localEvent;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-08-02 14:02:10 +00:00
|
|
|
_target setVariable [VAR_PAIN, 0, true];
|
|
|
|
_target setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true];
|
2016-12-08 17:11:24 +00:00
|
|
|
|
|
|
|
// tourniquets
|
2018-07-29 21:43:14 +00:00
|
|
|
_target setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true];
|
2016-12-08 17:11:24 +00:00
|
|
|
_target setVariable [QGVAR(occludedMedications), nil, true];
|
|
|
|
|
|
|
|
// wounds and injuries
|
|
|
|
_target setVariable [QEGVAR(medical,openWounds), [], true];
|
|
|
|
_target setVariable [QEGVAR(medical,bandagedWounds), [], true];
|
|
|
|
_target setVariable [QEGVAR(medical,stitchedWounds), [], true];
|
2018-07-15 14:24:04 +00:00
|
|
|
_target setVariable [QEGVAR(medical,isLimping), false, true];
|
2016-12-08 17:11:24 +00:00
|
|
|
|
2019-04-27 19:12:11 +00:00
|
|
|
// - Update wound bleeding
|
|
|
|
[_target] call EFUNC(medical_status,updateWoundBloodLoss);
|
|
|
|
|
2016-12-08 17:11:24 +00:00
|
|
|
// vitals
|
2018-05-11 15:11:01 +00:00
|
|
|
_target setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true];
|
|
|
|
_target setVariable [VAR_BLOOD_PRESS, [80, 120], true];
|
2018-05-23 09:52:47 +00:00
|
|
|
_target setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true];
|
2016-12-08 17:11:24 +00:00
|
|
|
|
|
|
|
// IVs
|
|
|
|
_target setVariable [QEGVAR(medical,ivBags), nil, true];
|
|
|
|
|
|
|
|
// damage storage
|
|
|
|
_target setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
|
2016-12-08 10:38:43 +00:00
|
|
|
#ifdef DEBUG_TESTRESULTS
|
2016-12-08 17:11:24 +00:00
|
|
|
_target setVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0], true];
|
2016-12-08 10:38:43 +00:00
|
|
|
#endif
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2016-12-08 17:11:24 +00:00
|
|
|
// generic medical admin
|
2018-05-22 17:06:28 +00:00
|
|
|
_target setVariable [VAR_CRDC_ARRST, false, true];
|
2018-05-22 16:21:24 +00:00
|
|
|
_target setVariable [VAR_UNCON, false, true];
|
2018-05-22 17:25:07 +00:00
|
|
|
_target setVariable [VAR_HEMORRHAGE, 0, true];
|
2018-05-22 17:06:28 +00:00
|
|
|
_target setVariable [VAR_IN_PAIN, false, true];
|
2018-05-11 14:28:25 +00:00
|
|
|
_target setVariable [VAR_PAIN_SUPP, 0, true];
|
2016-12-08 17:11:24 +00:00
|
|
|
|
|
|
|
// medication
|
2019-04-27 19:12:11 +00:00
|
|
|
_target setVariable [VAR_MEDICATIONS, [], true];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2018-04-11 19:34:32 +00:00
|
|
|
// Reset triage card since medication is all reset
|
|
|
|
_target setVariable [QEGVAR(medical,triageCard), [], true];
|
|
|
|
|
2017-05-14 20:14:22 +00:00
|
|
|
[_target, false] call EFUNC(medical_engine,setLimping);
|
2016-12-05 20:34:20 +00:00
|
|
|
|
2016-12-08 10:38:43 +00:00
|
|
|
// Resetting damage
|
|
|
|
_target setDamage 0;
|
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
[QEGVAR(medical,FullHeal), _target] call CBA_fnc_localEvent;
|