ACE3/addons/medical/functions/fnc_init.sqf
PabstMirror 5c4dbdcbda Merge branch 'master' into medical-rewrite
Conflicts:
	addons/medical/ACE_Settings.hpp
	addons/medical/XEH_postInit.sqf
	addons/medical/functions/fnc_adjustPainLevel.sqf
	addons/medical/functions/fnc_copyDeadBody.sqf
	addons/medical/functions/fnc_getTriageStatus.sqf
	addons/medical/functions/fnc_handleBandageOpening.sqf
	addons/medical/functions/fnc_handleCollisionDamage.sqf
	addons/medical/functions/fnc_handleDamage_fractures.sqf
	addons/medical/functions/fnc_handleDamage_woundsOld.sqf
	addons/medical/functions/fnc_init.sqf
	addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf
	addons/medical/functions/fnc_parseConfigForInjuries.sqf
	addons/medical/functions/fnc_setDead.sqf
	addons/medical/functions/fnc_setHitPointDamage.sqf
	addons/medical/functions/fnc_setUnconscious.sqf
	addons/medical/functions/fnc_showBloodEffect.sqf
	addons/medical/functions/fnc_unconsciousPFH.sqf
	addons/medical/stringtable.xml
	addons/medical_ai/functions/fnc_healUnit.sqf
	addons/medical_ai/functions/fnc_isInjured.sqf
	addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf
2017-10-24 16:13:12 -05:00

86 lines
2.5 KiB
Plaintext

/*
* Author: KoffeinFlummi, commy2
* Initializes unit variables.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [bob] call ACE_medical_fnc_init
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
if (damage _unit > 0) then {
_unit setDamage 0;
};
_unit setVariable [QGVAR(pain), 0, true];
_unit setVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME, true];
_unit setVariable ["ACE_isUnconscious", false, true];
_unit setVariable [QGVAR(partialHealCounter), 0, true];
// tourniquets
_unit setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true];
_unit setVariable [QGVAR(occludedMedications), nil, true]; //Delayed Medications (from tourniquets)
// wounds and injuries
_unit setVariable [QGVAR(openWounds), [], true];
_unit setVariable [QGVAR(bandagedWounds), [], true];
_unit setVariable [QGVAR(stitchedWounds), [], true];
_unit setVariable [QEGVAR(medical_engine,isLimping), false, true];
// vitals
_unit setVariable [QGVAR(heartRate), DEFAULT_HEART_RATE, true];
_unit setVariable [QGVAR(heartRateAdjustments), [], true];
_unit setVariable [QGVAR(bloodPressure), [80, 120], true];
_unit setVariable [QGVAR(peripheralResistance), 100, true];
_unit setVariable [QGVAR(peripheralResistanceAdjustments), [], true];
// triage card and logs
_unit setVariable [QGVAR(triageLevel), 0, true];
_unit setVariable [QGVAR(triageCard), [], true];
// IVs
_unit setVariable [QGVAR(ivBags), nil, true];
// damage storage
_unit setVariable [QGVAR(bodyPartDamage), [0,0,0,0,0,0], true];
#ifdef DEBUG_TESTRESULTS
_unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true];
#endif
// generic medical admin
_unit setVariable [QGVAR(inCardiacArrest), false, true];
_unit setVariable [QGVAR(hasLostBlood), 0, true];
_unit setVariable [QGVAR(isBleeding), false, true];
_unit setVariable [QGVAR(hasPain), false, true];
_unit setVariable [QGVAR(painSuppress), 0, true];
_unit setVariable [QGVAR(painSuppressAdjustments), [], true];
// medication
private _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []];
{
_unit setVariable [_x select 0, nil];
} forEach _allUsedMedication;
_unit setVariable [QGVAR(allUsedMedication), [], true];
// TODO move to treatment
private _logs = _unit getVariable [QGVAR(allLogs), []];
{
_unit setVariable [_x, nil];
} forEach _logs;
_unit setVariable [QGVAR(allLogs), [], true];
[{
params ["_unit"];
TRACE_2("Unit Init",_unit,local _unit);
[QGVAR(initialized), [_unit]] call CBA_fnc_localEvent;
}, [_unit], 0.5] call CBA_fnc_waitAndExecute;