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;
|
|
|
|
};
|
|
|
|
|
2017-04-26 20:05:40 +00:00
|
|
|
// - Blood and heart ----------------------------------------------------------
|
2018-05-11 14:28:25 +00:00
|
|
|
_unit setVariable [VAR_BLOOD_VOL, DEFAULT_BLOOD_VOLUME, true];
|
|
|
|
_unit setVariable [VAR_HEART_RATE, DEFAULT_HEART_RATE, true];
|
2018-05-11 15:11:01 +00:00
|
|
|
_unit setVariable [VAR_HEART_RATE_ADJ, [], true];
|
2018-05-11 14:28:25 +00:00
|
|
|
_unit setVariable [VAR_BLOOD_PRESS, [80, 120], true];
|
2018-05-23 09:52:47 +00:00
|
|
|
_unit setVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES, true];
|
|
|
|
_unit setVariable [VAR_PERIPH_RES_ADJ, [], true];
|
2018-05-22 17:06:28 +00:00
|
|
|
_unit setVariable [VAR_CRDC_ARRST, false, true];
|
2018-05-22 17:25:07 +00:00
|
|
|
_unit setVariable [VAR_HEMORRHAGE, 0, true];
|
2018-05-22 17:06:28 +00:00
|
|
|
_unit setVariable [VAR_IS_BLEEDING, false, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2017-04-26 20:05:40 +00:00
|
|
|
// - Pain ---------------------------------------------------------------------
|
2018-05-11 14:28:25 +00:00
|
|
|
_unit setVariable [VAR_PAIN, 0, true];
|
2018-05-22 17:06:28 +00:00
|
|
|
_unit setVariable [VAR_IN_PAIN, false, true];
|
2018-05-11 14:28:25 +00:00
|
|
|
_unit setVariable [VAR_PAIN_SUPP, 0, true];
|
2018-05-11 15:11:01 +00:00
|
|
|
_unit setVariable [VAR_PAIN_SUPP_ADJ, [], true];
|
2016-02-03 20:40:26 +00:00
|
|
|
|
2017-04-26 20:05:40 +00:00
|
|
|
// - Wounds -------------------------------------------------------------------
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,openWounds), [], true];
|
|
|
|
_unit setVariable [QEGVAR(medical,bandagedWounds), [], true];
|
|
|
|
_unit setVariable [QEGVAR(medical,stitchedWounds), [], true];
|
2018-07-15 14:24:04 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,isLimping), false, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2017-04-26 20:05:40 +00:00
|
|
|
// - Misc ---------------------------------------------------------------------
|
2018-05-22 16:21:24 +00:00
|
|
|
_unit setVariable [VAR_UNCON, false, true];
|
2017-04-26 20:05:40 +00:00
|
|
|
|
|
|
|
// - Treatments ---------------------------------------------------------------
|
2018-07-29 21:43:14 +00:00
|
|
|
_unit setVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES, true];
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,occludedMedications), nil, true]; //Delayed Medications (from tourniquets)
|
|
|
|
_unit setVariable [QEGVAR(medical,ivBags), nil, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// triage card and logs
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,triageLevel), 0, true];
|
|
|
|
_unit setVariable [QEGVAR(medical,triageCard), [], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// damage storage
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true];
|
2016-12-08 10:38:43 +00:00
|
|
|
#ifdef DEBUG_TESTRESULTS
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,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
|
|
|
// medication
|
2018-07-15 13:00:16 +00:00
|
|
|
private _allUsedMedication = _unit getVariable [QEGVAR(medical,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;
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,allUsedMedication), [], true];
|
2015-02-28 10:47:35 +00:00
|
|
|
|
2016-06-30 15:33:29 +00:00
|
|
|
// TODO move to treatment
|
2018-07-15 13:00:16 +00:00
|
|
|
private _logs = _unit getVariable [QEGVAR(medical,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;
|
2018-07-15 13:00:16 +00:00
|
|
|
_unit setVariable [QEGVAR(medical,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;
|