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>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* nil
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_unit"];
|
2015-02-06 12:47:17 +00:00
|
|
|
|
2015-04-19 15:28:47 +00:00
|
|
|
_unit setVariable [QGVAR(pain), 0, true];
|
|
|
|
_unit setVariable [QGVAR(bloodVolume), 100, true];
|
2016-06-30 15:33:29 +00:00
|
|
|
_unit setVariable ["ACE_isUnconscious", false, true]; // TODO this is done based on state
|
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];
|
2015-09-03 15:17:54 +00:00
|
|
|
_unit setVariable [QGVAR(internalWounds), [], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// vitals
|
|
|
|
_unit setVariable [QGVAR(heartRate), 80];
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(heartRateAdjustments), []];
|
|
|
|
_unit setVariable [QGVAR(bloodPressure), [80, 120]];
|
2015-09-03 15:17:54 +00:00
|
|
|
_unit setVariable [QGVAR(peripheralResistance), 100];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// fractures
|
|
|
|
_unit setVariable [QGVAR(fractures), [], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// triage card and logs
|
2016-06-30 15:33:29 +00:00
|
|
|
// TODO move to treatment
|
|
|
|
//_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
|
|
|
|
_unit setVariable [QGVAR(salineIVVolume), 0, true];
|
|
|
|
_unit setVariable [QGVAR(plasmaIVVolume), 0, true];
|
|
|
|
_unit setVariable [QGVAR(bloodIVVolume), 0, true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// damage storage
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// airway
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(airwayStatus), 100];
|
2015-09-03 15:17:54 +00:00
|
|
|
_unit setVariable [QGVAR(airwayOccluded), false];
|
2015-11-30 16:27:09 +00:00
|
|
|
_unit setVariable [QGVAR(airwayCollapsed), false];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// generic medical admin
|
2016-06-30 15:33:29 +00:00
|
|
|
_unit setVariable [QGVAR(addedToUnitLoop), false, true]; // TODO this is replaced by unit state
|
|
|
|
_unit setVariable [QGVAR(inCardiacArrest), false, true]; // TODO this is no longer present
|
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(amountOfReviveLives), GVAR(amountOfReviveLives), true];
|
|
|
|
_unit setVariable [QGVAR(painSuppress), 0, true];
|
2015-09-02 18:13:51 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
private ["_allUsedMedication", "_logs"];
|
2015-02-28 10:41:27 +00:00
|
|
|
|
2015-09-03 15:17:54 +00:00
|
|
|
// medication
|
|
|
|
_allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []];
|
|
|
|
{
|
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
|
2015-11-30 16:27:09 +00:00
|
|
|
_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-06-30 15:33:29 +00:00
|
|
|
// TODO move to treatment
|
2015-03-21 20:59:08 +00:00
|
|
|
// items
|
|
|
|
[{
|
|
|
|
_this call FUNC(itemCheck);
|
2016-05-22 13:27:24 +00:00
|
|
|
}, [_unit], 0.5, 0.1] call CBA_fnc_waitAndExecute;
|