From f12d69e2313999057d951adce970ad3807ff196f Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Wed, 26 Apr 2017 22:05:40 +0200 Subject: [PATCH] Added proper addon basics to status, moved more functions into status --- addons/medical_status/CfgEventHandlers.hpp | 25 ++++++++++ addons/medical_status/XEH_PREP.sqf | 0 addons/medical_status/XEH_preInit.sqf | 9 ++++ addons/medical_status/XEH_preStart.sqf | 3 ++ addons/medical_status/config.cpp | 2 + .../functions/fnc_getBloodLoss.sqf | 0 .../functions/fnc_getBloodPressure.sqf | 0 .../functions/fnc_getBloodVolumeChange.sqf | 0 .../functions/fnc_getCardiacOutput.sqf | 0 .../functions/fnc_getPainLevel.sqf | 0 .../functions/fnc_initUnit.sqf} | 48 +++++++++---------- 11 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 addons/medical_status/CfgEventHandlers.hpp create mode 100644 addons/medical_status/XEH_PREP.sqf create mode 100644 addons/medical_status/XEH_preInit.sqf create mode 100644 addons/medical_status/XEH_preStart.sqf rename addons/{medical => medical_status}/functions/fnc_getBloodLoss.sqf (100%) rename addons/{medical => medical_status}/functions/fnc_getBloodPressure.sqf (100%) rename addons/{medical => medical_status}/functions/fnc_getBloodVolumeChange.sqf (100%) rename addons/{medical => medical_status}/functions/fnc_getCardiacOutput.sqf (100%) rename addons/{medical => medical_status}/functions/fnc_getPainLevel.sqf (100%) rename addons/{medical/functions/fnc_init.sqf => medical_status/functions/fnc_initUnit.sqf} (85%) diff --git a/addons/medical_status/CfgEventHandlers.hpp b/addons/medical_status/CfgEventHandlers.hpp new file mode 100644 index 0000000000..a6ea04545c --- /dev/null +++ b/addons/medical_status/CfgEventHandlers.hpp @@ -0,0 +1,25 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Init_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE(call FUNC(install)); + }; + }; +}; diff --git a/addons/medical_status/XEH_PREP.sqf b/addons/medical_status/XEH_PREP.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/medical_status/XEH_preInit.sqf b/addons/medical_status/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/medical_status/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/medical_status/XEH_preStart.sqf b/addons/medical_status/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/medical_status/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/medical_status/config.cpp b/addons/medical_status/config.cpp index e2b494b65a..74b18f2184 100644 --- a/addons/medical_status/config.cpp +++ b/addons/medical_status/config.cpp @@ -13,3 +13,5 @@ class CfgPatches { VERSION_CONFIG; }; }; + +#include "CfgEventHandlers.hpp" diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf similarity index 100% rename from addons/medical/functions/fnc_getBloodLoss.sqf rename to addons/medical_status/functions/fnc_getBloodLoss.sqf diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical_status/functions/fnc_getBloodPressure.sqf similarity index 100% rename from addons/medical/functions/fnc_getBloodPressure.sqf rename to addons/medical_status/functions/fnc_getBloodPressure.sqf diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical_status/functions/fnc_getBloodVolumeChange.sqf similarity index 100% rename from addons/medical/functions/fnc_getBloodVolumeChange.sqf rename to addons/medical_status/functions/fnc_getBloodVolumeChange.sqf diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical_status/functions/fnc_getCardiacOutput.sqf similarity index 100% rename from addons/medical/functions/fnc_getCardiacOutput.sqf rename to addons/medical_status/functions/fnc_getCardiacOutput.sqf diff --git a/addons/medical/functions/fnc_getPainLevel.sqf b/addons/medical_status/functions/fnc_getPainLevel.sqf similarity index 100% rename from addons/medical/functions/fnc_getPainLevel.sqf rename to addons/medical_status/functions/fnc_getPainLevel.sqf diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical_status/functions/fnc_initUnit.sqf similarity index 85% rename from addons/medical/functions/fnc_init.sqf rename to addons/medical_status/functions/fnc_initUnit.sqf index 266c8dc501..1a896bb50a 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical_status/functions/fnc_initUnit.sqf @@ -18,34 +18,41 @@ if (damage _unit > 0) then { _unit setDamage 0; }; -_unit setVariable [QGVAR(pain), 0, true]; +// - Blood and heart ---------------------------------------------------------- _unit setVariable [QGVAR(bloodVolume), DEFAULT_BLOOD_VOLUME, true]; -_unit setVariable [QGVAR(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]; - -// 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]; +_unit setVariable [QGVAR(inCardiacArrest), false, true]; +_unit setVariable [QGVAR(hasLostBlood), 0, true]; +_unit setVariable [QGVAR(isBleeding), false, true]; + +// - Pain --------------------------------------------------------------------- +_unit setVariable [QGVAR(pain), 0, true]; +_unit setVariable [QGVAR(hasPain), false, true]; +_unit setVariable [QGVAR(painSuppress), 0, true]; +_unit setVariable [QGVAR(painSuppressAdjustments), [], true]; + +// - Wounds ------------------------------------------------------------------- +_unit setVariable [QGVAR(openWounds), [], true]; +_unit setVariable [QGVAR(bandagedWounds), [], true]; +_unit setVariable [QGVAR(stitchedWounds), [], true]; + +// - Misc --------------------------------------------------------------------- +_unit setVariable [QGVAR(isUnconscious), false, true]; + +// - Treatments --------------------------------------------------------------- +_unit setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; +_unit setVariable [QGVAR(occludedMedications), nil, true]; //Delayed Medications (from tourniquets) +_unit setVariable [QGVAR(ivBags), nil, true]; +_unit setVariable [QGVAR(partialHealCounter), 0, 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 @@ -53,13 +60,6 @@ _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]; - private ["_allUsedMedication", "_logs"]; // medication