2015-02-06 12:47:17 +00:00
|
|
|
/*
|
2015-09-02 18:13:51 +00:00
|
|
|
* Author: KoffeinFlummi, commy2
|
2015-02-06 12:47:17 +00:00
|
|
|
* Initializes unit variables.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [bob] call ACE_medical_fnc_init
|
2015-02-06 12:47:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_unit"];
|
2015-02-06 12:47:17 +00:00
|
|
|
|
2016-10-07 02:21:01 +00:00
|
|
|
if (damage _unit > 0) then {
|
|
|
|
_unit setDamage 0;
|
|
|
|
};
|
|
|
|
|
2015-04-19 15:28:47 +00:00
|
|
|
_unit setVariable [QGVAR(pain), 0, true];
|
2016-10-10 15:30:42 +00:00
|
|
|
_unit setVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME, true];
|
2017-06-15 19:35:33 +00:00
|
|
|
_unit setVariable ["ACE_isUnconscious", false, true];
|
2016-12-05 20:34:20 +00:00
|
|
|
_unit setVariable [QGVAR(partialHealCounter), 0, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// tourniquets
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true];
|
2016-06-30 15:33:29 +00:00
|
|
|
_unit setVariable [QGVAR(occludedMedications), nil, true]; //Delayed Medications (from tourniquets)
|
2016-02-03 20:40:26 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// wounds and injuries
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(openWounds), [], true];
|
|
|
|
_unit setVariable [QGVAR(bandagedWounds), [], true];
|
2016-12-05 20:34:20 +00:00
|
|
|
_unit setVariable [QGVAR(stitchedWounds), [], true];
|
2017-09-26 22:43:54 +00:00
|
|
|
_unit setVariable [QEGVAR(medical_engine,isLimping), false, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// vitals
|
2016-12-09 11:57:27 +00:00
|
|
|
_unit setVariable [QGVAR(heartRate), DEFAULT_HEART_RATE, true];
|
2016-12-06 19:42:10 +00:00
|
|
|
_unit setVariable [QGVAR(heartRateAdjustments), [], true];
|
|
|
|
_unit setVariable [QGVAR(bloodPressure), [80, 120], true];
|
|
|
|
_unit setVariable [QGVAR(peripheralResistance), 100, true];
|
|
|
|
_unit setVariable [QGVAR(peripheralResistanceAdjustments), [], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// triage card and logs
|
2016-12-05 22:00:02 +00:00
|
|
|
_unit setVariable [QGVAR(triageLevel), 0, true];
|
|
|
|
_unit setVariable [QGVAR(triageCard), [], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// IVs
|
2016-09-01 10:46:08 +00:00
|
|
|
_unit setVariable [QGVAR(ivBags), nil, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// damage storage
|
2016-12-08 10:38:43 +00:00
|
|
|
_unit setVariable [QGVAR(bodyPartDamage), [0,0,0,0,0,0], true];
|
|
|
|
#ifdef DEBUG_TESTRESULTS
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true];
|
2016-12-08 10:38:43 +00:00
|
|
|
#endif
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// generic medical admin
|
2016-12-05 20:34:20 +00:00
|
|
|
_unit setVariable [QGVAR(inCardiacArrest), false, true];
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(hasLostBlood), 0, true];
|
|
|
|
_unit setVariable [QGVAR(isBleeding), false, true];
|
|
|
|
_unit setVariable [QGVAR(hasPain), false, true];
|
|
|
|
_unit setVariable [QGVAR(painSuppress), 0, true];
|
2016-12-06 19:42:10 +00:00
|
|
|
_unit setVariable [QGVAR(painSuppressAdjustments), [], true];
|
2015-09-02 18:13:51 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// medication
|
2017-10-10 14:39:59 +00:00
|
|
|
private _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []];
|
2015-09-03 15:17:54 +00:00
|
|
|
{
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [_x select 0, nil];
|
2015-11-30 16:23:48 +00:00
|
|
|
} forEach _allUsedMedication;
|
2015-09-03 15:17:54 +00:00
|
|
|
_unit setVariable [QGVAR(allUsedMedication), [], true];
|
2015-02-28 10:47:35 +00:00
|
|
|
|
2016-06-30 15:33:29 +00:00
|
|
|
// TODO move to treatment
|
2017-10-10 14:39:59 +00:00
|
|
|
private _logs = _unit getVariable [QGVAR(allLogs), []];
|
2015-09-03 15:17:54 +00:00
|
|
|
{
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [_x, nil];
|
2015-11-30 16:23:48 +00:00
|
|
|
} forEach _logs;
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(allLogs), [], true];
|
2015-03-21 20:59:08 +00:00
|
|
|
|
|
|
|
[{
|
2016-09-18 17:48:49 +00:00
|
|
|
params ["_unit"];
|
2017-03-25 16:36:37 +00:00
|
|
|
TRACE_2("Unit Init",_unit,local _unit);
|
2016-09-18 17:48:49 +00:00
|
|
|
[QGVAR(initialized), [_unit]] call CBA_fnc_localEvent;
|
2017-03-25 16:36:37 +00:00
|
|
|
}, [_unit], 0.5] call CBA_fnc_waitAndExecute;
|