From 49c0157939fc4a5a97ce13562e5d31c4f6dae54e Mon Sep 17 00:00:00 2001 From: MiszczuZPolski <71414303+MiszczuZPolski@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:26:00 +0200 Subject: [PATCH] Miscellaneous fixes for ACE update (#413) **When merged this pull request will:** - Fix KAM stuff that is broken due to ace update ### IMPORTANT - [Development Guidelines](https://ace3.acemod.org/wiki/development/) are read, understood and applied. - Title of this PR uses our standard template `Component - Add|Fix|Improve|Change|Make|Remove {changes}`. --------- Co-authored-by: Blue --- .gitignore | 4 + .../airway/ACE_Medical_Treatment_Actions.hpp | 11 +- addons/airway/CfgWeapons.hpp | 3 + addons/airway/functions/script_component.hpp | 23 +- addons/airway/script_component.hpp | 2 +- .../ACE_Medical_Treatment_Actions.hpp | 48 +-- addons/breathing/CfgWeapons.hpp | 11 + addons/breathing/XEH_PREP.hpp | 2 - addons/breathing/XEH_preInit.sqf | 26 +- .../functions/fnc_checkBreathing.sqf | 2 +- .../functions/fnc_handlePulmoHit.sqf | 4 +- .../fnc_treatmentAdvanced_Cyanosis.sqf | 22 -- .../fnc_treatmentAdvanced_CyanosisLocal.sqf | 57 --- .../breathing/functions/script_component.hpp | 23 +- addons/breathing/script_component.hpp | 4 +- addons/breathing/stringtable.xml | 118 +------ addons/circulation/CfgVehicles.hpp | 17 +- addons/circulation/CfgWeapons.hpp | 49 +-- .../fnc_AEDX_ConnectVitalsMonitor.sqf | 18 +- .../fnc_AEDX_DisconnectVitalsMonitor.sqf | 1 + .../functions/fnc_AEDX_VitalsMonitor.sqf | 174 ++++----- .../fnc_Defibrillator_AttachPads.sqf | 19 +- .../fnc_Defibrillator_RemovePads.sqf | 1 + .../fnc_getCardiacArrestHeartRate.sqf | 2 +- .../functions/fnc_handleCardiacArrest.sqf | 16 +- addons/circulation/functions/fnc_placeAED.sqf | 66 ++-- addons/gui/XEH_preInit.sqf | 105 +++++- .../fnc_displayPatientInformation.sqf | 2 +- addons/gui/functions/fnc_menuPFH.sqf | 2 +- addons/gui/functions/fnc_onMenuClose.sqf | 4 +- addons/gui/functions/fnc_onMenuOpen.sqf | 39 +- addons/gui/functions/fnc_updateActions.sqf | 38 +- addons/gui/functions/fnc_updateBodyImage.sqf | 54 ++- addons/gui/functions/fnc_updateCategories.sqf | 20 +- addons/gui/functions/fnc_updateInjuryList.sqf | 333 +++++++++++------- addons/gui/gui.hpp | 32 +- addons/gui/script_component.hpp | 29 +- addons/gui/stringtable.xml | 18 + addons/main/script_macros.hpp | 13 +- addons/main/script_mod.hpp | 6 +- addons/main/script_version.hpp | 6 +- addons/misc/XEH_preInit.sqf | 20 +- addons/misc/functions/fnc_carryObject.sqf | 47 ++- addons/misc/functions/fnc_fullHealLocal.sqf | 27 +- addons/misc/functions/fnc_handleRespawn.sqf | 19 +- .../misc/functions/fnc_handleUnconscious.sqf | 2 + addons/misc/functions/fnc_hasItem.sqf | 3 +- addons/misc/functions/fnc_hasStableVitals.sqf | 2 +- addons/misc/functions/fnc_treatment.sqf | 2 +- .../misc/functions/fnc_treatmentSuccess.sqf | 2 +- addons/misc/functions/fnc_useItem.sqf | 5 +- addons/misc/functions/script_component.hpp | 23 +- addons/misc/script_component.hpp | 2 + addons/misc/stringtable.xml | 41 +-- addons/pharma/CfgWeapons.hpp | 22 ++ addons/pharma/XEH_postInit.sqf | 18 +- addons/pharma/XEH_preInit.sqf | 11 +- addons/pharma/functions/fnc_init.sqf | 32 +- .../fnc_treatmentAdvanced_CarbonateLocal.sqf | 4 +- .../fnc_treatmentAdvanced_EACALocal.sqf | 63 ++-- .../fnc_treatmentAdvanced_PervitinLocal.sqf | 4 +- ...c_treatmentAdvanced_ReorientationLocal.sqf | 4 +- .../fnc_treatmentAdvanced_TXALocal.sqf | 16 +- addons/pharma/functions/script_component.hpp | 23 +- addons/pharma/stringtable.xml | 10 +- .../surgery/ACE_Medical_Treatment_Actions.hpp | 24 +- addons/surgery/CfgWeapons.hpp | 5 + addons/surgery/XEH_PREP.hpp | 8 +- addons/surgery/XEH_postInit.sqf | 2 - addons/surgery/XEH_preInit.sqf | 6 +- addons/surgery/functions/fnc_canNPWT.sqf | 23 ++ addons/surgery/functions/fnc_debridement.sqf | 22 -- .../functions/fnc_debridementCheck.sqf | 59 ---- .../functions/fnc_debridementLocal.sqf | 48 --- .../functions/fnc_fractureSelectLocal.sqf | 1 - addons/surgery/functions/fnc_getNPWTTime.sqf | 23 ++ addons/surgery/functions/fnc_init.sqf | 1 - .../surgery/functions/fnc_npwtTreatment.sqf | 22 -- .../functions/fnc_npwtTreatmentLocal.sqf | 114 ------ .../functions/fnc_npwtTreatmentProgress.sqf | 75 ++++ addons/surgery/functions/script_component.hpp | 21 +- addons/surgery/script_component.hpp | 2 +- .../functions/fnc_toggleAIDeathModule.sqf | 2 +- include/a3/ui_f/$PBOPREFIX$ | 1 + include/x/cba/addons/main/$PBOPREFIX$ | 1 + include/x/cba/addons/xeh/$PBOPREFIX$ | 1 + .../medical_engine/script_macros_medical.hpp | 31 +- tools/stringtable_validator.py | 4 + 88 files changed, 1115 insertions(+), 1207 deletions(-) delete mode 100644 addons/breathing/functions/fnc_treatmentAdvanced_Cyanosis.sqf delete mode 100644 addons/breathing/functions/fnc_treatmentAdvanced_CyanosisLocal.sqf create mode 100644 addons/surgery/functions/fnc_canNPWT.sqf delete mode 100644 addons/surgery/functions/fnc_debridement.sqf delete mode 100644 addons/surgery/functions/fnc_debridementCheck.sqf delete mode 100644 addons/surgery/functions/fnc_debridementLocal.sqf create mode 100644 addons/surgery/functions/fnc_getNPWTTime.sqf delete mode 100644 addons/surgery/functions/fnc_npwtTreatment.sqf delete mode 100644 addons/surgery/functions/fnc_npwtTreatmentLocal.sqf create mode 100644 addons/surgery/functions/fnc_npwtTreatmentProgress.sqf create mode 100644 include/a3/ui_f/$PBOPREFIX$ create mode 100644 include/x/cba/addons/main/$PBOPREFIX$ create mode 100644 include/x/cba/addons/xeh/$PBOPREFIX$ diff --git a/.gitignore b/.gitignore index 7dabc4fdc..ec6d08138 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,7 @@ keys/* #### hemtt.exe ArmaScriptCompiler.exe + +#SQF-VM Server +.vscode\sqfvm-lsp +.vscode \ No newline at end of file diff --git a/addons/airway/ACE_Medical_Treatment_Actions.hpp b/addons/airway/ACE_Medical_Treatment_Actions.hpp index 48bad21a8..a5cee1d9f 100644 --- a/addons/airway/ACE_Medical_Treatment_Actions.hpp +++ b/addons/airway/ACE_Medical_Treatment_Actions.hpp @@ -9,7 +9,7 @@ class ACE_Medical_Treatment_Actions { medicRequired = QGVAR(medLvl_Larynxtubus); treatmentTime = QGVAR(Larynxtubus_time); items[] = {"kat_larynx"}; - condition = QUOTE(!([_patient] call ace_common_fnc_isAwake) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus')); + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus')); callbackSuccess = QFUNC(treatmentAdvanced_airway); callbackFailure = ""; callbackProgress = ""; @@ -30,14 +30,14 @@ class ACE_Medical_Treatment_Actions { medicRequired = QGVAR(medLvl_Larynxtubus); treatmentTime = QGVAR(Larynxtubus_time); items[] = {}; - condition = QUOTE(!([_patient] call ace_common_fnc_isAwake) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && (_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && (_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); callbackSuccess = QFUNC(treatmentAdvanced_RemoveAirwayItem); }; class Guedeltubus: Larynxtubus { displayName = CSTRING(Guedeltubus_Display); medicRequired = QGVAR(medLvl_Guedeltubus); treatmentTime = QGVAR(Guedeltubus_time); - condition = QUOTE(!([_patient] call ace_common_fnc_isAwake) && missionNamespace getVariable [ARR_2(QQGVAR(enable),true)] && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && missionNamespace getVariable [ARR_2(QQGVAR(enable),true)] && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); items[] = {"kat_guedel"}; icon = QPATHTOF(ui\guedel.paa); callbackSuccess = QFUNC(treatmentAdvanced_airway); @@ -49,13 +49,14 @@ class ACE_Medical_Treatment_Actions { treatmentTime = QGVAR(Guedeltubus_time); items[] = {}; icon = QPATHTOF(ui\guedel.paa); - condition = QUOTE(!([_patient] call ace_common_fnc_isAwake) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && (_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus')); + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && (_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus')); callbackSuccess = QFUNC(treatmentAdvanced_RemoveAirwayItem); }; class Accuvac: Larynxtubus { displayName = "Accuvac"; treatmentTime = QGVAR(Accuvac_time); items[] = {"kat_accuvac"}; + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); icon = QPATHTOF(ui\accuvac.paa); consumeItem = 0; medicRequired = QGVAR(medLvl_Accuvac); @@ -70,7 +71,7 @@ class ACE_Medical_Treatment_Actions { medicRequired = 0; items[] = {}; icon = ""; - condition = QUOTE(!([_patient] call ace_common_fnc_isAwake) && !(_patient getVariable [ARR_2(QQGVAR(overstretch), false)]) && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); + condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && !(_patient getVariable [ARR_2(QQGVAR(overstretch), false)]) && !(_patient getVariable [ARR_2(QQGVAR(recovery),false)]) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Guedeltubus') && !(_patient getVariable [ARR_2(QQGVAR(airway_item), '')] == 'Larynxtubus')); callbackSuccess = QFUNC(treatmentAdvanced_overstretchHead); }; class BeginHeadTurning: Larynxtubus { diff --git a/addons/airway/CfgWeapons.hpp b/addons/airway/CfgWeapons.hpp index 3d4ac8df1..ca388a345 100644 --- a/addons/airway/CfgWeapons.hpp +++ b/addons/airway/CfgWeapons.hpp @@ -9,6 +9,7 @@ class CfgWeapons { descriptionShort = CSTRING(Larynx_Desc_Short); picture = QPATHTOF(ui\larynx_normal.paa); model = QPATHTOF(models\larynx_tube\tube.p3d); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -20,6 +21,7 @@ class CfgWeapons { descriptionShort = CSTRING(Guedel_Desc_Short); picture = QPATHTOF(ui\guedel_normal.paa); model = QPATHTOF(models\guedel\guedel.p3d); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -31,6 +33,7 @@ class CfgWeapons { descriptionShort = CSTRING(Accuvac_Desc_Short); picture = QPATHTOF(ui\accuvac_normal.paa); model = QPATHTOF(models\accuvac\accuvac.p3d); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 7; }; diff --git a/addons/airway/functions/script_component.hpp b/addons/airway/functions/script_component.hpp index be96a2c0f..d6d439a87 100644 --- a/addons/airway/functions/script_component.hpp +++ b/addons/airway/functions/script_component.hpp @@ -1,22 +1 @@ -#include "\x\kat\addons\airway\script_component.hpp" - -// Override the macros used by ACE -#define VAR_BLOOD_PRESS "ACE_medical_bloodPressure" -#define VAR_BLOOD_VOL "ACE_medical_bloodVolume" -#define VAR_WOUND_BLEEDING "ACE_medical_woundBleeding" -#define VAR_CRDC_ARRST "ACE_medical_inCardiacArrest" -#define VAR_HEART_RATE "ACE_medical_heartRate" -#define VAR_PAIN "ACE_medical_pain" -#define VAR_PAIN_SUPP "ACE_medical_painSuppress" -#define VAR_PERIPH_RES "ACE_medical_peripheralResistance" -#define VAR_UNCON "ACE_isUnconscious" -#define VAR_OPEN_WOUNDS "ACE_medical_openWounds" -#define VAR_BANDAGED_WOUNDS "ACE_medical_bandagedWounds" -#define VAR_STITCHED_WOUNDS "ACE_medical_stitchedWounds" -// These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS "ACE_medical_medications" -// These variables track the current state of status values above -#define VAR_HEMORRHAGE "ACE_medical_hemorrhage" -#define VAR_IN_PAIN "ACE_medical_inPain" -#define VAR_TOURNIQUET "ACE_medical_tourniquets" -#define VAR_FRACTURES "ACE_medical_fractures" +#include "\x\kat\addons\airway\script_component.hpp" \ No newline at end of file diff --git a/addons/airway/script_component.hpp b/addons/airway/script_component.hpp index 17488047e..576d677b9 100644 --- a/addons/airway/script_component.hpp +++ b/addons/airway/script_component.hpp @@ -73,4 +73,4 @@ #define IDC_BODY_LEGRIGHT_B 6070 #define IDC_TRIAGE_STATUS 7000 -#define IDC_TRIAGE_SELECT 7100 +#define IDC_TRIAGE_SELECT 7100 \ No newline at end of file diff --git a/addons/breathing/ACE_Medical_Treatment_Actions.hpp b/addons/breathing/ACE_Medical_Treatment_Actions.hpp index 28eb772e4..43e448fd6 100644 --- a/addons/breathing/ACE_Medical_Treatment_Actions.hpp +++ b/addons/breathing/ACE_Medical_Treatment_Actions.hpp @@ -1,5 +1,24 @@ class ACE_Medical_Treatment_Actions { class CheckPulse; + class ListenToLungs: CheckPulse { + displayName = CSTRING(auscultateLung_display); + displayNameProgress = CSTRING(listening_progress); + treatmentTime = QGVAR(stethoscopeListeningTime); + allowedSelections[] = {"Body"}; + allowSelfTreatment = 0; + category = "airway"; + medicRequired = 0; + consumeItem = 0; + callbackStart = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), true, true)]; [ARR_2(_medic, _patient)] spawn FUNC(listenLungs)); + callbackSuccess = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), false, true)]); + callbackProgress = ""; + callbackFailure = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), false, true)]); + condition = "true"; + items[] = {"kat_stethoscope"}; + animationPatient = ""; + animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; + animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"}; + }; class CheckBreathing: CheckPulse { displayName = CSTRING(Check_Breathing); displayNameProgress = CSTRING(Check_Breathing_Progress); @@ -175,35 +194,6 @@ class ACE_Medical_Treatment_Actions { animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; litter[] = {}; }; - class ListenToLungs: CheckPulse { - displayName = CSTRING(auscultateLung_display); - displayNameProgress = CSTRING(listening_progress); - treatmentTime = QGVAR(stethoscopeListeningTime); - allowedSelections[] = {"Body"}; - allowSelfTreatment = 0; - category = "airway"; - medicRequired = 0; - consumeItem = 0; - callbackStart = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), true, true)]; [ARR_2(_medic, _patient)] spawn FUNC(listenLungs)); - callbackSuccess = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), false, true)]); - callbackProgress = ""; - callbackFailure = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope), false, true)]); - condition = "true"; - items[] = {"kat_stethoscope"}; - animationPatient = ""; - animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; - animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"}; - }; - class CheckCyanosis: CheckPulse { - displayName = CSTRING(CheckCyanosis_Name); - displayNameProgress = CSTRING(CheckCyanosis_Progress); - treatmentTime = 3; - allowedSelections[] = {"Head", "LeftArm", "RightArm"}; - allowSelfTreatment = 1; - medicRequired = QGVAR(medLvl_Cyanosis); - condition = QUOTE(GVAR(enableCyanosis) && !(GVAR(cyanosisShowInMenu))); - callbackSuccess = QFUNC(treatmentAdvanced_Cyanosis); - }; class DisablePulseOximeterAudio { displayName = CSTRING(PulseOximeter_Action_removeSound); displayNameProgress = ""; diff --git a/addons/breathing/CfgWeapons.hpp b/addons/breathing/CfgWeapons.hpp index c18393c03..d1e550656 100644 --- a/addons/breathing/CfgWeapons.hpp +++ b/addons/breathing/CfgWeapons.hpp @@ -11,6 +11,7 @@ class CfgWeapons { descriptionShort = CSTRING(Pulseoximeter_Desc_Short); picture = QPATHTOF(ui\Pulseoximeter_normal.paa); model = QPATHTOF(models\pulseox\pulseox.p3d); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -23,6 +24,7 @@ class CfgWeapons { displayName = CSTRING(chestseal_display); descriptionShort = CSTRING(chestseal_desc); picture = QPATHTOF(ui\chest-seal.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -35,6 +37,7 @@ class CfgWeapons { displayName = CSTRING(aatKit_display); descriptionShort = CSTRING(aatKit_desc); picture = QPATHTOF(ui\surgical_airway_kit.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; @@ -47,6 +50,7 @@ class CfgWeapons { displayName = CSTRING(ncdKit_display); descriptionShort = CSTRING(ncdKit_desc); picture = QPATHTOF(ui\ndcKit.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2; }; @@ -59,6 +63,7 @@ class CfgWeapons { displayName = CSTRING(Stethoscope_display); descriptionShort= CSTRING(Stethoscope_desc); picture = QPATHTOF(ui\steth.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; @@ -70,6 +75,7 @@ class CfgWeapons { displayName = CSTRING(BVM_Display); descriptionShort = CSTRING(BVM_Desc_Short); picture = QPATHTOF(ui\BVM.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 8; }; @@ -80,6 +86,7 @@ class CfgWeapons { displayName = CSTRING(PocketBVM_Display); descriptionShort = CSTRING(PocketBVM_Desc_Short); picture = QPATHTOF(ui\pocketBVM.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 3; }; @@ -90,6 +97,7 @@ class CfgWeapons { displayName = CSTRING(PortableOxygenTank_150_Display); descriptionShort = CSTRING(PortableOxygenTank_150_Desc_Short); picture = QPATHTOF(ui\oxygenTank.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; @@ -100,6 +108,7 @@ class CfgWeapons { displayName = CSTRING(PortableOxygenTank_300_Display); descriptionShort = CSTRING(PortableOxygenTank_300_Desc_Short); picture = QPATHTOF(ui\oxygenTank.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 20; }; @@ -110,6 +119,7 @@ class CfgWeapons { displayName = CSTRING(PortableOxygenTank_150_Empty_Display); descriptionShort = CSTRING(PortableOxygenTank_Empty_Desc_Short); picture = QPATHTOF(ui\oxygenTank.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 10; }; @@ -120,6 +130,7 @@ class CfgWeapons { displayName = CSTRING(PortableOxygenTank_300_Empty_Display); descriptionShort = CSTRING(PortableOxygenTank_Empty_Desc_Short); picture = QPATHTOF(ui\oxygenTank.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 20; }; diff --git a/addons/breathing/XEH_PREP.hpp b/addons/breathing/XEH_PREP.hpp index 3f2cbb137..0fcd420cc 100644 --- a/addons/breathing/XEH_PREP.hpp +++ b/addons/breathing/XEH_PREP.hpp @@ -12,8 +12,6 @@ PREP(lowSpO2pp); PREP(refillOxygenTank); PREP(treatmentAdvanced_chestSeal); PREP(treatmentAdvanced_chestSealLocal); -PREP(treatmentAdvanced_Cyanosis); -PREP(treatmentAdvanced_CyanosisLocal); PREP(treatmentAdvanced_hemopneumothorax); PREP(treatmentAdvanced_hemopneumothoraxLocal); PREP(treatmentAdvanced_pulseoximeter); diff --git a/addons/breathing/XEH_preInit.sqf b/addons/breathing/XEH_preInit.sqf index 8938e150b..e5b20d13d 100644 --- a/addons/breathing/XEH_preInit.sqf +++ b/addons/breathing/XEH_preInit.sqf @@ -319,36 +319,16 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; -//Enables cyanosis diagnose +// Shows cyanosis in medical menu [ - QGVAR(enableCyanosis), + QGVAR(showCyanosis), "CHECKBOX", - [LLSTRING(SETTING_Cyanosis), LLSTRING(SETTING_Cyanosis_DESC)], + [LLSTRING(SETTING_showCyanosis), LLSTRING(SETTING_showCyanosis_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Cyanosis)], [true], true ] call CBA_Settings_fnc_init; -//Enables displaying cyanosis in overview tab and hides cyanosis diagnose action -[ - QGVAR(cyanosisShowInMenu), - "CHECKBOX", - [LLSTRING(SETTING_Cyanosis_ShowInMenu), LLSTRING(SETTING_Cyanosis_ShowInMenu_DESC)], - [CBA_SETTINGS_CAT, LSTRING(SubCategory_Cyanosis)], - [false], - true -] call CBA_Settings_fnc_init; - -//Settable list for checking Cyanosis per medical class -[ - QGVAR(medLvl_Cyanosis), - "LIST", - [LLSTRING(CYANOSIS_TREATMENT_LEVEL), LLSTRING(CYANOSIS_TREATMENT_LEVEL_DESCRIPTION)], - [CBA_SETTINGS_CAT, LSTRING(SubCategory_Cyanosis)], - [[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], - true -] call CBA_settings_fnc_init; - //Slight level for cyanosis [ QGVAR(slightValue), diff --git a/addons/breathing/functions/fnc_checkBreathing.sqf b/addons/breathing/functions/fnc_checkBreathing.sqf index 4eda8d87d..a92c6afde 100644 --- a/addons/breathing/functions/fnc_checkBreathing.sqf +++ b/addons/breathing/functions/fnc_checkBreathing.sqf @@ -44,7 +44,7 @@ if (_ph < 750) then { _output = format ["%1%2", _breathing ,_breath]; _output_log = format ["%1%2", _breathing_log, _breath]; -if (_hr == 0 || !(alive _patient) || _patient getVariable [QEGVAR(airway,obstruction), false] || _patient getVariable [QEGVAR(airway,occluded), false] || _patient getVariable [QGVAR(hemopneumothorax), false] || _patient getVariable [QGVAR(tensionpneumothorax), false]) then { +if (_hr == 0 || !(alive _patient) || (_patient getVariable [QEGVAR(airway,obstruction), false] && !(_patient getVariable [QEGVAR(airway,overstretch), false])) || _patient getVariable [QEGVAR(airway,occluded), false] || _patient getVariable [QGVAR(hemopneumothorax), false] || _patient getVariable [QGVAR(tensionpneumothorax), false]) then { _output = LLSTRING(breathing_none); _output_log = ACELSTRING(medical_treatment,Check_Pulse_None); }; diff --git a/addons/breathing/functions/fnc_handlePulmoHit.sqf b/addons/breathing/functions/fnc_handlePulmoHit.sqf index 271beac07..ad2da2638 100644 --- a/addons/breathing/functions/fnc_handlePulmoHit.sqf +++ b/addons/breathing/functions/fnc_handlePulmoHit.sqf @@ -55,12 +55,13 @@ if (GVAR(pneumothoraxDamageThreshold_TakenDamage)) then { }; if (floor (random 100) <= (GVAR(pneumothoraxChance) + _chanceIncrease)) then { - if(_unit getVariable [QGVAR(pneumothorax), 0] isEqualto 0 && !(_unit getVariable [QGVAR(tensionpneumothorax), false])) then { // Initial pneumothorax + if (_unit getVariable [QGVAR(pneumothorax), 0] isEqualto 0 && !(_unit getVariable [QGVAR(tensionpneumothorax), false])) then { // Initial pneumothorax // add breathing sound [_unit, 0.2] call ACEFUNC(medical_status,adjustPainLevel); [_unit] call FUNC(handleBreathing); _unit setVariable [QGVAR(pneumothorax), 1, true]; _unit setVariable [QGVAR(deepPenetratingInjury), true, true]; + _unit setVariable [QGVAR(activeChestSeal), false, true]; // Start deteriorating after delay [{ @@ -111,5 +112,6 @@ if (floor (random 100) <= (GVAR(pneumothoraxChance) + _chanceIncrease)) then { } else { // Damage threshold was passed but no pneumothorax given, try to just give injury instead if (floor (random 100) <= GVAR(deepPenetratingInjuryChance)) then { _unit setVariable [QGVAR(deepPenetratingInjury), true, true]; + _unit setVariable [QGVAR(activeChestSeal), false, true]; }; }; \ No newline at end of file diff --git a/addons/breathing/functions/fnc_treatmentAdvanced_Cyanosis.sqf b/addons/breathing/functions/fnc_treatmentAdvanced_Cyanosis.sqf deleted file mode 100644 index 83f1e4d77..000000000 --- a/addons/breathing/functions/fnc_treatmentAdvanced_Cyanosis.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" -/* - * Author: MiszczuZPolski - * Checks the cyanosis level of the patient. - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * None - * - * Example: - * [player, cursorTarget, "Body"] call kat_breathing_fnc_Cyanosis - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -[QGVAR(cyanosisLocal), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/breathing/functions/fnc_treatmentAdvanced_CyanosisLocal.sqf b/addons/breathing/functions/fnc_treatmentAdvanced_CyanosisLocal.sqf deleted file mode 100644 index 56b87a6a1..000000000 --- a/addons/breathing/functions/fnc_treatmentAdvanced_CyanosisLocal.sqf +++ /dev/null @@ -1,57 +0,0 @@ -#include "script_component.hpp" -/* - * Author: MiszczuZPolski - * Local callback for checking the cyanosis level of a patient. - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * None - * - * Example: - * call kat_breathing_fnc_CyanosisLocal - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -private _spO2 = 0; - -if (alive _patient) then { - _spO2 = _patient getVariable [QGVAR(airwayStatus), 100]; -}; - -private _messageCyanosis = LLSTRING(CyanosisStatus_N); -private _spO2Output = LSTRING(CyanosisStatus_N); - -[_patient, "quick_view", "STR_kat_breathing_CheckCyanosis_Log"] call EFUNC(circulation,removeLog); - -if (!([_patient,_bodyPart] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo))) then { - - if (_spO2 <= GVAR(slightValue)) then { - _spO2Output = LSTRING(CyanosisStatus_Slight); - _messageCyanosis = LLSTRING(CyanosisStatus_Slight); - }; - - if (_spO2 <= GVAR(mildValue)) then { - _spO2Output = LSTRING(CyanosisStatus_Mild); - _messageCyanosis = LLSTRING(CyanosisStatus_Mild); - }; - - if (_spO2 <= GVAR(severeValue)) then { - _spO2Output = LSTRING(CyanosisStatus_Severe); - _messageCyanosis = LLSTRING(CyanosisStatus_Severe); - }; -} else { - _spO2Output = LSTRING(CyanosisStatus_Severe); - _messageCyanosis = LLSTRING(CyanosisStatus_Severe); -}; - -private _message = format ["%1",_messageCyanosis]; -[_message, 2, _medic] call ACEFUNC(common,displayTextStructured); - -[_patient, "quick_view", LSTRING(CheckCyanosis_Log), [_spO2Output]] call ACEFUNC(medical_treatment,addToLog); \ No newline at end of file diff --git a/addons/breathing/functions/script_component.hpp b/addons/breathing/functions/script_component.hpp index 545986b95..2e58f611f 100644 --- a/addons/breathing/functions/script_component.hpp +++ b/addons/breathing/functions/script_component.hpp @@ -1,22 +1 @@ -#include "\x\kat\addons\breathing\script_component.hpp" - -#define VAR_BLOOD_PRESS "ACE_medical_bloodPressure" -#define VAR_BLOOD_VOL "ACE_medical_bloodVolume" -#define VAR_WOUND_BLEEDING "ACE_medical_woundBleeding" -#define VAR_CRDC_ARRST "ACE_medical_inCardiacArrest" -#define VAR_HEART_RATE "ACE_medical_heartRate" -#define VAR_PAIN "ACE_medical_pain" -#define VAR_PAIN_SUPP "ACE_medical_painSuppress" -#define VAR_PERIPH_RES "ACE_medical_peripheralResistance" -#define VAR_UNCON "ACE_isUnconscious" -#define VAR_OPEN_WOUNDS "ACE_medical_openWounds" -#define VAR_BANDAGED_WOUNDS "ACE_medical_bandagedWounds" -#define VAR_STITCHED_WOUNDS "ACE_medical_stitchedWounds" -// These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS "ACE_medical_medications" -// These variables track the current state of status values above -#define VAR_HEMORRHAGE "ACE_medical_hemorrhage" -#define VAR_IN_PAIN "ACE_medical_inPain" -#define VAR_TOURNIQUET "ACE_medical_tourniquets" -#define VAR_FRACTURES "ACE_medical_fractures" -#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"] \ No newline at end of file +#include "\x\kat\addons\breathing\script_component.hpp" \ No newline at end of file diff --git a/addons/breathing/script_component.hpp b/addons/breathing/script_component.hpp index 1af1f9b0f..5b34c60a8 100644 --- a/addons/breathing/script_component.hpp +++ b/addons/breathing/script_component.hpp @@ -14,5 +14,5 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_BREATHING #endif -#include "\x\kat\addons\main\script_macros.hpp" -#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" \ No newline at end of file +#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" +#include "\x\kat\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/breathing/stringtable.xml b/addons/breathing/stringtable.xml index 875c563fd..576cbc94e 100644 --- a/addons/breathing/stringtable.xml +++ b/addons/breathing/stringtable.xml @@ -941,66 +941,6 @@ Deshabilitado en predeterminado. Si se habilita, las unidades con hemotórax/neumotórax a tensión tambien tendran la herida neumotórax mostrada en el menú médico. O padrão é desabilitado. Se ativado, as unidades com pneumotórax hipertensivo ou hemopneumotórax também exibirão lesões por pneumotórax no menu médico. - - Check Cyanosis - Zyanose überprüfen - Sprawdź sinicę - Проверить цианоз - チアノーゼを確認する - 检查面色 - 치아노제 확인 - Contrôler la cyanose - Siyanozu kontrol et - Controlla la cianosi - Zkontrolovat cyanózu - Diagnosticar Cianosis - Verificar Cianose - - - Checking Cyanosis - Zyanose prüfen - Sprawdzanie sinicy - Проверка цианоза - チアノーゼを確認中 - 检查面色中... - 치아노제 확인 중 - Controle de la cyanose - Siyanoz kontrol ediliyor - Controllando la cianosi - Kontroluji cyanózu - Buscando signos de Cianosis - Verificando Cianose - - - Cyanosis Status: %1 - Status der Zyanose: %1 - Status sinicy: %1 - Статус цианоза: %1 - チアノーゼ症状: %1 - 面色 %1 - 치아노제 상태: %1 - Statut de la cysnose: %1 - Siyanoz durumu: %1 - Status della cianosi %1. - Status cyanózy: %1 - Estado de Cianosis: %1 - Estado de Cianose: %1 - - - No Cyanosis - Keine Zyanose - Brak sinicy - Нет цианоза - チアノーゼ症状なし - 红润 - 치아노제 없음 - Aucune cyanose - Siyanoz yok - Nessuna traccia di cianosi - Žádná cyanóza - No hay Cianosis - Sem Cianose - Slight Cyanosis Leichte Zyanose @@ -1046,59 +986,11 @@ Cianosis severa Cianose severa - - Enable cyanosis diagnose - Zyanose-Diagnose aktivieren - Włącz diagnozę sinicy - Включить диагностику цианоза - チアノーゼ診断を有効化 - 启用检查面色 - 치아노제 진단 사용 - Autoriser le diagnostique de la cyanose - Siyanoz tanısını etkinleştir - Abilita la diagnosi della cianosi - Povolit diagnózu cyanózy - Permitir el diagnóstico de cianosis - Ativar diagnóstico de cianose - - - Enables cyanosis diagnose - Aktiviert die Zyanose-Diagnose - Włącza diagnozę sinicy - Позволяет диагностировать цианоз - チアノーゼ診断を可能にします - 启用检查面色 - 치아노제(청색증)의 진단을 사용합니다 - Autorise le diagnostique de la cyanose - Siyanoz teşhisini etkinleştirir - Abilita la diagnosi della cianosi - Povolí diagnózu cyanózy - Permitir el diagnóstico de cianosis - Permite o diagnóstico de cianose - - - Show cyanosis in overview tab - オーバービューにチアノーゼの症状を表示 - 개요 탭에 치아노제 표시 - Mostrar la cianosis en la vista general - Mostra la cianosi nella tabella di overview - Mostrar cianose na guia de visão geral - Afficher la cyanose dans la vue d'ensemble - Pokaż sinicę w opisie - Zeigt Zyanose in der Verletzungsliste an - Zobrazit cyanózu v tabulce přehledu - - - Shows cyanosis of patient in overview tab and hides cyanosis diagnose action - Muestra la cianosis en la pestaña de descripción del menú medico y oculta la acción de diagnostico de cianosis - オーバービューに患者のチアノーゼの症状を表示し、チアノーゼ診断アクションを非表示にします - 개요 탭에 환자의 치아노제를 표시하고 치아노제 진단 행동을 숨깁니다. - Mostra la cianosi del paziente nella tabella overview e nascondi l'azione di diagnosi della cianosi - Mostra a cianose do paciente na guia de visão geral e oculta a ação de diagnóstico de cianose - Affiche la cyanose dans la vue d'ensemble du patient et cache l'action de contrôle de la cyanose - Pokazuje sinicę w opisie pacjenta oraz ukrywa akcję sprawdzenia sinicy - Zeigt Zyanose in der Verletzungsliste an (oben rechts), deaktiviert die Zyanose-Diagnose Aktion - Zobrazí cyanózu v tabulce přehledu pacienta a skryje možnost diagnostikování cyanózy jako akce + + Show cyanosis + + + Shows cyanosis of patient in overview tab Slight cyanosis SpO2 value diff --git a/addons/circulation/CfgVehicles.hpp b/addons/circulation/CfgVehicles.hpp index 7c291f909..a3f7f2e16 100644 --- a/addons/circulation/CfgVehicles.hpp +++ b/addons/circulation/CfgVehicles.hpp @@ -29,6 +29,11 @@ class CfgVehicles { MACRO_ADDITEM(kat_AED,1); }; + ACEGVAR(dragging,canDrag) = 1; + ACEGVAR(dragging,canCarry) = 1; + ACEGVAR(dragging,dragPosition)[] = {0,1.1,1}; + ACEGVAR(dragging,carryPosition)[] = {0,1.1,1}; + class ACE_Actions { class ACE_MainActions { selection = "interaction_point"; @@ -57,7 +62,7 @@ class CfgVehicles { showDisabled = 0; icon = QPATHTOF(ui\icon_aed_pads.paa); }; - class KAT_AED_RemovePads: AED_PlacePads { + class KAT_AED_RemovePads: KAT_AED_PlacePads { displayName = CSTRING(Defibrillator_Action_RemovePads); condition = QUOTE([ARR_2(_player, GVAR(medLvl_AED))] call ACEFUNC(medical_treatment,isMedic) && [ARR_3(_player, _target, 4)] call FUNC(AEDXPlaced_CheckCondition)); statement = QUOTE([ARR_4(_player, (_target getVariable [ARR_2(QQGVAR(Defibrillator_Patient), nil)]), 'body', 'DefibrillatorRemovePads')] call ace_medical_treatment_fnc_treatment); @@ -163,7 +168,7 @@ class CfgVehicles { showDisabled = 0; icon = QPATHTOF(ui\icon_aedx_volume_on.paa); }; - class KAT_AED_X_DisableAudio: AED_X_EnableAudio { + class KAT_AED_X_DisableAudio: KAT_AED_X_EnableAudio { displayName = CSTRING(AEDX_Action_DisableAudio); condition = QUOTE([ARR_2(_player, GVAR(medLvl_AED_X))] call ACEFUNC(medical_treatment,isMedic) && _target getVariable [ARR_2(QQGVAR(AED_X_VitalsMonitor_Volume), false)]); statement = QUOTE(_target setVariable [ARR_3(QQGVAR(AED_X_VitalsMonitor_Volume), false, true)]; [ARR_2(_target, false)] call FUNC(AEDXPlaced_VitalsMonitor_SetVolume)); @@ -251,7 +256,7 @@ class CfgVehicles { }; class KAT_placeAED { displayName = CSTRING(place_AED); - condition = QUOTE('kat_AED' in (items _player)); + condition = QUOTE('kat_AED' in (items _player) && !((_player getVariable [ARR_2(QQGVAR(MedicDefibrillator_Patient), objNull)]) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])); exceptions[] = { "notOnMap", @@ -265,9 +270,9 @@ class CfgVehicles { icon = ""; showDisabled = 0; }; - class KAT_placeAEDX : placeAED { + class KAT_placeAEDX: KAT_placeAED { displayName = CSTRING(place_AEDX); - condition = QUOTE('kat_X_AED' in (items _player)); + condition = QUOTE('kat_X_AED' in (items _player) && !((_player getVariable [ARR_2(QQGVAR(MedicDefibrillator_Patient), objNull)]) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])); statement = QUOTE([ARR_2(_player,'kat_X_AED')] call FUNC(placeAED)); icon = QPATHTOF(ui\icon_aedx.paa); }; @@ -298,7 +303,7 @@ class CfgVehicles { showDisabled = 0; icon = QPATHTOF(ui\icon_aedx_volume_off.paa); }; - class KAT_AED_X_addSound : AED_X_removeSound { + class KAT_AED_X_addSound : KAT_AED_X_removeSound { displayName = CSTRING(AEDX_Action_EnableAudio); condition = QUOTE(!(_player getVariable [ARR_2(QQGVAR(AED_X_VitalsMonitor_Volume), false]))); statement = QUOTE(_player setVariable [ARR_3(QQGVAR(AED_X_VitalsMonitor_Volume), true, true)]); diff --git a/addons/circulation/CfgWeapons.hpp b/addons/circulation/CfgWeapons.hpp index 6f4791f80..7b371ed29 100644 --- a/addons/circulation/CfgWeapons.hpp +++ b/addons/circulation/CfgWeapons.hpp @@ -5,76 +5,79 @@ class CfgWeapons { class kat_bloodIV_O: ACE_bloodIV { displayName = CSTRING(BloodIV_O); + ACE_isMedicalItem = 1; }; - class kat_bloodIV_O_N: ACE_bloodIV { + class kat_bloodIV_O_N: kat_bloodIV_O { displayName = CSTRING(BloodIV_O_N); }; - class kat_bloodIV_A: ACE_bloodIV { + class kat_bloodIV_A: kat_bloodIV_O { displayName = CSTRING(BloodIV_A); }; - class kat_bloodIV_A_N: ACE_bloodIV { + class kat_bloodIV_A_N: kat_bloodIV_O { displayName = CSTRING(BloodIV_A_N); }; - class kat_bloodIV_B: ACE_bloodIV { + class kat_bloodIV_B: kat_bloodIV_O { displayName = CSTRING(BloodIV_B); }; - class kat_bloodIV_B_N: ACE_bloodIV { + class kat_bloodIV_B_N: kat_bloodIV_O { displayName = CSTRING(BloodIV_B_N); }; - class kat_bloodIV_AB: ACE_bloodIV { + class kat_bloodIV_AB: kat_bloodIV_O { displayName = CSTRING(BloodIV_AB); }; - class kat_bloodIV_AB_N: ACE_bloodIV { + class kat_bloodIV_AB_N: kat_bloodIV_O { displayName = CSTRING(BloodIV_AB_N); }; class ACE_bloodIV_500; class kat_bloodIV_O_500: ACE_bloodIV_500 { displayName = CSTRING(BloodIV_O_500); + ACE_isMedicalItem = 1; }; - class kat_bloodIV_O_N_500: ACE_bloodIV_500 { + class kat_bloodIV_O_N_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_O_500_N); }; - class kat_bloodIV_A_500: ACE_bloodIV_500 { + class kat_bloodIV_A_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_A_500); }; - class kat_bloodIV_A_N_500: ACE_bloodIV_500 { + class kat_bloodIV_A_N_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_A_500_N); }; - class kat_bloodIV_B_500: ACE_bloodIV_500 { + class kat_bloodIV_B_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_B_500); }; - class kat_bloodIV_B_N_500: ACE_bloodIV_500 { + class kat_bloodIV_B_N_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_B_500_N); }; - class kat_bloodIV_AB_500: ACE_bloodIV_500 { + class kat_bloodIV_AB_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_AB_500); }; - class kat_bloodIV_AB_N_500: ACE_bloodIV_500 { + class kat_bloodIV_AB_N_500: kat_bloodIV_O_500 { displayName = CSTRING(BloodIV_AB_500_N); }; class ACE_bloodIV_250; class kat_bloodIV_O_250: ACE_bloodIV_250 { displayName = CSTRING(BloodIV_O_250); + ACE_isMedicalItem = 1; }; - class kat_bloodIV_O_N_250: ACE_bloodIV_250 { + class kat_bloodIV_O_N_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_O_250_N); }; - class kat_bloodIV_A_250: ACE_bloodIV_250 { + class kat_bloodIV_A_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_A_250); }; - class kat_bloodIV_A_N_250: ACE_bloodIV_250 { + class kat_bloodIV_A_N_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_A_250_N); }; - class kat_bloodIV_B_250: ACE_bloodIV_250 { + class kat_bloodIV_B_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_B_250); }; - class kat_bloodIV_B_N_250: ACE_bloodIV_250 { + class kat_bloodIV_B_N_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_B_250_N); }; - class kat_bloodIV_AB_250: ACE_bloodIV_250 { + class kat_bloodIV_AB_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_AB_250); }; - class kat_bloodIV_AB_N_250: ACE_bloodIV_250 { + class kat_bloodIV_AB_N_250: kat_bloodIV_O_250 { displayName = CSTRING(BloodIV_AB_250_N); }; class KAT_Empty_bloodIV_500: ACE_bloodIV @@ -84,6 +87,7 @@ class CfgWeapons { picture = QPATHTOF(ui\bloodIV_empty_ca.paa); author = "Battlekeeper"; hiddenSelectionsTextures[] = {QPATHTOF(ui\IVBag_blood_500ml_empty_ca.paa)}; + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 2; }; @@ -95,6 +99,7 @@ class CfgWeapons { picture = QPATHTOF(ui\bloodIV_empty_ca.paa); author = "Battlekeeper"; hiddenSelectionsTextures[] = {QPATHTOF(ui\IVBag_blood_500ml_empty_ca.paa)}; + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -106,6 +111,7 @@ class CfgWeapons { picture = QPATHTOF(ui\defib.paa); model = "\A3\Structures_F_EPA\Items\Medical\Defibrillator_F.p3d"; descriptionShort = CSTRING(AED_DESCRIPTION); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 30; }; @@ -116,6 +122,7 @@ class CfgWeapons { picture = QPATHTOF(ui\x-series.paa); model = QPATHTOF(models\aedx\aedx.p3d); descriptionShort = CSTRING(X_Desc); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 40; }; diff --git a/addons/circulation/functions/fnc_AEDX_ConnectVitalsMonitor.sqf b/addons/circulation/functions/fnc_AEDX_ConnectVitalsMonitor.sqf index daa5c8fd4..8ba666a05 100644 --- a/addons/circulation/functions/fnc_AEDX_ConnectVitalsMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_ConnectVitalsMonitor.sqf @@ -119,20 +119,16 @@ switch (_source) do { _patient setVariable [QGVAR(AED_X_VitalsMonitor_Connected), true, true]; _patient setVariable [QGVAR(AED_X_VitalsMonitor_Provider), [_provider, _source, (ALL_BODY_PARTS find toLower _bodyPart)], true]; -if !((_patient getVariable ["kat_AEDXPatient_PFH", -1]) isEqualTo -1) then { - [(_patient getVariable "kat_AEDXPatient_PFH") select 0] call CBA_fnc_removePerFrameHandler; - [(_patient getVariable "kat_AEDXPatient_PFH") select 1] call CBA_fnc_removePerFrameHandler; - [(_patient getVariable "kat_AEDXPatient_PFH") select 2] call CBA_fnc_removePerFrameHandler; - [{ - params ["_medic", "_patient", "_provider"]; - - [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); - }, [_medic, _patient, _provider], 0.5] call CBA_fnc_waitAndExecute; -} else { - [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); +if ((_patient getVariable ["kat_AEDXPatient_PFH", -1]) isEqualTo -1) then { _patient setVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), (_provider getVariable [QGVAR(AED_X_VitalsMonitor_Volume), false]), true]; }; +[{ + params ["_medic", "_patient", "_provider"]; + + [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); +}, [_medic, _patient, _provider], 0.5] call CBA_fnc_waitAndExecute; + if !(_noLog) then { [_patient, "activity", LSTRING(Activity_ConnectVitalsMonitor), [[_medic, false, true] call ACEFUNC(common,getName)]] call ACEFUNC(medical_treatment,addToLog); }; diff --git a/addons/circulation/functions/fnc_AEDX_DisconnectVitalsMonitor.sqf b/addons/circulation/functions/fnc_AEDX_DisconnectVitalsMonitor.sqf index 8db778621..24f82bc47 100644 --- a/addons/circulation/functions/fnc_AEDX_DisconnectVitalsMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_DisconnectVitalsMonitor.sqf @@ -29,6 +29,7 @@ if (_patient isEqualTo objNull) then { switch (_provider select 1) do { case 1: { // Placed + (_provider select 0) setVariable [QGVAR(AED_X_VitalsMonitor_Volume), (_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]), true]; (_provider select 0) setVariable [QGVAR(AED_X_VitalsMonitor_Patient), nil, true]; }; case 2: { // Vehicle diff --git a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf index a0a9e7985..3f825b5a4 100644 --- a/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf +++ b/addons/circulation/functions/fnc_AEDX_VitalsMonitor.sqf @@ -26,101 +26,103 @@ if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) isEqualTo 1) then { GVAR(BPInterval) = false; }; -// medical menu log -// logs the heart rate and the blood pressure -private _vitalsMonitorPFH = [{ - params ["_args", "_idPFH"]; - _args params ["_patient"]; - if ((!(_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) && !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false])) || _patient isEqualTo objNull) exitWith { - [_idPFH] call CBA_fnc_removePerFrameHandler; - _patient setVariable ["kat_AEDXPatient_PFH", nil, true]; +if (_patient getVariable ["kat_AEDXPatient_PFH", -1] isEqualTo -1) then { + // medical menu log + // logs the heart rate and the blood pressure + private _vitalsMonitorPFH = [{ + params ["_args", "_idPFH"]; + _args params ["_patient"]; + if ((!(_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) && !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false])) || _patient isEqualTo objNull) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + _patient setVariable ["kat_AEDXPatient_PFH", nil, true]; + [_patient, "quick_view", LSTRING(VitalsMonitor_StatusLog)] call FUNC(removeLog); + [_patient, "quick_view", LSTRING(VitalsMonitor_VMInactive_StatusLog)] call FUNC(removeLog); + [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog)] call FUNC(removeLog); + }; + + //No Values for your Monitor atm + if (_patient getVariable [QGVAR(DefibrillatorInUse), false]) exitWith {}; + + // Clear previous log entry before adding new one [_patient, "quick_view", LSTRING(VitalsMonitor_StatusLog)] call FUNC(removeLog); [_patient, "quick_view", LSTRING(VitalsMonitor_VMInactive_StatusLog)] call FUNC(removeLog); [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog)] call FUNC(removeLog); - }; - - //No Values for your Monitor atm - if (_patient getVariable [QGVAR(DefibrillatorInUse), false]) exitWith {}; - // Clear previous log entry before adding new one - [_patient, "quick_view", LSTRING(VitalsMonitor_StatusLog)] call FUNC(removeLog); - [_patient, "quick_view", LSTRING(VitalsMonitor_VMInactive_StatusLog)] call FUNC(removeLog); - [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog)] call FUNC(removeLog); - - private _partIndex = ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [objNull, -1, 3]]) select 2); - private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient, _partIndex); + private _partIndex = ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [objNull, -1, 3]]) select 2); + private _tourniquetApplied = HAS_TOURNIQUET_APPLIED_ON(_patient, _partIndex); - private _hr = 0; - private _pr = 0; - private _bp = [0,0]; - private _spO2 = 0; - - if !(_patient getVariable [QGVAR(heartRestart), false]) then { - _pr = _patient getVariable [QACEGVAR(medical,heartRate), 0]; - if (_patient getVariable [QGVAR(cardiacArrestType), 0] > 0 && (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull)) then { - _hr = _patient call FUNC(getCardiacArrestHeartRate); + private _hr = 0; + private _pr = 0; + private _bp = [0,0]; + private _spO2 = 0; - if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) > 0) then { - _bp = _patient getVariable [QGVAR(StoredBloodPressure), [0,0]]; - }; - } else { - _hr = _pr; + if !(_patient getVariable [QGVAR(heartRestart), false]) then { + _pr = _patient getVariable [QACEGVAR(medical,heartRate), 0]; + if (_patient getVariable [QGVAR(cardiacArrestType), 0] > 0 && (_patient getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull)) then { + _hr = _patient call FUNC(getCardiacArrestHeartRate); - if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) isEqualTo 0) then { - _bp = _patient getVariable [QACEGVAR(medical,bloodPressure), [0,0]]; + if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) > 0) then { + _bp = _patient getVariable [QGVAR(StoredBloodPressure), [0,0]]; + }; } else { - _bp = _patient getVariable [QGVAR(StoredBloodPressure), [0,0]]; + _hr = _pr; + + if (GVAR(AED_X_VitalsMonitor_BloodPressureInterval) isEqualTo 0) then { + _bp = _patient getVariable [QACEGVAR(medical,bloodPressure), [0,0]]; + } else { + _bp = _patient getVariable [QGVAR(StoredBloodPressure), [0,0]]; + }; }; }; - }; - if (_tourniquetApplied) then { - _bp = [0,0]; - _pr = 0; - } else { - _spO2 = _patient getVariable [QEGVAR(breathing,airwayStatus), 100]; - }; - - // List vitals depending on if AED pads and vitals monitoring (pressure cuff + pulse oximeter) is connected - if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && _patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { - // heart rate, systolic / diastolic, spO2 - [_patient, "quick_view", LSTRING(VitalsMonitor_StatusLog), [round(_hr), round(_bp select 1), round(_bp select 0), round(_spO2)]] call ACEFUNC(medical_treatment,addToLog); - } else { - if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { - [_patient, "quick_view", LSTRING(VitalsMonitor_VMInactive_StatusLog), [round(_hr)]] call ACEFUNC(medical_treatment,addToLog); + if (_tourniquetApplied) then { + _bp = [0,0]; + _pr = 0; } else { - [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog), [round(_pr), round(_bp select 1), round(_bp select 0), round(_spO2)]] call ACEFUNC(medical_treatment,addToLog); + _spO2 = _patient getVariable [QEGVAR(breathing,airwayStatus), 100]; }; - }; - if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && GVAR(BPInterval)) then { // Store new BP - if !(_tourniquetApplied) then { - _patient setVariable [QGVAR(StoredBloodPressure), (_patient getVariable [QACEGVAR(medical,bloodPressure), [0,0]]), true]; + // List vitals depending on if AED pads and vitals monitoring (pressure cuff + pulse oximeter) is connected + if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && _patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { + // heart rate, systolic / diastolic, spO2 + [_patient, "quick_view", LSTRING(VitalsMonitor_StatusLog), [round(_hr), round(_bp select 1), round(_bp select 0), round(_spO2)]] call ACEFUNC(medical_treatment,addToLog); } else { - _patient setVariable [QGVAR(StoredBloodPressure), [0,0], true]; + if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { + [_patient, "quick_view", LSTRING(VitalsMonitor_VMInactive_StatusLog), [round(_hr)]] call ACEFUNC(medical_treatment,addToLog); + } else { + [_patient, "quick_view", LSTRING(VitalsMonitor_VMActive_StatusLog), [round(_pr), round(_bp select 1), round(_bp select 0), round(_spO2)]] call ACEFUNC(medical_treatment,addToLog); + }; }; - [{ - GVAR(BPInterval) = true; - }, [], GVAR(AED_X_VitalsMonitor_BloodPressureInterval_Time)] call CBA_fnc_waitAndExecute; - GVAR(BPInterval) = false; - }; -}, 1, [_patient]] call CBA_fnc_addPerFrameHandler; - -private _PFHArray = [_vitalsMonitorPFH,-1,-1]; + if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && GVAR(BPInterval)) then { // Store new BP + if !(_tourniquetApplied) then { + _patient setVariable [QGVAR(StoredBloodPressure), (_patient getVariable [QACEGVAR(medical,bloodPressure), [0,0]]), true]; + } else { + _patient setVariable [QGVAR(StoredBloodPressure), [0,0], true]; + }; + [{ + GVAR(BPInterval) = true; + }, [], GVAR(AED_X_VitalsMonitor_BloodPressureInterval_Time)] call CBA_fnc_waitAndExecute; -_patient setVariable ["kat_AEDXPatient_PFH", _PFHArray, true]; + GVAR(BPInterval) = false; + }; + }, 1, [_patient]] call CBA_fnc_addPerFrameHandler; -if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { + _patient setVariable ["kat_AEDXPatient_PFH", _vitalsMonitorPFH, true]; +}; +if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false] && {((_patient getVariable ["kat_AEDXPatient_HR_PFH", -1]) isEqualTo -1)}) then { // attach heart rate beep PFH GVAR(AEDBeepPlaying) = false; if (GVAR(AED_X_VitalsMonitor_SoundsSelect) == 0) then { private _vitalsMonitorBeepPFH = [{ params ["_args", "_idPFH"]; - _args params ["_patient", "_soundSource"]; + _args params ["_patient"]; + + private _soundSource = (_patient getVariable [QGVAR(Defibrillator_Provider), [objNull, -1, -1]]) select 0; if (!(_patient getVariable [QGVAR(DefibrillatorPads_Connected), false])) exitWith { + _patient setVariable ["kat_AEDXPatient_HR_PFH", nil, true]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; @@ -149,23 +151,24 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { GVAR(AEDBeepPlaying) = false; }, [_patient], _delay] call CBA_fnc_waitAndExecute; - }, 0, [_patient, _soundSource]] call CBA_fnc_addPerFrameHandler; + }, 0, [_patient]] call CBA_fnc_addPerFrameHandler; - private _PFHArray = _patient getVariable ["kat_AEDXPatient_PFH", [-1,-1,-1]]; - _PFHArray set [1,_vitalsMonitorBeepPFH]; - _patient setVariable ["kat_AEDXPatient_PFH", _PFHArray, true]; + _patient setVariable ["kat_AEDXPatient_HR_PFH", _vitalsMonitorBeepPFH, true]; } else { GVAR(playedAudio) = false; GVAR(analyzeDelay) = false; private _vitalsMonitorBeepPFH = [{ params ["_args", "_idPFH"]; - _args params ["_patient", "_soundSource"]; + _args params ["_patient"]; + + private _soundSource = (_patient getVariable [QGVAR(Defibrillator_Provider), [objNull, -1, -1]]) select 0; if (!(_patient getVariable [QGVAR(DefibrillatorPads_Connected), false])) exitWith { + _patient setVariable ["kat_AEDXPatient_HR_PFH", nil, true]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; - if (!(_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]) || _patient getVariable [QGVAR(DefibrillatorInUse), false]) exitWith { + if (!(_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]) || _patient getVariable [QGVAR(DefibrillatorInUse), false] || _patient getVariable [QGVAR(heartRestart), false]) exitWith { GVAR(analyzeDelay) = false; GVAR(playedAudio) = false; }; @@ -185,6 +188,7 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { if (!(_patient getVariable [QGVAR(cardiacArrestType), 0] in [0,2]) && !(GVAR(analyzeDelay))) then { [{ params ["_patient"]; + GVAR(analyzeDelay) = true; }, [_patient], 2] call CBA_fnc_waitAndExecute; }; @@ -195,6 +199,7 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { playsound3D [QPATHTOF_SOUND(sounds\heartrate_AED.wav), _soundSource, false, getPosASL _soundSource, 5, 1, 15]; [{ params ["_patient"]; + GVAR(AEDBeepPlaying) = false; }, [_patient], _delay] call CBA_fnc_waitAndExecute; GVAR(playedAudio) = false; @@ -225,6 +230,7 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { playsound3D [QPATHTOF_SOUND(sounds\heartrate_AED.wav), _soundSource, false, getPosASL _soundSource, 5, 1, 15]; [{ params ["_patient"]; + GVAR(AEDBeepPlaying) = false; }, [_patient], _delay] call CBA_fnc_waitAndExecute; GVAR(playedAudio) = false; @@ -240,24 +246,26 @@ if (_patient getVariable [QGVAR(DefibrillatorPads_Connected), false]) then { }; [{ params ["_patient"]; + GVAR(AEDBeepPlaying) = false; }, [_patient], _delayAEDBeepPlaying] call CBA_fnc_waitAndExecute; }; }; - }, 0, [_patient, _soundSource]] call CBA_fnc_addPerFrameHandler; + }, 0, [_patient]] call CBA_fnc_addPerFrameHandler; - private _PFHArray = _patient getVariable ["kat_AEDXPatient_PFH", [-1,-1,-1]]; - _PFHArray set [1,_vitalsMonitorBeepPFH]; - _patient setVariable ["kat_AEDXPatient_PFH", _PFHArray, true]; + _patient setVariable ["kat_AEDXPatient_HR_PFH", _vitalsMonitorBeepPFH, true]; }; }; -if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) then { +if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false] && {(_patient getVariable ["kat_AEDXPatient_PulseOx_PFH", -1]) isEqualTo -1}) then { private _pulseOximeterPFH = [{ params ["_args", "_idPFH"]; - _args params ["_patient", "_soundSource"]; + _args params ["_patient"]; + + private _soundSource = (_patient getVariable [QGVAR(Defibrillator_Provider), [objNull, -1, -1]]) select 0; if !(_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) exitWith { + _patient setVariable ["kat_AEDXPatient_PulseOx_PFH", nil, true]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; @@ -272,9 +280,7 @@ if (_patient getVariable [QGVAR(AED_X_VitalsMonitor_Connected), false]) then { playSound3D [QPATHTOF_SOUND(sounds\spo2warning.wav), _soundSource, false, getPosASL _soundSource, 5, 1, 15]; }; }; - }, 2, [_patient, _soundSource]] call CBA_fnc_addPerFrameHandler; + }, 2, [_patient]] call CBA_fnc_addPerFrameHandler; - private _PFHArray = _patient getVariable ["kat_AEDXPatient_PFH", [-1,-1,-1]]; - _PFHArray set [2, _pulseOximeterPFH]; - _patient setVariable ["kat_AEDXPatient_PFH", _PFHArray, true]; + _patient setVariable ["kat_AEDXPatient_PulseOx_PFH", _pulseOximeterPFH, true]; }; \ No newline at end of file diff --git a/addons/circulation/functions/fnc_Defibrillator_AttachPads.sqf b/addons/circulation/functions/fnc_Defibrillator_AttachPads.sqf index b96133df2..f21744d71 100644 --- a/addons/circulation/functions/fnc_Defibrillator_AttachPads.sqf +++ b/addons/circulation/functions/fnc_Defibrillator_AttachPads.sqf @@ -114,23 +114,18 @@ switch (_source) do { _patient setVariable [QGVAR(DefibrillatorPads_Connected), true, true]; _patient setVariable [QGVAR(Defibrillator_Provider), [_provider, _source, _defibClassname], true]; -_patient setVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), (_provider getVariable [QGVAR(AED_X_VitalsMonitor_Volume), false]), true]; _patient setVariable [QGVAR(RhythmAnalyzed), false, true]; if (_defibClassname isEqualTo "kat_X_AED") then { - if !((_patient getVariable ["kat_AEDXPatient_PFH", -1]) isEqualTo -1) then { - [(_patient getVariable "kat_AEDXPatient_PFH") select 0] call CBA_fnc_removePerFrameHandler; - [(_patient getVariable "kat_AEDXPatient_PFH") select 1] call CBA_fnc_removePerFrameHandler; - [(_patient getVariable "kat_AEDXPatient_PFH") select 2] call CBA_fnc_removePerFrameHandler; - [{ - params ["_medic", "_patient", "_provider"]; - - [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); - }, [_medic, _patient, _provider], 0.5] call CBA_fnc_waitAndExecute; - } else { - [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); + if (_patient getVariable ["kat_AEDXPatient_PFH", -1] isEqualTo -1) then { _patient setVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), (_provider getVariable [QGVAR(AED_X_VitalsMonitor_Volume), false]), true]; }; + + [{ + params ["_medic", "_patient", "_provider"]; + + [_medic, _patient, _provider] call FUNC(AEDX_VitalsMonitor); + }, [_medic, _patient, _provider], 0.5] call CBA_fnc_waitAndExecute; }; if !(_noLog) then { diff --git a/addons/circulation/functions/fnc_Defibrillator_RemovePads.sqf b/addons/circulation/functions/fnc_Defibrillator_RemovePads.sqf index 5096b7565..0a9dd9f3c 100644 --- a/addons/circulation/functions/fnc_Defibrillator_RemovePads.sqf +++ b/addons/circulation/functions/fnc_Defibrillator_RemovePads.sqf @@ -29,6 +29,7 @@ if (_patient isEqualTo objNull) then { switch (_provider select 1) do { case 1: { // Placed + (_provider select 0) setVariable [QGVAR(AED_X_VitalsMonitor_Volume), (_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]), true]; (_provider select 0) setVariable [QGVAR(Defibrillator_Patient), nil, true]; }; case 2: { // Vehicle diff --git a/addons/circulation/functions/fnc_getCardiacArrestHeartRate.sqf b/addons/circulation/functions/fnc_getCardiacArrestHeartRate.sqf index ee52bdc26..7b78d199b 100644 --- a/addons/circulation/functions/fnc_getCardiacArrestHeartRate.sqf +++ b/addons/circulation/functions/fnc_getCardiacArrestHeartRate.sqf @@ -21,7 +21,7 @@ params ["_unit"]; 0 normal 1 asystole, no pulse, no shock 2 pulseless electrical activity, AEDX fake pulse, no shock -3 ventricular fibrillation, no pulse, shock +3 ventricular fibrillation, fast pulse, shock 4 ventricular tachycardia, fast pulse, shock */ diff --git a/addons/circulation/functions/fnc_handleCardiacArrest.sqf b/addons/circulation/functions/fnc_handleCardiacArrest.sqf index 9c129adc1..41a9e5c52 100644 --- a/addons/circulation/functions/fnc_handleCardiacArrest.sqf +++ b/addons/circulation/functions/fnc_handleCardiacArrest.sqf @@ -23,7 +23,7 @@ params ["_unit", "_active", ["_initial",true]]; 0 normal 1 asystole, no pulse, no shock 2 pulseless electrical activity, AEDX fake pulse, no shock -3 ventricular fibrillation, no pulse, shock +3 ventricular fibrillation, fast pulse, shock 4 ventricular tachycardia, fast pulse, shock */ @@ -65,9 +65,13 @@ if (GVAR(AdvRhythm_canDeteriorate)) then { switch (_cardiacArrestType) do { case 4: { [{ + params ["_unit"]; + _unit getVariable [QACEGVAR(medical,bloodVolume), 6.0] < GVAR(AdvRhythm_asystoleBloodlossThreshold) && _unit getVariable [QGVAR(cardiacArrestType), 0] > 2 }, { + params ["_unit"]; + private _targetType = 1; if (floor (random 100) < GVAR(AdvRhythm_PEAChance)) then { _targetType = 2; @@ -78,6 +82,8 @@ if (GVAR(AdvRhythm_canDeteriorate)) then { }, [_unit], _timeToDeteriorate, { + params ["_unit"]; + if (_unit getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull) then { // Don't deteriorate during CPR // chance to deteriorate straight into asystole (PEA) if (GVAR(AdvRhythm_Hardcore_Enable) && {floor (random 100) < GVAR(AdvRhythm_hardcoreDeteriorationChance) && {_unit getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 4}}) then { @@ -96,9 +102,13 @@ if (GVAR(AdvRhythm_canDeteriorate)) then { }; case 3: { [{ + params ["_unit"]; + _unit getVariable [QACEGVAR(medical,bloodVolume), 6.0] < GVAR(AdvRhythm_asystoleBloodlossThreshold) && _unit getVariable [QGVAR(cardiacArrestType), 0] > 2 }, { // If past asystole bloodloss threshold + params ["_unit"]; + private _targetType = 1; if (floor (random 100) < GVAR(AdvRhythm_PEAChance)) then { _targetType = 2; @@ -109,6 +119,8 @@ if (GVAR(AdvRhythm_canDeteriorate)) then { }, [_unit], _timeToDeteriorate, { + params ["_unit"]; + if (_unit getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull) then { // Don't deteriorate during CPR if (_unit getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 3) then {// if VF skip PEA _unit setVariable [QGVAR(cardiacArrestType), 1, true]; @@ -121,6 +133,8 @@ if (GVAR(AdvRhythm_canDeteriorate)) then { }; case 2: { [{ + params ["_unit"]; + if (_unit getVariable [QACEGVAR(medical,CPR_provider), objNull] isEqualTo objNull) then { // Don't deteriorate during CPR if (_unit getVariable [QGVAR(cardiacArrestType), 0] isEqualTo 2) then { _unit setVariable [QGVAR(cardiacArrestType), 1, true]; diff --git a/addons/circulation/functions/fnc_placeAED.sqf b/addons/circulation/functions/fnc_placeAED.sqf index dab5b3d6d..cbb48e005 100644 --- a/addons/circulation/functions/fnc_placeAED.sqf +++ b/addons/circulation/functions/fnc_placeAED.sqf @@ -20,34 +20,19 @@ params ["_unit", "_AEDClassName"]; _unit removeItem _AEDClassName; -private _AED = ([_AEDClassName,"Item"] joinString "") createVehicle (position _unit); - -[_AED, true] call ACEFUNC(dragging,setDraggable); -[_AED, true] call ACEFUNC(dragging,setCarryable); - -[_unit, _AED] call ACEFUNC(dragging,carryObject); +private _AED = ([_AEDClassName,"Item"] joinString "") createVehicle (getPosASL _unit); + +// startCarry +if (stance _unit != "STAND") then { + _AED attachTo [_unit, [0,1.1,1]]; + [_unit, _AED] call ACEFUNC(dragging,dropObject_carry); +} else { + _unit setVariable [QACEGVAR(dragging,isCarrying), true, true]; + [ACEFUNC(dragging,startCarryPFH), 0.2, [_unit, _AED, (CBA_missionTime + 1)]] call CBA_fnc_addPerFrameHandler; +}; private _pickUpText = LLSTRING(PickUpAED); -if (_AEDClassName == "kat_X_AED") then { - _AED setVariable [QGVAR(AED_X_VitalsMonitor_Volume), _unit getVariable [QGVAR(AED_X_VitalsMonitor_Volume), false], true]; - _pickUpText = LLSTRING(PickUpAEDX); - - private _patient = _unit getVariable [QGVAR(AED_X_MedicVitalsMonitor_Patient), objNull]; - - if !(_patient isEqualTo objNull) then { - private _monitorBodyPart = ALL_BODY_PARTS select ((_patient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [objNull, -1, 3]]) select 2); - - [_unit, _patient, true] call FUNC(AEDX_DisconnectVitalsMonitor); - - [{ - params ["_unit", "_patient", "_AEDClassName", "_AED", "_monitorBodyPart"]; - - [_unit, _patient, _monitorBodyPart, 1, [_AED], true] call FUNC(AEDX_ConnectVitalsMonitor); - }, [_unit, _patient, _AEDClassName, _AED, _monitorBodyPart], 0.1] call CBA_fnc_waitAndExecute; - }; -}; - private _patient = _unit getVariable [QGVAR(MedicDefibrillator_Patient), objNull]; if !(_patient isEqualTo objNull) then { @@ -59,6 +44,32 @@ if !(_patient isEqualTo objNull) then { [_unit, _patient, 1, _AEDClassName, [_AED], true] call FUNC(Defibrillator_AttachPads); }, [_unit, _patient, _AEDClassName, _AED], 0.1] call CBA_fnc_waitAndExecute; }; + +if (_AEDClassName == "kat_X_AED") then { + _pickUpText = LLSTRING(PickUpAEDX); + + private _monitorPatient = _unit getVariable [QGVAR(AED_X_MedicVitalsMonitor_Patient), objNull]; + + if !(_monitorPatient isEqualTo objNull) then { + private _monitorBodyPart = ALL_BODY_PARTS select ((_monitorPatient getVariable [QGVAR(AED_X_VitalsMonitor_Provider), [objNull, -1, 3]]) select 2); + + [_unit, _monitorPatient, true] call FUNC(AEDX_DisconnectVitalsMonitor); + _AED setVariable [QGVAR(AED_X_VitalsMonitor_Volume), (_monitorPatient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]), true]; + + [{ + params ["_unit", "_monitorPatient", "_AEDClassName", "_AED", "_monitorBodyPart"]; + + [_unit, _monitorPatient, _monitorBodyPart, 1, [_AED], true] call FUNC(AEDX_ConnectVitalsMonitor); + }, [_unit, _monitorPatient, _AEDClassName, _AED, _monitorBodyPart], 0.15] call CBA_fnc_waitAndExecute; + } else { + if !(_patient isEqualTo objNull) then { + _AED setVariable [QGVAR(AED_X_VitalsMonitor_Volume), (_patient getVariable [QGVAR(AED_X_VitalsMonitor_VolumePatient), false]), true]; + } else { + _AED setVariable [QGVAR(AED_X_VitalsMonitor_Volume), (_unit getVariable [QGVAR(AED_X_VitalsMonitor_Volume), false]), true]; + }; + }; +}; + private _action = ["AED_pickupAction", _pickUpText, "", @@ -96,7 +107,7 @@ _pickUpText, params ["_medic", "_patientMonitor", "_monitorBodyPart"]; [_medic, _patientMonitor, _monitorBodyPart, 0, [], true] call FUNC(AEDX_ConnectVitalsMonitor); - }, [_medic, _patientMonitor, _monitorBodyPart], 0.1] call CBA_fnc_waitAndExecute; + }, [_medic, _patientMonitor, _monitorBodyPart], 0.15] call CBA_fnc_waitAndExecute; }; }; @@ -111,7 +122,8 @@ _pickUpText, }, { params ["_AED", "_unit"]; - [_unit, GVAR(medLvl_AED_Station_Interact)] call ACEFUNC(medical_treatment,isMedic) + + [_unit, GVAR(medLvl_AED_Station_Interact)] call ACEFUNC(medical_treatment,isMedic) && !((_AED getVariable [QGVAR(Defibrillator_Patient), objNull]) getVariable [QGVAR(DefibrillatorInUse), false]); }, {}, [_AEDClassName] diff --git a/addons/gui/XEH_preInit.sqf b/addons/gui/XEH_preInit.sqf index 2fe57bdc1..51ad2773b 100644 --- a/addons/gui/XEH_preInit.sqf +++ b/addons/gui/XEH_preInit.sqf @@ -12,8 +12,109 @@ PREP_RECOMPILE_END; [ QGVAR(ColoredLogs), "CHECKBOX", - [LLSTRING(SETTING_ColoredLogs),LLSTRING(SETTING_ColoredLogs_DESC)], + [LLSTRING(SETTING_ColoredLogs), LLSTRING(SETTING_ColoredLogs_DESC)], [CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)], [true], true -] call CBA_Settings_fnc_init; \ No newline at end of file +] call CBA_Settings_fnc_init; + +// Show inactive patient statuses +[ + QGVAR(showInactiveStatuses), + "CHECKBOX", + LLSTRING(SETTING_showInactiveStatuses), + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)], + [false], + true +] call CBA_Settings_fnc_init; + +// Display bleed rate (slow/moderate/severe/massive) +[ + QGVAR(showBleedRate), + "CHECKBOX", + [LLSTRING(SETTING_showBleedRate), LLSTRING(SETTING_showBleedRate_DESC)], + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)], + [false], + true +] call CBA_Settings_fnc_init; + +// Overlay selected body part in medical menu +[ + QGVAR(overlayBodyPart), + "CHECKBOX", + LLSTRING(SETTING_overlayBodyPart), + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)], + [false], + false +] call CBA_Settings_fnc_init; + +// Label left and right in medical menu +[ + QGVAR(showPatientSideLabels), + "CHECKBOX", + LLSTRING(SETTING_showPatientSideLabels), + [CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)], + [false], + false +] call CBA_Settings_fnc_init; + +// OVERRIDE ACE + +/* +* Default damage colouring follows a "white, yellow, red" colour scale with 10 steps, Bezier interpolation and Correct lightness gradient. +* See: https://gka.github.io/palettes +* // KAM // "#ffef7a, yellow, red" - 9 steps +*/ +private _bloodLossColors = [ + [1.00, 1.00, 1.00, 1], + [1.00, 0.94, 0.48, 1], + [1.00, 0.87, 0.25, 1], + [1.00, 0.79, 0.17, 1], + [1.00, 0.71, 0.11, 1], + [1.00, 0.62, 0.05, 1], + [1.00, 0.53, 0.01, 1], + [1.00, 0.42, 0.00, 1], + [1.00, 0.29, 0.00, 1], + [1.00, 0.00, 0.00, 1] +]; + +/* +* Default damage colouring follows a "white, cyan, blue" colour scale with 10 steps, Bezier interpolation and Correct lightness gradient. +* See: https://gka.github.io/palettes +* // KAM // "white, cyan, blue" - 12 steps +*/ +private _damageColors = [ + [1.00, 1.00, 1.00, 1], + [0.52, 0.73, 1.00, 1], + [0.38, 0.68, 1.00, 1], + [0.37, 0.60, 1.00, 1], + [0.35, 0.53, 1.00, 1], + [0.33, 0.45, 1.00, 1], + [0.30, 0.37, 1.00, 1], + [0.25, 0.29, 1.00, 1], + [0.18, 0.18, 1.00, 1], + [0.00, 0.00, 1.00, 1] +]; + +private _categoryColors = [ACELSTRING(medical,Category), format ["| %1 |", ACELLSTRING(common,subcategory_colors)]]; +{ + [ + format ["%1_%2", QACEGVAR(medical_gui,bloodLossColor), _forEachIndex], + "COLOR", + [format [localize ACELSTRING(medical_gui,BloodLossColorX_DisplayName), _forEachIndex], ACELSTRING(medical_gui,BloodLossColor_Description)], + _categoryColors, + _x, + false // isGlobal + ] call CBA_fnc_addSetting; +} forEach _bloodLossColors; + +{ + [ + format ["%1_%2", QACEGVAR(medical_gui,damageColor), _forEachIndex], + "COLOR", + [format [localize ACELSTRING(medical_gui,DamageColorX_DisplayName), _forEachIndex], ACELSTRING(medical_gui,DamageColor_Description)], + _categoryColors, + _x, + false // isGlobal + ] call CBA_fnc_addSetting; +} forEach _damageColors; \ No newline at end of file diff --git a/addons/gui/functions/fnc_displayPatientInformation.sqf b/addons/gui/functions/fnc_displayPatientInformation.sqf index 0ea69ebf2..ac99b7ec3 100644 --- a/addons/gui/functions/fnc_displayPatientInformation.sqf +++ b/addons/gui/functions/fnc_displayPatientInformation.sqf @@ -45,7 +45,7 @@ if (isNull _display) then { // Update body image private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP; - [_ctrlBodyImage, _target] call ACEFUNC(medical_gui,updateBodyImage); + [_ctrlBodyImage, _target, _selectionN] call ACEFUNC(medical_gui,updateBodyImage); // Update injury list private _ctrlInjuries = _display displayCtrl IDC_INJURIES; diff --git a/addons/gui/functions/fnc_menuPFH.sqf b/addons/gui/functions/fnc_menuPFH.sqf index 1f3679cc7..056b3a5a6 100644 --- a/addons/gui/functions/fnc_menuPFH.sqf +++ b/addons/gui/functions/fnc_menuPFH.sqf @@ -44,7 +44,7 @@ private _ctrlInjuries = _display displayCtrl IDC_INJURIES; // Update body image private _ctrlBodyImage = _display displayCtrl IDC_BODY_GROUP; -[_ctrlBodyImage, ACEGVAR(medical_gui,target)] call ACEFUNC(medical_gui,updateBodyImage); +[_ctrlBodyImage, ACEGVAR(medical_gui,target), ACEGVAR(medical_gui,selectedBodyPart)] call ACEFUNC(medical_gui,updateBodyImage); // Update activity and quick view logs private _ctrlActivityLog = _display displayCtrl IDC_ACTIVITY; diff --git a/addons/gui/functions/fnc_onMenuClose.sqf b/addons/gui/functions/fnc_onMenuClose.sqf index 7cde2ef57..25635adda 100644 --- a/addons/gui/functions/fnc_onMenuClose.sqf +++ b/addons/gui/functions/fnc_onMenuClose.sqf @@ -15,8 +15,8 @@ * Public: No */ -if (ACEGVAR(interact_menu,menuBackground) == 1) then {[QACEGVAR(medcial_gui,id), false] call EFUNC(common,blurScreen)}; -if (ACEGVAR(interact_menu,menuBackground) == 2) then {(uiNamespace getVariable [QEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0}; +if (ACEGVAR(interact_menu,menuBackground) == 1) then {[QACEGVAR(medical_gui,id), false] call ACEFUNC(common,blurScreen)}; +if (ACEGVAR(interact_menu,menuBackground) == 2) then {(uiNamespace getVariable [QACEGVAR(interact_menu,menuBackground), displayNull]) closeDisplay 0}; ACEGVAR(medical_gui,pendingReopen) = false; ACEGVAR(medical_gui,menuPFH) call CBA_fnc_removePerFrameHandler; diff --git a/addons/gui/functions/fnc_onMenuOpen.sqf b/addons/gui/functions/fnc_onMenuOpen.sqf index 54a544b3d..6291c95e6 100644 --- a/addons/gui/functions/fnc_onMenuOpen.sqf +++ b/addons/gui/functions/fnc_onMenuOpen.sqf @@ -26,8 +26,8 @@ if (ACEGVAR(interact_menu,menuBackground) == 2) then {0 cutRsc [QACEGVAR(interac [{setMousePosition _this}, _this] call CBA_fnc_execNextFrame; }, getMousePosition] call CBA_fnc_execNextFrame; -// Set target name as title -private _ctrlTitle = _display displayCtrl IDC_TITLE; +// Set middle header as target name +private _ctrlTitle = _display displayCtrl IDC_NAME; _ctrlTitle ctrlSetText ([ACEGVAR(medical_gui,target)] call ACEFUNC(common,getName)); // Initially hide the triage select buttons @@ -60,9 +60,25 @@ private _countEnabled = { if (_category isEqualType "") then { _x set [1, (ACEGVAR(medical_gui,actions) findIf {_category == _x select 1}) > -1]; }; _x select 1 } count _list; -private _offsetX = POS_X(1.5) + 0.5 * (POS_X(12) - POS_X(_countEnabled * 1.5)); +private _offsetX = POS_X(1.5) + 0.5 * (POS_X(12.33) - POS_X(_countEnabled * 1.5) - POS_W(2 * 0.2)); +// 0.2 - divider gap size + +// Set divider position +private _ctrl = _display displayCtrl IDC_TRIAGE_DIVIDER; +_ctrl ctrlSetPositionX _offsetX + POS_W(1.5) + POS_W(0.085); // 0.085 = (0.2 - 0.03) / 2 +_ctrl ctrlCommit 0; + +_ctrl = _display displayCtrl IDC_TOGGLE_DIVIDER; +_ctrl ctrlSetPositionX _offsetX + POS_W(1.5*(_countEnabled - 1)) + POS_W(0.2) + POS_W(0.085); +_ctrl ctrlCommit 0; + { _x params ["_idc", "_enabled"]; + + if (_forEachIndex == 1 || {_forEachIndex == count _list - 1}) then { + _offsetX = _offsetX + POS_W(0.2); + }; + private _ctrl = _display displayCtrl _idc; if (_enabled) then { _ctrl ctrlSetPositionX _offsetX; @@ -71,4 +87,19 @@ private _offsetX = POS_X(1.5) + 0.5 * (POS_X(12) - POS_X(_countEnabled * 1.5)); } else { _ctrl ctrlShow false; }; -} forEach _list; \ No newline at end of file +} forEach _list; + +if (GVAR(showPatientSideLabels)) then { + (_display displayCtrl IDC_SIDE_LABEL_LEFT) ctrlShow true; + (_display displayCtrl IDC_SIDE_LABEL_RIGHT) ctrlShow true; +}; + +// Set toggle button icon and tooltip +private _ctrl = _display displayCtrl IDC_TOGGLE; +if (ACEGVAR(medical_gui,target) == ACE_player) then { + _ctrl ctrlSetText QACEPATHTOF(medical_gui,data\categories\toggle_to_other.paa); + _ctrl ctrlSetTooltip ACELLSTRING(medical_gui,ToggleToOther); +} else { + _ctrl ctrlSetText QACEPATHTOF(medical_gui,data\categories\toggle_to_self.paa); + _ctrl ctrlSetTooltip ACELLSTRING(medical_gui,ToggleToSelf); +}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_updateActions.sqf b/addons/gui/functions/fnc_updateActions.sqf index f140a0aca..b5119fe09 100644 --- a/addons/gui/functions/fnc_updateActions.sqf +++ b/addons/gui/functions/fnc_updateActions.sqf @@ -19,39 +19,55 @@ params ["_display"]; private _selectedCategory = ACEGVAR(medical_gui,selectedCategory); -// Clear all action buttons -{ - private _ctrl = _display displayCtrl _x; - _ctrl ctrlRemoveAllEventHandlers "ButtonClick"; - _ctrl ctrlShow false; -} forEach IDCS_ACTION_BUTTON; +private _group = _display displayCtrl IDC_ACTION_BUTTON_GROUP; +private _actionButtons = allControls _group; // Handle triage list (no actions shown) private _ctrlTriage = _display displayCtrl IDC_TRIAGE_CARD; private _showTriage = _selectedCategory == "triage"; _ctrlTriage ctrlEnable _showTriage; +_group ctrlEnable !_showTriage; lbClear _ctrlTriage; if (_showTriage) exitWith { + { ctrlDelete _x } forEach _actionButtons; [_ctrlTriage, ACEGVAR(medical_gui,target)] call ACEFUNC(medical_gui,updateTriageCard); }; // Show treatment options on action buttons -private _idcIndex = 0; - +private _shownIndex = 0; { - _x params ["_displayName", "_category", "_condition", "_statement"]; + _x params ["_displayName", "_category", "_condition", "_statement", "_items"]; // Check action category and condition if (_category == _selectedCategory && {call _condition}) then { - private _ctrl = _display displayCtrl (IDCS_ACTION_BUTTON select _idcIndex); + private _ctrl = if (_shownIndex >= count _actionButtons) then { + _actionButtons pushBack (_display ctrlCreate ["ACE_Medical_Menu_ActionButton", -1, _group]); + }; + _ctrl = _actionButtons # _shownIndex; + _ctrl ctrlRemoveAllEventHandlers "ButtonClick"; + _ctrl ctrlSetPositionY POS_H(1.1 * _shownIndex); + _ctrl ctrlCommit 0; + + private _countText = ""; + if (_items isNotEqualTo []) then { + if ("ACE_surgicalKit" in _items && {ACEGVAR(medical_treatment,consumeSurgicalKit) == 2}) then { + _items = ["ACE_suture"]; + }; + private _counts = [_items] call ACEFUNC(medical_gui,countTreatmentItems); + _countText = _counts call ACEFUNC(medical_gui,formatItemCounts); + }; + _ctrl ctrlSetTooltip _countText; + _ctrl ctrlSetText _displayName; _ctrl ctrlShow true; _ctrl ctrlAddEventHandler ["ButtonClick", _statement]; _ctrl ctrlAddEventHandler ["ButtonClick", {ACEGVAR(medical_gui,pendingReopen) = true}]; - _idcIndex = _idcIndex + 1; + _shownIndex = _shownIndex + 1; }; } forEach ACEGVAR(medical_gui,actions); + +{ ctrlDelete _x } forEach (_actionButtons select [_shownIndex, 9999]); \ No newline at end of file diff --git a/addons/gui/functions/fnc_updateBodyImage.sqf b/addons/gui/functions/fnc_updateBodyImage.sqf index d0bb0e1cc..24d2fb5f2 100644 --- a/addons/gui/functions/fnc_updateBodyImage.sqf +++ b/addons/gui/functions/fnc_updateBodyImage.sqf @@ -1,36 +1,49 @@ #include "script_component.hpp" /* * Author: Glowbal, SilentSpike, mharis001 + * Modified: Blue * Updates the body image for given target. * * Arguments: * 0: Body image controls group * 1: Target + * 2: Body part * * Return Value: * None * * Example: - * [CONTROL, _target] call ace_medical_gui_fnc_updateBodyImage + * [CONTROL, _target, 0] call ace_medical_gui_fnc_updateBodyImage * * Public: No */ -params ["_ctrlGroup", "_target"]; +params ["_ctrlGroup", "_target", "_selectionN"]; // Get tourniquets, damage, and blood loss for target private _tourniquets = GET_TOURNIQUETS(_target); private _fractures = GET_FRACTURES(_target); private _bodyPartDamage = _target getVariable [QACEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]]; +private _damageThreshold = GET_DAMAGE_THRESHOLD(_target); private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; { - _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; - _bodyPartBloodLoss set [_bodyPartN, (_bodyPartBloodLoss select _bodyPartN) + (_bleeding * _amountOf)]; + private _partIndex = ALL_BODY_PARTS find _x; + { + _x params ["", "_amountOf", "_bleeding"]; + _bodyPartBloodLoss set [_partIndex, (_bodyPartBloodLoss select _partIndex) + (_bleeding * _amountOf)]; + } forEach _y; } forEach GET_OPEN_WOUNDS(_target); { - _x params ["_bodyPartIDC", ["_tourniquetIDC", -1], ["_fractureIDC", -1]]; + _x params ["_bodyPartIDC", "_selectedIDC", ["_tourniquetIDC", -1], ["_fractureIDC", -1]]; + + if (GVAR(overlayBodyPart)) then { + private _selected = _forEachIndex == _selectionN; + private _ctrlSelected = _ctrlGroup controlsGroupCtrl _selectedIDC; + _ctrlSelected ctrlSetTextColor ACEGVAR(medical_gui,bodypartOutlineColor); + _ctrlSelected ctrlShow _selected; + }; // Show or hide the tourniquet icon if (_tourniquetIDC != -1) then { @@ -51,7 +64,7 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; _ctrlBone ctrlSetTextColor [1, 0, 0, 1]; }; case -1: { - if (ace_medical_fractures in [2, 3]) then { + if (ACEGVAR(medical,fractures) in [2, 3]) then { _ctrlBone ctrlShow true; _ctrlBone ctrlSetTextColor [0, 0, 1, 1]; } else { @@ -67,18 +80,33 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; [_bloodLoss] call ACEFUNC(medical_gui,bloodLossToRGBA); } else { private _damage = _bodyPartDamage select _forEachIndex; + switch (true) do { // torso damage threshold doesn't need scaling + case (_forEachIndex > 3): { // legs: index 4 & 5 + _damageThreshold = LIMPING_DAMAGE_THRESHOLD_DEFAULT * 4; + }; + case (_forEachIndex > 1): { // arms: index 2 & 3 + _damageThreshold = FRACTURE_DAMAGE_THRESHOLD_DEFAULT * 4; + }; + case (_forEachIndex == 0): { // head: index 0 + _damageThreshold = _damageThreshold * 1.25; + }; + default { // torso: index 1 + _damageThreshold = _damageThreshold * 1.5 + }; + }; + _damage = (_damage / _damageThreshold) min 1; [_damage] call ACEFUNC(medical_gui,damageToRGBA); }; private _ctrlBodyPart = _ctrlGroup controlsGroupCtrl _bodyPartIDC; _ctrlBodyPart ctrlSetTextColor _bodyPartColor; } forEach [ - [IDC_BODY_HEAD, -1, -1, -1], - [IDC_BODY_TORSO, -1, -1, -1], - [IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B, -1], - [IDC_BODY_ARMRIGHT, IDC_BODY_ARMRIGHT_T, IDC_BODY_ARMRIGHT_B, -1], - [IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B, -1], - [IDC_BODY_LEGRIGHT, IDC_BODY_LEGRIGHT_T, IDC_BODY_LEGRIGHT_B, -1] + [IDC_BODY_HEAD, IDC_BODY_HEAD_S], + [IDC_BODY_TORSO, IDC_BODY_TORSO_S], + [IDC_BODY_ARMLEFT, IDC_BODY_ARMLEFT_S, IDC_BODY_ARMLEFT_T, IDC_BODY_ARMLEFT_B], + [IDC_BODY_ARMRIGHT, IDC_BODY_ARMRIGHT_S, IDC_BODY_ARMRIGHT_T, IDC_BODY_ARMRIGHT_B], + [IDC_BODY_LEGLEFT, IDC_BODY_LEGLEFT_S, IDC_BODY_LEGLEFT_T, IDC_BODY_LEGLEFT_B], + [IDC_BODY_LEGRIGHT, IDC_BODY_LEGRIGHT_S, IDC_BODY_LEGRIGHT_T, IDC_BODY_LEGRIGHT_B] ]; // Airway @@ -102,7 +130,7 @@ if !(_airwayItem isEqualTo "") then { // Breathing private _ctrlPulseOximeterRight = _ctrlGroup controlsGroupCtrl IDC_BODY_RIGHTARM_PULSEOX; -private _ctrlPulseOximeterLeft = _ctrlGroup controlsGroupCtrl IDC_BODY_LEFARM_PULSEOX; +private _ctrlPulseOximeterLeft = _ctrlGroup controlsGroupCtrl IDC_BODY_LEFTARM_PULSEOX; private _ctrlChestSeal = _ctrlGroup controlsGroupCtrl IDC_BODY_TORSO_CHESTSEAL; private _ctrlChestInjury = _ctrlGroup controlsGroupCtrl IDC_BODY_TORSO_PNEUMOTHORAX; diff --git a/addons/gui/functions/fnc_updateCategories.sqf b/addons/gui/functions/fnc_updateCategories.sqf index 10d461029..46d96d070 100644 --- a/addons/gui/functions/fnc_updateCategories.sqf +++ b/addons/gui/functions/fnc_updateCategories.sqf @@ -21,17 +21,31 @@ params ["_display"]; _x params ["_idc", "_category"]; private _ctrl = _display displayCtrl _idc; - private _enable = ACEGVAR(medical_gui,actions) findIf {_category == _x select 1 && {call (_x select 2)}} > -1; + private _enable = true; + if !(_category == "triage") then { + _enable = ACEGVAR(medical_gui,actions) findIf {_category == _x select 1 && {call (_x select 2)}} > -1; + }; _ctrl ctrlEnable _enable; + private _selectedColor = [ + profileNamespace getVariable ["GUI_BCG_RGB_R", 0.13], + profileNamespace getVariable ["GUI_BCG_RGB_G", 0.54], + profileNamespace getVariable ["GUI_BCG_RGB_B", 0.21], + profileNamespace getVariable ["GUI_BCG_RGB_A", 0.8] + ]; + private _color = [[0.4, 0.4, 0.4, 1], [1, 1, 1, 1]] select _enable; + _color = [_color, _selectedColor] select (ACEGVAR(medical_gui,selectedCategory) isEqualTo _category); _ctrl ctrlSetTextColor _color; + _color set [-1, 0.8]; + _ctrl ctrlSetBackgroundColor _color; } forEach [ + [IDC_TRIAGE, "triage"], [IDC_EXAMINE, "examine"], [IDC_BANDAGE, "bandage"], [IDC_MEDICATION, "medication"], [IDC_AIRWAY, "airway"], [IDC_ADVANCED, "advanced"], - [IDC_DRAG, "drag"], - [IDC_SURGERY, "surgery"] + [IDC_SURGERY, "surgery"], + [IDC_DRAG, "drag"] ]; diff --git a/addons/gui/functions/fnc_updateInjuryList.sqf b/addons/gui/functions/fnc_updateInjuryList.sqf index f2f36d738..398c460cd 100644 --- a/addons/gui/functions/fnc_updateInjuryList.sqf +++ b/addons/gui/functions/fnc_updateInjuryList.sqf @@ -20,27 +20,44 @@ params ["_ctrl", "_target", "_selectionN"]; private _entries = []; - -// Add selected body part name -private _bodyPartName = [ - ACELSTRING(medical_gui,Head), - ACELSTRING(medical_gui,Torso), - ACELSTRING(medical_gui,LeftArm), - ACELSTRING(medical_gui,RightArm), - ACELSTRING(medical_gui,LeftLeg), - ACELSTRING(medical_gui,RightLeg) -] select _selectionN; - -_entries pushBack [localize _bodyPartName, [1, 1, 1, 1]]; +private _nonissueColor = [1, 1, 1, 0.33]; // Indicate if unit is bleeding at all if (IS_BLEEDING(_target)) then { - _entries pushBack [localize ACELSTRING(medical_gui,Status_Bleeding), [1, 0, 0, 1]]; + // Give a qualitative description of the rate of bleeding + private _cardiacOutput = [_target] call ACEFUNC(medical_status,getCardiacOutput); + private _bleedRate = GET_BLOOD_LOSS(_target); + private _bleedRateKO = BLOOD_LOSS_KNOCK_OUT_THRESHOLD_DEFAULT * (_cardiacOutput max 0.05); + // Use nonzero minimum cardiac output to prevent all bleeding showing as massive during cardiac arrest + + if (GVAR(showBleedRate)) then { + switch (true) do { + case (_bleedRate < _bleedRateKO * BLEED_RATE_SLOW): { + _entries pushBack [localize ACELSTRING(medical_gui,Bleed_Rate1), [1, 1, 0, 1]]; + }; + case (_bleedRate < _bleedRateKO * BLEED_RATE_MODERATE): { + _entries pushBack [localize ACELSTRING(medical_gui,Bleed_Rate2), [1, 0.67, 0, 1]]; + }; + case (_bleedRate < _bleedRateKO * BLEED_RATE_SEVERE): { + _entries pushBack [localize ACELSTRING(medical_gui,Bleed_Rate3), [1, 0.33, 0, 1]]; + }; + default { + _entries pushBack [localize ACELSTRING(medical_gui,Bleed_Rate4), [1, 0, 0, 1]]; + }; + }; + } else { + _entries pushBack [localize ACELSTRING(medical_gui,Status_Bleeding), [1, 0, 0, 1]]; + }; +} else { + if (GVAR(showInactiveStatuses)) then {_entries pushBack [localize ACELSTRING(medical_gui,Status_Nobleeding), _nonissueColor];}; }; -if(ACEGVAR(medical_gui,showBloodLossEntry)) then { +if (ACEGVAR(medical_gui,showBloodlossEntry)) then { // Give a qualitative description of the blood volume lost switch (GET_HEMORRHAGE(_target)) do { + case 0: { + if (GVAR(showInactiveStatuses)) then {_entries pushBack [localize ACELSTRING(medical_gui,Lost_Blood0), _nonissueColor];}; + }; case 1: { _entries pushBack [localize ACELSTRING(medical_gui,Lost_Blood1), [1, 1, 0, 1]]; }; @@ -56,21 +73,40 @@ if(ACEGVAR(medical_gui,showBloodLossEntry)) then { }; }; -// Indicate if a tourniquet is applied -if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { - _entries pushBack [localize ACELSTRING(medical_gui,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; -}; +// Show receiving IV volume remaining +private _totalIvVolume = 0; +private _saline = 0; +private _blood = 0; +private _plasma = 0; -// Indicate current body part fracture status -switch (GET_FRACTURES(_target) select _selectionN) do { - case 1: { - _entries pushBack [localize ACELSTRING(medical_gui,Status_Fractured), [1, 0, 0, 1]]; - }; - case -1: { - if ((ACEGVAR(medical,fractures)) in [2, 3]) then { - _entries pushBack [localize ACELSTRING(medical_gui,Status_SplintApplied), [0.2, 0.2, 1, 1]]; +{ + _x params ["_volumeRemaining", "_type"]; + switch (_type) do { + case ("Saline"): { + _saline = _saline + _volumeRemaining; + }; + case ("Blood"): { + _blood = _blood + _volumeRemaining; + }; + case ("Plasma"): { + _plasma = _plasma + _volumeRemaining; }; }; + _totalIvVolume = _totalIvVolume + _volumeRemaining; +} forEach (_target getVariable [QACEGVAR(medical,ivBags), []]); + +if (_totalIvVolume >= 1) then { + if (_saline > 1) then { + _entries pushBack ["Saline: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _saline]), [1, 1, 1, 1]]; + }; + if (_blood > 1) then { + _entries pushBack ["Blood: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _blood]), [1, 1, 1, 1]]; + }; + if (_plasma > 1) then { + _entries pushBack ["Plasma: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _plasma]), [1, 1, 1, 1]]; + }; +} else { + if (GVAR(showInactiveStatuses)) then {_entries pushBack [localize LSTRING(Status_NoIv), _nonissueColor];}; }; // Indicate the amount of pain the unit is in @@ -78,10 +114,10 @@ if (_target call ACEFUNC(common,isAwake)) then { private _pain = GET_PAIN_PERCEIVED(_target); if (_pain > 0) then { private _painText = switch (true) do { - case (_pain > 0.5): { + case (_pain > PAIN_UNCONSCIOUS): { ACELSTRING(medical_treatment,Status_SeverePain); }; - case (_pain > 0.1): { + case (_pain > (PAIN_UNCONSCIOUS / 5)): { ACELSTRING(medical_treatment,Status_Pain); }; default { @@ -89,89 +125,97 @@ if (_target call ACEFUNC(common,isAwake)) then { }; }; _entries pushBack [localize _painText, [1, 1, 1, 1]]; - }; -}; - -// Add entries for open, bandaged, and stitched wounds -private _woundEntries = []; - -private _fnc_getWoundDescription = { - private _classIndex = _woundClassID / 10; - private _category = _woundClassID % 10; - private _className = ACEGVAR(medical_damage,woundClassNames) select _classIndex; - private _suffix = ["Minor", "Medium", "Large"] select _category; - private _woundName = localize format ["STR_ACE_medical_damage_%1_%2", _className, _suffix]; - if (_amountOf >= 1) then { - format ["%1x %2", ceil _amountOf, _woundName]; } else { - format [localize ACELSTRING(medical_gui,PartialX), _woundName]; + if (GVAR(showInactiveStatuses)) then {_entries pushBack [localize ACELSTRING(medical_treatment,Status_NoPain), _nonissueColor];}; }; +} else { + if (GVAR(showInactiveStatuses)) then {_entries pushBack [localize ACELSTRING(medical_treatment,Status_NoPain), _nonissueColor];}; }; -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN) then { - if (_amountOf > 0) then { - _woundEntries pushBack [call _fnc_getWoundDescription, [1, 1, 1, 1]]; - } else { - // ace_medical_treatment_advancedBandages - // Disabled == 0 - // Enabled == 1 - // EnabledCanReopen == 2 - if (ACEGVAR(medical_treatment,advancedBandages) < 2) then { - _woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; - }; - }; - }; -} forEach GET_OPEN_WOUNDS(_target); - -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN && {_amountOf > 0}) then { - _woundEntries pushBack [format ["[B] %1", call _fnc_getWoundDescription], [0.88, 0.7, 0.65, 1]]; - }; -} forEach GET_BANDAGED_WOUNDS(_target); - -{ - _x params ["_woundClassID", "_bodyPartN", "_amountOf"]; - if (_selectionN == _bodyPartN && {_amountOf > 0}) then { - _woundEntries pushBack [format ["[S] %1", call _fnc_getWoundDescription], [0.7, 0.7, 0.7, 1]]; - }; -} forEach GET_STITCHED_WOUNDS(_target); - //INTOXICATION by DiGii private _poisontype = _target getVariable [QEGVAR(chemical,poisonType),""]; -if(_target getVariable [QEGVAR(chemical,airPoisoning),false]) then{ - _woundEntries pushBack [LELSTRING(chemical,Intoxication), [0.4,0,0.5,1]]; +if (_target getVariable [QEGVAR(chemical,airPoisoning),false]) then{ + _entries pushBack [LELSTRING(chemical,Intoxication), [0.4,0,0.5,1]]; }; -// EDIT by Katalam & Tomcat -if (_target getVariable [QEGVAR(airway,airway), false] && _selectionN isEqualTo 0) then { - private _a = _target getVariable [QEGVAR(airway,airway_item), ""]; - if !(_a isEqualTo "") then { - private _text = format [ELSTRING(airway,%1_Display), _a]; - _woundEntries pushback [localize _text, [0.1, 1, 1, 1]]; - }; +if (_target getVariable [QEGVAR(airway,recovery), false]) then { + _entries pushback [LELSTRING(airway,RecoveryPosition), [0.1, 1, 1, 1]]; }; -if(_target getVariable [QEGVAR(breathing,pulseoximeter), false] && _selectionN in [2,3]) then { - if((_target getVariable [QEGVAR(breathing,PulseOximeter_Attached), [0,0]] select (_selectionN - 2)) > 0) then { - _entries pushback [LELSTRING(breathing,Pulseoximeter_Desc_Short), [0.3, 0.8, 0.8, 1]]; +if (_entries isNotEqualTo []) then { + _entries pushBack ["", [1, 1, 1, 1]]; // GLOBAL // LOCAL LINE +}; + +// Add selected body part name +private _bodyPartName = [ + ACELSTRING(medical_gui,Head), + ACELSTRING(medical_gui,Torso), + ACELSTRING(medical_gui,LeftArm), + ACELSTRING(medical_gui,RightArm), + ACELSTRING(medical_gui,LeftLeg), + ACELSTRING(medical_gui,RightLeg) +] select _selectionN; + +_entries pushBack [localize _bodyPartName, [1, 1, 1, 1]]; + +// Damage taken tooltip +if (ACEGVAR(medical_gui,showDamageEntry)) then { + private _bodyPartDamage = (_target getVariable [QACEGVAR(medical,bodyPartDamage), [0, 0, 0, 0, 0, 0]]) select _selectionN; + if (_bodyPartDamage > 0) then { + private _damageThreshold = GET_DAMAGE_THRESHOLD(_target); + switch (true) do { + case (_selectionN > 3): { // legs: index 4 & 5 + _damageThreshold = LIMPING_DAMAGE_THRESHOLD_DEFAULT * 4; + }; + case (_selectionN > 1): { // arms: index 2 & 3 + _damageThreshold = FRACTURE_DAMAGE_THRESHOLD_DEFAULT * 4; + }; + case (_selectionN == 0): { // head: index 0 + _damageThreshold = _damageThreshold * 1.25; + }; + default { // torso: index 1 + _damageThreshold = _damageThreshold * 1.5; + }; + }; + _bodyPartDamage = (_bodyPartDamage / _damageThreshold) min 1; + switch (true) do { + case (_bodyPartDamage isEqualTo 1): { + _entries pushBack [localize ACELSTRING(medical_gui,traumaSustained4), [_bodyPartDamage] call ACEFUNC(medical_gui,damageToRGBA)]; + }; + case (_bodyPartDamage >= 0.75): { + _entries pushBack [localize ACELSTRING(medical_gui,traumaSustained3), [_bodyPartDamage] call ACEFUNC(medical_gui,damageToRGBA)]; + }; + case (_bodyPartDamage >= 0.5): { + _entries pushBack [localize ACELSTRING(medical_gui,traumaSustained2), [_bodyPartDamage] call ACEFUNC(medical_gui,damageToRGBA)]; + }; + case (_bodyPartDamage >= 0.25): { + _entries pushBack [localize ACELSTRING(medical_gui,traumaSustained1), [_bodyPartDamage] call ACEFUNC(medical_gui,damageToRGBA)]; + }; + }; }; }; -if (_target getVariable [QEGVAR(airway,overstretch), false] && _selectionN isEqualTo 0) then { - _woundEntries pushback [LELSTRING(airway,overstretched), [0.1, 1, 1, 1]]; +// Indicate if a tourniquet is applied +if (HAS_TOURNIQUET_APPLIED_ON(_target,_selectionN)) then { + _entries pushBack [localize ACELSTRING(medical_gui,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; -if (_target getVariable [QEGVAR(airway,recovery), false]) then { - _entries pushback [LELSTRING(airway,RecoveryPosition), [0.1, 1, 1, 1]]; +// Indicate current body part fracture status +switch (GET_FRACTURES(_target) select _selectionN) do { + case 1: { + _entries pushBack [localize ACELSTRING(medical_gui,Status_Fractured), [1, 0, 0, 1]]; + }; + case -1: { + if (ACEGVAR(medical,fractures) in [2, 3]) then { // Ignore if the splint has no effect + _entries pushBack [localize ACELSTRING(medical_gui,Status_SplintApplied), [0.2, 0.2, 1, 1]]; + }; + }; }; // Display cyanosis in overview tab, only when head/arms are selected -if (EGVAR(breathing,cyanosisShowInMenu) && (_selectionN in [0,2,3])) then { +if (EGVAR(breathing,showCyanosis) && _selectionN in [0,2,3]) then { private _spO2 = 0; - + if (alive _target) then { _spO2 = GET_SPO2(_target); }; @@ -189,10 +233,31 @@ if (EGVAR(breathing,cyanosisShowInMenu) && (_selectionN in [0,2,3])) then { [LELSTRING(breathing,CyanosisStatus_Slight), [0.16, 0.47, 1, 1]]; }; }; - _entries pushBack [(_cyanosisArr select 0), (_cyanosisArr select 1)]; + _entries pushBack _cyanosisArr; }; }; +// Airway State +if (_target getVariable [QEGVAR(airway,overstretch), false] && _selectionN isEqualTo 0) then { + _entries pushback [LELSTRING(airway,overstretched), [0.1, 1, 1, 1]]; +}; + +if (_target getVariable [QEGVAR(airway,airway), false] && _selectionN isEqualTo 0) then { + private _a = _target getVariable [QEGVAR(airway,airway_item), ""]; + if !(_a isEqualTo "") then { + private _text = format [ELSTRING(airway,%1_Display), _a]; + _entries pushback [localize _text, [0.1, 1, 1, 1]]; + }; +}; + +if (_target getVariable [QEGVAR(breathing,pulseoximeter), false] && _selectionN in [2,3]) then { + if((_target getVariable [QEGVAR(breathing,PulseOximeter_Attached), [0,0]] select (_selectionN - 2)) > 0) then { + _entries pushback [LELSTRING(breathing,Pulseoximeter_Desc_Short), [0.3, 0.8, 0.8, 1]]; + }; +}; + +private _ptxEntry = []; + if (_selectionN isEqualTo 1) then { private _tensionhemothorax = false; if (!(EGVAR(breathing,showPneumothorax_dupe))) then { @@ -207,7 +272,7 @@ if (_selectionN isEqualTo 1) then { if(EGVAR(breathing,PneumothoraxAlwaysVisible)) then { if ((_target getVariable [QEGVAR(breathing,pneumothorax), 0] > 0) && !(_tensionhemothorax)) then { - _woundEntries pushback [LELSTRING(breathing,pneumothorax_mm), [1,1,1,1]]; + _ptxEntry pushback [LELSTRING(breathing,pneumothorax_mm), [1,1,1,1]]; }; } else { if (_target getVariable [QEGVAR(breathing,deepPenetratingInjury), false]) then { @@ -217,50 +282,16 @@ if (_selectionN isEqualTo 1) then { if (EGVAR(breathing,TensionHemothoraxAlwaysVisible)) then { if (_target getVariable [QEGVAR(breathing,hemopneumothorax), false]) then { - _woundEntries pushback [LELSTRING(breathing,hemopneumothorax_mm), [1,1,1,1]]; + _ptxEntry pushback [LELSTRING(breathing,hemopneumothorax_mm), [1,1,1,1]]; }; if (_target getVariable [QEGVAR(breathing,tensionpneumothorax), false]) then { - _woundEntries pushback [LELSTRING(breathing,tensionpneumothorax_mm), [1,1,1,1]]; + _ptxEntry pushback [LELSTRING(breathing,tensionpneumothorax_mm), [1,1,1,1]]; }; }; }; -// Show receiving IV volume remaining -private _totalIvVolume = 0; -private _saline = 0; -private _blood = 0; -private _plasma = 0; - -{ - _x params ["_volumeRemaining", "_type"]; - switch (_type) do { - case ("Saline"): { - _saline = _saline + _volumeRemaining; - }; - case ("Blood"): { - _blood = _blood + _volumeRemaining; - }; - case ("Plasma"): { - _plasma = _plasma + _volumeRemaining; - }; - }; - _totalIvVolume = _totalIvVolume + _volumeRemaining; -} forEach (_target getVariable [QACEGVAR(medical,ivBags), []]); - -if (_totalIvVolume >= 1) then { - if (_saline > 1) then { - _entries pushBack ["Saline: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _saline]), [1, 1, 1, 1]]; - }; - if (_blood > 1) then { - _entries pushBack ["Blood: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _blood]), [1, 1, 1, 1]]; - }; - if (_plasma > 1) then { - _entries pushBack ["Plasma: " + (format [localize ACELSTRING(medical_treatment,receivingIvVolume), floor _plasma]), [1, 1, 1, 1]]; - }; -}; - -//Handle IV placement +// Handle IV placement private _placed = _target getVariable [QEGVAR(pharma,IV), [0,0,0,0,0,0]]; private _IVactual = _placed select _selectionN; @@ -272,9 +303,45 @@ if (_IVactual > 0) then { }; }; +// Add entries for open, bandaged, and stitched wounds +private _woundEntries = []; + +private _fnc_processWounds = { + params ["_wounds", "_format", "_color"]; + + { + _x params ["_woundClassID", "_amountOf"]; + + if (_amountOf > 0) then { + private _classIndex = _woundClassID / 10; + private _category = _woundClassID % 10; + + private _className = ACEGVAR(medical_damage,woundClassNames) select _classIndex; + private _suffix = ["Minor", "Medium", "Large"] select _category; + private _woundName = localize format [ACELSTRING(medical_damage,%1_%2), _className, _suffix]; + + private _woundDescription = if (_amountOf >= 1) then { + format ["%1x %2", ceil _amountOf, _woundName] + } else { + format [localize ACELSTRING(medical_gui,PartialX), _woundName] + }; + + _woundEntries pushBack [format [_format, _woundDescription], _color]; + }; + } forEach (_wounds getOrDefault [ALL_BODY_PARTS select _selectionN, []]); +}; + +[GET_OPEN_WOUNDS(_target), "%1", [1, 1, 1, 1]] call _fnc_processWounds; +[GET_BANDAGED_WOUNDS(_target), "[B] %1", [0.88, 0.7, 0.65, 1]] call _fnc_processWounds; +[GET_STITCHED_WOUNDS(_target), "[S] %1", [0.7, 0.7, 0.7, 1]] call _fnc_processWounds; + +if (_ptxEntry isNotEqualTo []) then { + _woundEntries pushBack _ptxEntry; +}; + // Handle no wound entries if (_woundEntries isEqualTo []) then { - _entries pushBack [localize ACELSTRING(medical_treatment,NoInjuriesBodypart), [1, 1, 1, 1]]; + _entries pushBack [localize ACELSTRING(medical_treatment,NoInjuriesBodypart), _nonissueColor]; } else { _entries append _woundEntries; }; @@ -288,4 +355,4 @@ lbClear _ctrl; _ctrl lbSetColor [_ctrl lbAdd _text, _color]; } forEach _entries; -_ctrl lbSetCurSel -1; +_ctrl lbSetCurSel -1; \ No newline at end of file diff --git a/addons/gui/gui.hpp b/addons/gui/gui.hpp index 6670a6b1b..b0fb0a8d5 100644 --- a/addons/gui/gui.hpp +++ b/addons/gui/gui.hpp @@ -5,6 +5,7 @@ class RscPicture; class RscListBox; class RscActivePicture; class RscButtonMenu; +class RscControlsGroup; class RscControlsGroupNoScrollbars; class ace_medical_gui_TriageToggle: RscButton { @@ -100,27 +101,34 @@ class ACEGVAR(medical_gui,BodyImage): RscControlsGroupNoScrollbars { }; class ACE_Medical_Menu { - class controls { + class Controls { class Triage: RscActivePicture {}; - class Surgury: Triage { + class Surgery: Triage { idc = IDC_SURGERY; onButtonClick = QUOTE(ace_medical_gui_selectedCategory = 'surgery'); text = QPATHTOF(data\categories\plate.paa); tooltip = "Surgery"; x = QUOTE(POS_X(13.5)); }; - class Action1: RscButtonMenu {}; - class Action10: Action1 { - idc = IDC_ACTION_10; - y = QUOTE(POS_Y(14.4)); + class Toggle: Triage { + tooltip = ACECSTRING(medical_gui,ToggleSelf); + }; + class TriageCard: RscListBox { + h = QUOTE(POS_H(12.2)); + }; + class ActionButtonGroup: RscControlsGroup { + h = QUOTE(POS_H(12.2)); }; - class Action11: Action1 { - idc = IDC_ACTION_11; - y = QUOTE(POS_Y(15.5)); + class Injuries: TriageCard { + y = QUOTE(POS_Y(3.3)); + h = QUOTE(POS_Y(13.3)); + }; + class BodyLabelLeft: RscText { + idc = IDC_SIDE_LABEL_LEFT; + show = 0; }; - class TriageStatus: RscText { - x = QUOTE(POS_X(14.33)); - w = QUOTE(POS_W(10.33)); + class BodyLabelRight: BodyLabelLeft { + idc = IDC_SIDE_LABEL_RIGHT; }; }; }; diff --git a/addons/gui/script_component.hpp b/addons/gui/script_component.hpp index 358cdcbb9..b790f78e8 100644 --- a/addons/gui/script_component.hpp +++ b/addons/gui/script_component.hpp @@ -39,6 +39,7 @@ #define IDD_MEDICAL_MENU 38580 #define IDC_TITLE 1200 +#define IDC_NAME 1210 #define IDC_TRIAGE 1300 #define IDC_EXAMINE 1310 #define IDC_BANDAGE 1320 @@ -47,26 +48,16 @@ #define IDC_ADVANCED 1350 #define IDC_DRAG 1360 #define IDC_TOGGLE 1370 -#define IDC_SURGERY 1380 +#define IDC_SURGERY 1385 +#define IDC_TRIAGE_DIVIDER 1380 +#define IDC_TOGGLE_DIVIDER 1390 #define IDC_TRIAGE_CARD 1400 #define IDC_INJURIES 1410 #define IDC_ACTIVITY 1420 #define IDC_QUICKVIEW 1430 -#define IDC_ACTION_1 1500 -#define IDC_ACTION_2 1510 -#define IDC_ACTION_3 1520 -#define IDC_ACTION_4 1530 -#define IDC_ACTION_5 1540 -#define IDC_ACTION_6 1550 -#define IDC_ACTION_7 1560 -#define IDC_ACTION_8 1570 -#define IDC_ACTION_9 1580 -#define IDC_ACTION_10 1590 -#define IDC_ACTION_11 1600 - -#define IDCS_ACTION_BUTTON [IDC_ACTION_1, IDC_ACTION_2, IDC_ACTION_3, IDC_ACTION_4, IDC_ACTION_5, IDC_ACTION_6, IDC_ACTION_7, IDC_ACTION_8, IDC_ACTION_9, IDC_ACTION_10, IDC_ACTION_11] +#define IDC_ACTION_BUTTON_GROUP 1599 #define IDC_BODY_GROUP 6000 #define IDC_BODY_HEAD 6005 @@ -83,6 +74,16 @@ #define IDC_BODY_ARMRIGHT_B 6060 #define IDC_BODY_LEGLEFT_B 6065 #define IDC_BODY_LEGRIGHT_B 6070 +#define IDC_BODY_GROUP_S 6075 +#define IDC_BODY_HEAD_S 6080 +#define IDC_BODY_TORSO_S 6085 +#define IDC_BODY_ARMLEFT_S 6090 +#define IDC_BODY_ARMRIGHT_S 6095 +#define IDC_BODY_LEGLEFT_S 6100 +#define IDC_BODY_LEGRIGHT_S 6105 + +#define IDC_SIDE_LABEL_RIGHT 7001 +#define IDC_SIDE_LABEL_LEFT 7002 #define IDC_TRIAGE_STATUS 7000 #define IDC_TRIAGE_SELECT 7100 diff --git a/addons/gui/stringtable.xml b/addons/gui/stringtable.xml index 9bcf71cc4..22cff87e0 100644 --- a/addons/gui/stringtable.xml +++ b/addons/gui/stringtable.xml @@ -46,5 +46,23 @@ 異常値の場合、AED-Xやパルスオキシメーターの活動ログを赤色にします Exibe os registros de atividade em vermelhos se algum valor for crítico + + No pushed fluids + + + Show Inactive Statuses + + + Show Bleed Rate + + + Display bleed rate (slow/moderate/severe/massive) + + + Overlay Selected Body Part + + + Label Patient Sides + diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 124709e32..b2aaa17bd 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -38,7 +38,7 @@ #define GETEGVAR(var1,var2,var3) GETMVAR(EGVAR(var1,var2),var3) #define ARR_SELECT(ARRAY,INDEX,DEFAULT) (if (count ARRAY > INDEX) then {ARRAY select INDEX} else {DEFAULT}) - +#define ANY_OF(ARRAY,CONDITION) (ARRAY findIf {CONDITION} != -1) #define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \ weapon = #WEAPON; \ @@ -152,9 +152,9 @@ #define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0) #define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN, false]) #define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON, false]) -#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, []]) -#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, []]) -#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, []]) +#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, createHashMap]) +#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, createHashMap]) +#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, createHashMap]) #define GET_DAMAGE_THRESHOLD(unit) (unit getVariable [QACEGVAR(medical,damageThreshold), [ACEGVAR(medical,AIDamageThreshold),ACEGVAR(medical,playerDamageThreshold)] select (isPlayer unit)]) #define GET_PAIN_PERCEIVED(unit) (0 max (GET_PAIN(unit) - GET_PAIN_SUPPRESS(unit)) min 1) @@ -242,4 +242,7 @@ #define GET_BLOOD_PRESSURE(unit) ([unit] call EFUNC(circulation,getBloodPressure)) #define VAR_BLOODPRESSURE_CHANGE QEGVAR(circulation,bloodPressureChange) -#define GET_BLOODPRESSURE_CHANGE(unit) (unit getVariable [VAR_BLOODPRESSURE_CHANGE, [0,0]]) \ No newline at end of file +#define GET_BLOODPRESSURE_CHANGE(unit) (unit getVariable [VAR_BLOODPRESSURE_CHANGE, [0,0]]) + +// Pharmacy +#define GET_BLOOD_LOSS(unit) ([unit] call EFUNC(pharma,getBloodLoss)) diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index a55a75139..670aa5518 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -7,13 +7,13 @@ #define VERSION MAJOR.MINOR #define VERSION_STR MAJOR.MINOR.PATCH -#define VERSION_AR MAJOR,MINOR,PATCH +#define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD #define VERSION_CONFIG version = MAJOR.MINOR; versionStr = QUOTE(MAJOR.MINOR.PATCH); versionAr[] = {MAJOR,MINOR,PATCH} // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.88 -#define REQUIRED_CBA_VERSION {3,8,0} +#define REQUIRED_VERSION 2.14 +#define REQUIRED_CBA_VERSION {3,15,7} #ifdef COMPONENT_BEAUTIFIED #define COMPONENT_NAME QUOTE(KAT - COMPONENT_BEAUTIFIED) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 50a79ba2e..05b6c2815 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 2 -#define MINOR 12 -#define PATCH 4 -#define BUILD 34 +#define MINOR 13 +#define PATCH 0 +#define BUILD 35 diff --git a/addons/misc/XEH_preInit.sqf b/addons/misc/XEH_preInit.sqf index 98ff3d45e..a075ee677 100644 --- a/addons/misc/XEH_preInit.sqf +++ b/addons/misc/XEH_preInit.sqf @@ -24,7 +24,7 @@ PREP_RECOMPILE_END; "LIST", [LLSTRING(SETTING_allowSharedVehicleEquipment), LLSTRING(SETTING_allowSharedVehicleEquipment_DESC)], [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], - [[0, 1, 2, 3, 4], ["STR_ACE_Common_No", "STR_ACE_Medical_Treatment_AllowSharedEquipment_PriorityMedic", LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleNoSelfTreatment), LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleExceptSelfTreatment), LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleAlways)], 0], + [[0, 1, 2, 3, 4], ["STR_ACE_Common_No", "STR_ACE_Medical_Treatment_AllowSharedEquipment_PriorityMedic", LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleNoSelfTreatment), LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleExceptSelfTreatment), LLSTRING(SETTING_allowSharedVehicleEquipment_PriorityVehicleAlways)], 1], true ] call CBA_fnc_addSetting; @@ -57,16 +57,6 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; -//Enable Arsenal Medical category -[ - QGVAR(arsenalMedCategory), - "CHECKBOX", - [LLSTRING(SETTING_arsenalMedCategory), LLSTRING(SETTING_arsenalMedCategory_Desc)], - [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], - [true], - true -] call CBA_Settings_fnc_init; - //Adjust armband sling left arm (x, y, z) [ QGVAR(armbandSlingLeftArm), @@ -147,12 +137,4 @@ PREP_RECOMPILE_END; 2 ] call CBA_Settings_fnc_init; -if (GVAR(arsenalMedCategory)) then { - [ - ["kat_aatKit","kat_ncdKit","kat_accuvac","ACE_adenosine","ACE_epinephrine","kat_X_AED","ACE_elasticBandage","ACE_packingBandage","kat_crossPanel","kat_bloodIV_O","kat_bloodIV_A","kat_bloodIV_AB","ACE_bloodIV","kat_bloodIV_B","ACE_bloodIV_250","kat_bloodIV_O_250","kat_bloodIV_A_250","kat_bloodIV_AB_250","kat_bloodIV_B_250","ACE_bloodIV_500","kat_bloodIV_O_500","kat_bloodIV_A_500","kat_bloodIV_AB_500","kat_bloodIV_B_500","ACE_bodyBag","KAT_Empty_bloodIV_250","KAT_Empty_bloodIV_500","kat_bloodIV_O_N","kat_bloodIV_A_N","kat_bloodIV_AB_N","kat_bloodIV_B_N","kat_bloodIV_O_N_250","kat_bloodIV_A_N_250","kat_bloodIV_AB_N_250","kat_bloodIV_B_N_250","kat_bloodIV_O_N_500","kat_bloodIV_A_N_500","kat_bloodIV_AB_N_500","kat_bloodIV_B_N_500","FirstAidKit","kat_AED","kat_chestSeal","kat_larynx","ACE_fieldDressing","Medikit","ACE_morphine","kat_guedel","ACE_personalAidKit","ACE_plasmaIV","ACE_plasmaIV_250","ACE_plasmaIV_500","kat_Pulseoximeter","ACE_quikclot","ACE_salineIV_250","ACE_salineIV","ACE_salineIV_500","ACE_splint","kat_stethoscope","ACE_surgicalKit","ACE_tourniquet","Attachable_Helistretcher","kat_CarbonateItem","kat_PainkillerItem","kat_PervitinItem","kat_CaffeineItem","kat_PenthroxItem","kat_IV_16","kat_IO_FAST","kat_naloxone","kat_EACA","kat_TXA","kat_norepinephrine","kat_phenylephrine","kat_nitroglycerin","kat_amiodarone","kat_lidocaine","kat_atropine","kat_ketamine","kat_fentanyl","kat_nalbuphine","kat_lorazepam","kat_flumazenil","kat_etomidate","kat_scalpel","kat_retractor","kat_clamp","kat_plate","kat_vacuum","kat_BVM","kat_pocketBVM","kat_oxygenTank_150_Item","kat_oxygenTank_300_Item","kat_oxygenTank_150_Empty","kat_oxygenTank_300_Empty"], - localize "STR_ACE_Medical_GUI_Medical", - "\z\ace\addons\medical_gui\data\categories\triage_card.paa" - ] call ACEFUNC(arsenal,addRightPanelButton); -}; - ADDON = true; diff --git a/addons/misc/functions/fnc_carryObject.sqf b/addons/misc/functions/fnc_carryObject.sqf index fbdd2a71e..f32e8225e 100644 --- a/addons/misc/functions/fnc_carryObject.sqf +++ b/addons/misc/functions/fnc_carryObject.sqf @@ -1,7 +1,8 @@ #include "script_component.hpp" /* * Author: commy2 - * Carry an object. + * Modified: Blue + * Handles attaching and setting up a carried object. Called from ace_dragging_fnc_startCarryPFH. * * Arguments: * 0: Unit that should do the carrying @@ -19,65 +20,59 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); -// get attachTo offset and direction. - +// Get attachTo offset and direction private _position = _target getVariable [QACEGVAR(dragging,carryPosition), [0, 0, 0]]; private _direction = _target getVariable [QACEGVAR(dragging,carryDirection), 0]; -// handle objects vs persons +// Handle objects vs. persons if (_target isKindOf "CAManBase") then { - [_unit, "AcinPercMstpSnonWnonDnon", 2] call ACEFUNC(common,doAnimation); [_target, "AinjPfalMstpSnonWnonDf_carried_dead", 2] call ACEFUNC(common,doAnimation); - // attach person + // Attach person _target attachTo [_unit, _position, "LeftShoulder"]; if !(IS_UNCONSCIOUS(_target)) then { [QGVAR(stopCarryingPrompt), [_target, _unit], _target] call CBA_fnc_targetEvent; }; } else { - - // add height offset of model - private _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); + // Add height offset of model + private _offset = ((_target modelToWorldVisual [0, 0, 0]) select 2) - ((_unit modelToWorldVisual [0, 0, 0]) select 2); _position = _position vectorAdd [0, 0, _offset]; - // attach object + // Attach object _target attachTo [_unit, _position]; }; + [QACEGVAR(common,setDir), [_target, _direction], _target] call CBA_fnc_targetEvent; _unit setVariable [QACEGVAR(dragging,isCarrying), true, true]; _unit setVariable [QACEGVAR(dragging,carriedObject), _target, true]; -// add drop action -_unit setVariable [QACEGVAR(dragging,ReleaseActionID), [ +// Add drop action +_unit setVariable [QACEGVAR(dragging,releaseActionID), [ _unit, "DefaultAction", {!isNull ((_this select 0) getVariable [QACEGVAR(dragging,carriedObject), objNull])}, - {[_this select 0, (_this select 0) getVariable [QACEGVAR(dragging,carriedObject), objNull]] call ACEFUNC(dragging,dropObject_carry)} + {[_this select 0, (_this select 0) getVariable [QACEGVAR(dragging,carriedObject), objNull], true] call ACEFUNC(dragging,dropObject_carry)} ] call ACEFUNC(common,addActionEventHandler)]; -// add anim changed EH +// Add anim changed EH [_unit, "AnimChanged", ACEFUNC(dragging,handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; -// show mouse hint -if (_target isKindOf "CAManBase") then { - [localize ACELSTRING(dragging,Drop), "", ""] call ACEFUNC(interaction,showMouseHint); -} else { - [localize ACELSTRING(dragging,Drop), "", localize ACELSTRING(dragging,RaiseLowerRotate)] call ACEFUNC(interaction,showMouseHint); -}; - -// check everything +// Check everything [ACEFUNC(dragging,carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler; -// reset current dragging height. +// Reset current dragging height ACEGVAR(dragging,currentHeightChange) = 0; -// prevent UAVs from firing +// Prevent UAVs from firing private _UAVCrew = _target call ACEFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { - {_target deleteVehicleCrew _x} count _UAVCrew; + { + _target deleteVehicleCrew _x; + } forEach _UAVCrew; + _target setVariable [QACEGVAR(dragging,isUAV), true, true]; -}; +}; \ No newline at end of file diff --git a/addons/misc/functions/fnc_fullHealLocal.sqf b/addons/misc/functions/fnc_fullHealLocal.sqf index 9a6fc04f1..02d312907 100644 --- a/addons/misc/functions/fnc_fullHealLocal.sqf +++ b/addons/misc/functions/fnc_fullHealLocal.sqf @@ -2,7 +2,7 @@ /* * Author: Glowbal * Edit: Tomcat --> added heal of airway damage - * Local callback for fully healing a patient. + * Local callback for fully healing a patient. * * Arguments: * 0: Patient @@ -61,9 +61,9 @@ _unit setVariable [QACEGVAR(medical,tourniquets), [0,0,0,0,0,0], true]; _unit setVariable [QACEGVAR(medical_treatment,occludedMedications), nil, true]; // Wounds and Injuries -_unit setVariable [QACEGVAR(medical,openWounds), [], true]; -_unit setVariable [QACEGVAR(medical,bandagedWounds), [], true]; -_unit setVariable [QACEGVAR(medical,stitchedWounds), [], true]; +_unit setVariable [VAR_OPEN_WOUNDS, createHashMap, true]; +_unit setVariable [VAR_BANDAGED_WOUNDS, createHashMap, true]; +_unit setVariable [VAR_STITCHED_WOUNDS, createHashMap, true]; _unit setVariable [QACEGVAR(medical,isLimping), false, true]; _unit setVariable [QACEGVAR(medical,fractures), [0,0,0,0,0,0], true]; @@ -117,7 +117,6 @@ _unit setVariable [QEGVAR(pharma,coagulationFactor), 10, true]; //KAT Surgery -_unit setVariable [QEGVAR(surgery,debridement), [0,0,0,0,0,0], true]; _unit setVariable [QEGVAR(surgery,fractures), [0,0,0,0,0,0], true]; _unit setVariable [QEGVAR(surgery,lidocaine), false, true]; _unit setVariable [QEGVAR(surgery,etomidate), false, true]; @@ -158,20 +157,20 @@ _unit setDamage 0; _state = [_unit, ACEGVAR(medical,STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState; TRACE_1("after FullHeal",_state); -/// Clear Stamina & weapon sway +/// Clear Stamina & weapon sway if (ACEGVAR(advanced_fatigue,enabled)) then { - + ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); ["kat_PDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); ["kat_EDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); - ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); - ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); - + // ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); // TODO REWORK OR REMOVE } else { - - _unit enableStamina true; _unit setAnimSpeedCoef 1; _unit setCustomAimCoef 1; - + + if (GVAR(staminaMedication)) then { + _unit enableStamina true; + + }; }; /// Clear chroma effect & camera shake @@ -213,4 +212,4 @@ if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { if (_index != -1) then { ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt _index; }; -}; \ No newline at end of file +}; diff --git a/addons/misc/functions/fnc_handleRespawn.sqf b/addons/misc/functions/fnc_handleRespawn.sqf index 68af53e1a..ed21a8971 100644 --- a/addons/misc/functions/fnc_handleRespawn.sqf +++ b/addons/misc/functions/fnc_handleRespawn.sqf @@ -58,6 +58,8 @@ _unit setVariable [QEGVAR(breathing,usingStethoscope), nil]; // KAT Circulation _unit setVariable ["kat_AEDXPatient_PFH", nil, true]; +_unit setVariable ["kat_AEDXPatient_HR_PFH", nil, true]; +_unit setVariable ["kat_AEDXPatient_PulseOx_PFH", nil, true]; _unit setVariable [QEGVAR(circulation,Defibrillator_Charged), false, true]; _unit setVariable [QEGVAR(circulation,DefibrillatorPads_Connected), false, true]; _unit setVariable [QEGVAR(circulation,AED_X_MedicVitalsMonitor_Connected), false, true]; @@ -105,7 +107,6 @@ _unit setVariable [QEGVAR(pharma,kidneyPressure), false, true]; //KAT Surgery -_unit setVariable [QEGVAR(surgery,debridement), [0,0,0,0,0,0], true]; _unit setVariable [QEGVAR(surgery,fractures), [0,0,0,0,0,0], true]; _unit setVariable [QEGVAR(surgery,lidocaine), false, true]; _unit setVariable [QEGVAR(surgery,etomidate), false, true]; @@ -247,20 +248,20 @@ if (EGVAR(pharma,coagulation)) then { }, 8, [_unit]] call CBA_fnc_addPerFrameHandler; }; -/// Clear Stamina & weapon sway +/// Clear Stamina & weapon sway if (ACEGVAR(advanced_fatigue,enabled)) then { - + ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); ["kat_PDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); ["kat_EDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); - ["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); - ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); - + // ACEGVAR(advanced_fatigue,swayFactor) = EGVAR(pharma,originalSwayFactor); // TODO REWORK OR REMOVE } else { - - _unit enableStamina true; _unit setAnimSpeedCoef 1; _unit setCustomAimCoef 1; - + + if (GVAR(staminaMedication)) then { + _unit enableStamina true; + + }; }; /// Clear chroma effect & camera shake diff --git a/addons/misc/functions/fnc_handleUnconscious.sqf b/addons/misc/functions/fnc_handleUnconscious.sqf index 647c6a797..7c83fc55e 100644 --- a/addons/misc/functions/fnc_handleUnconscious.sqf +++ b/addons/misc/functions/fnc_handleUnconscious.sqf @@ -1,6 +1,7 @@ #include "script_component.hpp" /* * Author: commy2 + * Modified: Blue * Handles consciousness change of a unit while dragging / carrying. * * Arguments: @@ -16,6 +17,7 @@ */ params ["_unit"]; + private _player = ACE_player; if (_player getVariable [QACEGVAR(dragging,isDragging), false]) then { diff --git a/addons/misc/functions/fnc_hasItem.sqf b/addons/misc/functions/fnc_hasItem.sqf index c5cfcb0a7..9673346ff 100644 --- a/addons/misc/functions/fnc_hasItem.sqf +++ b/addons/misc/functions/fnc_hasItem.sqf @@ -1,6 +1,7 @@ #include "script_component.hpp" /* * Author: Glowbal, mharis001 + * Modified: Blue * Checks if one of the given items are present between the medic and patient. * Does not respect the priority defined by the allowSharedEquipment setting. * Will check medic first and then patient if shared equipment is allowed. @@ -35,6 +36,6 @@ private _fnc_checkItems = { _foundItem }; -private _vehicleCondition = (vehicle _medic) != _medic && (vehicle _medic) isEqualTo (vehicle _patient); +private _vehicleCondition = !(isNull (objectParent _medic)) && {(objectParent _medic) isEqualTo (objectParent _patient)}; _medic call _fnc_checkItems || {ACEGVAR(medical_treatment,allowSharedEquipment) != 2 && {_patient call _fnc_checkItems}} || {_vehicleCondition && [(vehicle _medic), true] call _fnc_checkItems && (GVAR(allowSharedVehicleEquipment) in [1,3,4] || (GVAR(allowSharedVehicleEquipment) isEqualTo 2 && _patient != _medic))} \ No newline at end of file diff --git a/addons/misc/functions/fnc_hasStableVitals.sqf b/addons/misc/functions/fnc_hasStableVitals.sqf index adf68e4cc..4e2420062 100644 --- a/addons/misc/functions/fnc_hasStableVitals.sqf +++ b/addons/misc/functions/fnc_hasStableVitals.sqf @@ -18,7 +18,7 @@ params ["_unit"]; private _bloodVolume = GET_BLOOD_VOLUME(_unit); -if (_bloodVolume < 5.1) exitWith { false }; +if (_bloodVolume < ACEGVAR(medical,const_stableVitalsBloodThreshold)) exitWith { false }; if IN_CRDC_ARRST(_unit) exitWith { false }; if (_unit getVariable [QEGVAR(surgery,sedated), false]) exitWith { false }; diff --git a/addons/misc/functions/fnc_treatment.sqf b/addons/misc/functions/fnc_treatment.sqf index 16b179e02..7a94455ff 100644 --- a/addons/misc/functions/fnc_treatment.sqf +++ b/addons/misc/functions/fnc_treatment.sqf @@ -186,7 +186,7 @@ if (_callbackProgress isEqualTo {}) then { ACEFUNC(medical_treatment,treatmentFailure), getText (_config >> "displayNameProgress"), _callbackProgress, - ["isNotInside"] + ["isNotInside", "isNotSwimming"] ] call ACEFUNC(common,progressBar); true diff --git a/addons/misc/functions/fnc_treatmentSuccess.sqf b/addons/misc/functions/fnc_treatmentSuccess.sqf index 2e3d30f1d..0095e5b6c 100644 --- a/addons/misc/functions/fnc_treatmentSuccess.sqf +++ b/addons/misc/functions/fnc_treatmentSuccess.sqf @@ -38,7 +38,7 @@ if (!isNil "_endInAnim") then { [QACEGVAR(common,setAnimSpeedCoef), [_medic, 1]] call CBA_fnc_globalEvent; if (!isNil QACEGVAR(advanced_fatigue,setAnimExclusions)) then { - ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt (ACEGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ACE_ADDON)); + ACEGVAR(advanced_fatigue,setAnimExclusions) deleteAt (ACEGVAR(advanced_fatigue,setAnimExclusions) find QUOTE(ACE_ADDON(medical_treatment))); }; // Call treatment specific success callback diff --git a/addons/misc/functions/fnc_useItem.sqf b/addons/misc/functions/fnc_useItem.sqf index dea549d31..b095e5ce3 100644 --- a/addons/misc/functions/fnc_useItem.sqf +++ b/addons/misc/functions/fnc_useItem.sqf @@ -1,6 +1,7 @@ #include "script_component.hpp" /* * Author: Glowbal, mharis001 + * Modified: Blue * Uses one of the treatment items. Respects the priority defined by the allowSharedEquipment setting. * * Arguments: @@ -24,8 +25,8 @@ scopeName "Main"; private _sharedUseOrder = [[_patient, _medic], [_medic, _patient], [_medic]] select ACEGVAR(medical_treatment,allowSharedEquipment); private _useOrder = []; -private _vehicle = vehicle _medic; -private _vehicleCondition = _vehicle != _medic && _vehicle isEqualTo (vehicle _patient); +private _vehicle = objectParent _medic; +private _vehicleCondition = !(isNull _vehicle) && _vehicle isEqualTo (objectParent _patient); private _vehicleIndex = -1; if (GVAR(allowSharedVehicleEquipment) > 0 && _vehicleCondition) then { diff --git a/addons/misc/functions/script_component.hpp b/addons/misc/functions/script_component.hpp index 9312ed8bf..8d6b209d6 100644 --- a/addons/misc/functions/script_component.hpp +++ b/addons/misc/functions/script_component.hpp @@ -1,22 +1 @@ -#include "\x\kat\addons\misc\script_component.hpp" - -#define VAR_BLOOD_PRESS "ACE_medical_bloodPressure" -#define VAR_BLOOD_VOL "ACE_medical_bloodVolume" -#define VAR_WOUND_BLEEDING "ACE_medical_woundBleeding" -#define VAR_CRDC_ARRST "ACE_medical_inCardiacArrest" -#define VAR_HEART_RATE "ACE_medical_heartRate" -#define VAR_PAIN "ACE_medical_pain" -#define VAR_PAIN_SUPP "ACE_medical_painSuppress" -#define VAR_PERIPH_RES "ACE_medical_peripheralResistance" -#define VAR_UNCON "ACE_isUnconscious" -#define VAR_OPEN_WOUNDS "ACE_medical_openWounds" -#define VAR_BANDAGED_WOUNDS "ACE_medical_bandagedWounds" -#define VAR_STITCHED_WOUNDS "ACE_medical_stitchedWounds" -// These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS "ACE_medical_medications" -// These variables track the current state of status values above -#define VAR_HEMORRHAGE "ACE_medical_hemorrhage" -#define VAR_IN_PAIN "ACE_medical_inPain" -#define VAR_TOURNIQUET "ACE_medical_tourniquets" -#define VAR_FRACTURES "ACE_medical_fractures" -#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"] \ No newline at end of file +#include "\x\kat\addons\misc\script_component.hpp" \ No newline at end of file diff --git a/addons/misc/script_component.hpp b/addons/misc/script_component.hpp index 375860f59..d2181bb4f 100644 --- a/addons/misc/script_component.hpp +++ b/addons/misc/script_component.hpp @@ -16,3 +16,5 @@ #include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #include "\x\kat\addons\main\script_macros.hpp" + +#define MEDICAL_TREATMENT_ITEMS (call (uiNamespace getVariable [QACEGVAR(medical_treatment,treatmentItems), {[]}])) \ No newline at end of file diff --git a/addons/misc/stringtable.xml b/addons/misc/stringtable.xml index 2f167f2c3..8727bf7cb 100644 --- a/addons/misc/stringtable.xml +++ b/addons/misc/stringtable.xml @@ -368,30 +368,6 @@ Čas pro sundání turniketu Tempo per rimuovere il laccio emostatico - - Arsenal Medical category - Zdravotnická kategorie arzenálu - Catégorie médicale pour l'arsenal - 武器庫医療分類 - Categoria médica en Arsenal - Categoria medica nell'Arsenale - Kategoria medyczna w Arsenale - Arsenal Medizin-Kategorie - 아스널 의료 카테고리 - Categoria Médica do Arsenal - - - Enable medical category for arsenal and relocate all medical related items to it? - Povolit zdravotnickou kategorii pro arzenál a přemístit do ní všechny zdravotnické věci? - Active la catégorie médicale pour l'arsenal et y affecte tous les objets médicaux ? - 武器庫の医療分類を有効にして、すべての医療関連アイテムをそこに再配置しますか? - ¿Habilitar la categoría médica para el arsenal y mover todos los elementos médicos a este? - Abilita la categoria medica nell'arsernale e muovi tutti gli oggetti medici in questa categoria? - Włączyć kategorię medyczną dla arsenału i przenieść do niej wszystkie przedmioty związane z medycyną? - Aktiviere Medizin-Kategorie für das Arsenal und verschiebe alle medizinischen Gegenstände dort hin? - 아스널의 의료 카테고리를 활성화하고 모든 의료 관련 아이템을 아스널로 재배치합니까? - Ativar categoria médica para arsenal e realocar todos os itens médicos relacionados a ela? - Stretcher 担架 @@ -867,5 +843,22 @@ Arrêt du transport de %1 %1의 운반 취소함 + + Medical + Zdravotní + Médical + Sanitäter + Medico + Medyczne + Médico + Медик + Médico + Orvosi + 治療 + 의료 + 医疗设定 + 醫療設定 + Medikal + diff --git a/addons/pharma/CfgWeapons.hpp b/addons/pharma/CfgWeapons.hpp index 234fe0b03..17f4d321d 100644 --- a/addons/pharma/CfgWeapons.hpp +++ b/addons/pharma/CfgWeapons.hpp @@ -7,6 +7,7 @@ class CfgWeapons { author = "Katalam"; displayName = CSTRING(Painkillers_Box_Display); picture = QPATHTOF(ui\icon_painkillers.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -16,6 +17,7 @@ class CfgWeapons { author = "Mazinski.H"; displayName = CSTRING(Carbonate_Box_Display); picture = QPATHTOF(ui\icon_Carbonate.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -26,6 +28,7 @@ class CfgWeapons { displayName = CSTRING(Pervitin_Capsule_Display); picture = QPATHTOF(ui\icon_Pervitin.paa); descriptionShort = CSTRING(Pervitin_Capsule_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.1; }; @@ -36,6 +39,7 @@ class CfgWeapons { displayName = CSTRING(Caffeine_Bottle_Display); picture = QPATHTOF(ui\icon_Caffeine.paa); descriptionShort = CSTRING(Caffeine_Bottle_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.1; }; @@ -45,6 +49,7 @@ class CfgWeapons { author = "Blue"; displayName = CSTRING(Penthrox_Display); picture = QPATHTOF(ui\icon_penthrox.paa); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; @@ -58,6 +63,7 @@ class CfgWeapons { hiddenSelections[]={"0"}; hiddenSelectionsMaterials[] = {QPATHTOF(models\iv\kat_iv.rvmat)}; hiddenSelectionsTextures[] = {QPATHTOF(models\iv\kat_iv_co.paa)}; + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -68,6 +74,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_fast_io.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(IO_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -78,6 +85,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Naloxone.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Naloxone_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -88,6 +96,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_TXA.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(EACA_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.2; }; @@ -98,6 +107,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_TXA.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(TXA_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -108,6 +118,7 @@ class CfgWeapons { picture = QPATHTOF(ui\norep.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Norep_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -118,6 +129,7 @@ class CfgWeapons { picture = QPATHTOF(ui\phen.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Phenyl_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -128,6 +140,7 @@ class CfgWeapons { picture = QPATHTOF(ui\nitro.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Nitro_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -138,6 +151,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Amiodarone.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Amiodarone_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -148,6 +162,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Lidocaine.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Lidocaine_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -158,6 +173,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Atropine.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Atropine_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -168,6 +184,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Ketamine.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Ketamine_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -178,6 +195,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Fentanyl.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Fentanyl_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -188,6 +206,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_Nalbuphine.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Nalbuphine_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -198,6 +217,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_lorazepam.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Lorazepam_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.2; }; @@ -208,6 +228,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_flumazenil.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Flumazenil_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.2; }; @@ -218,6 +239,7 @@ class CfgWeapons { picture = QPATHTOF(ui\icon_etomidate.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Etomidate_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.2; }; diff --git a/addons/pharma/XEH_postInit.sqf b/addons/pharma/XEH_postInit.sqf index 5adb434be..d52a0830e 100644 --- a/addons/pharma/XEH_postInit.sqf +++ b/addons/pharma/XEH_postInit.sqf @@ -28,27 +28,19 @@ ["ace_treatmentSucceded", { params ["_medic", "_patient", "_bodyPart", "_classname"]; + if (!(GVAR(staminaMedication)) || ACE_Player != _patient || !(alive _patient)) exitWith {}; + if (_classname == "Epinephrine") then { - - if (ACE_Player != _patient) exitWith {}; if (ACEGVAR(advanced_fatigue,enabled)) then { - params ["_patient"]; - if !(alive _patient) exitWith {}; ACEGVAR(advanced_fatigue,anReserve) = ACEGVAR(advanced_fatigue,anReserve) + 300; ["kat_EDF", 0.5] call ACEFUNC(advanced_fatigue,addDutyFactor); [{ params ["_patient"]; ["kat_EDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor); - }, - [_patient], - 120] call CBA_fnc_waitAndExecute; + }, [_patient], 120] call CBA_fnc_waitAndExecute; } else { - - params ["_patient"]; - - if !(alive _patient) exitWith {}; _defaultAnimSpeed = getAnimSpeedCoef _patient; _patient setAnimSpeedCoef (_defaultAnimSpeed * 1.25); _patient setStamina 180; @@ -56,9 +48,7 @@ [{ params ["_patient", "_defaultAnimSpeed"]; _patient setAnimSpeedCoef _defaultAnimSpeed; - }, - [_patient, _defaultAnimSpeed], - 120] call CBA_fnc_waitAndExecute; + },[_patient, _defaultAnimSpeed], 120] call CBA_fnc_waitAndExecute; }; }; }] call CBA_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/pharma/XEH_preInit.sqf b/addons/pharma/XEH_preInit.sqf index d3479d4d3..8e62f2d96 100644 --- a/addons/pharma/XEH_preInit.sqf +++ b/addons/pharma/XEH_preInit.sqf @@ -144,7 +144,7 @@ PREP_RECOMPILE_END; "SLIDER", LLSTRING(SETTING_reorientationChance), [CBA_SETTINGS_CAT, LSTRING(SubCategory_Reorientation)], - [0, 100, 100, 0], + [0, 100, 50, 0], true ] call CBA_Settings_fnc_init; @@ -600,4 +600,13 @@ PREP_RECOMPILE_END; true ] call CBA_Settings_fnc_init; +[ + QGVAR(staminaMedication), + "CHECKBOX", + [LLSTRING(SETTING_staminaMedication), LLSTRING(SETTING_staminaMedication_DESC)], + CBA_SETTINGS_CAT, + [false], + true +] call CBA_Settings_fnc_init; + ADDON = true; diff --git a/addons/pharma/functions/fnc_init.sqf b/addons/pharma/functions/fnc_init.sqf index af179065d..c572f2a73 100644 --- a/addons/pharma/functions/fnc_init.sqf +++ b/addons/pharma/functions/fnc_init.sqf @@ -33,8 +33,6 @@ _unit setVariable [QGVAR(IVpfh), [0,0,0,0,0,0], true]; _unit setVariable [QGVAR(active), false, true]; _unit setVariable [QGVAR(alphaAction), 1]; -_unit setVariable [QGVAR(TXA), 1, true]; - _unit setVariable [QGVAR(pH), 1500, true]; _unit setVariable [QGVAR(coagulationFactor), 10, true]; _unit setVariable [QGVAR(kidneyFail), false, true]; @@ -141,25 +139,27 @@ if (GVAR(coagulation)) then { if (_count == 0) exitWith { { - _x params ["", "_bodyPart", "_amount", "_bleeding"]; - - if (_amount * _bleeding > 0) exitWith { - private _part = ALL_BODY_PARTS select _bodyPart; - [QACEGVAR(medical_treatment,bandageLocal), [_unit, _part, "UnstableClot"], _unit] call CBA_fnc_targetEvent; - _unit setVariable [QGVAR(coagulationFactor), (_coagulationFactor - 1), true]; - }; + private _part = _x; + { + _x params ["", "_amountOf", "_bleeding"]; + if (_amountOf * _bleeding > 0) exitWith { + [QACEGVAR(medical_treatment,bandageLocal), [_unit, _part, "UnstableClot"], _unit] call CBA_fnc_targetEvent; + _unit setVariable [QGVAR(coagulationFactor), (_coagulationFactor - 1), true]; + }; + } forEach _y; } forEach _openWounds; }; if (_count > 0) exitWith { { - _x params ["", "_bodyPart", "_amount", "_bleeding"]; - - if (_amount * _bleeding > 0) exitWith { - private _part = ALL_BODY_PARTS select _bodyPart; - [QACEGVAR(medical_treatment,bandageLocal), [_unit, _part, "PackingBandage"], _unit] call CBA_fnc_targetEvent; - _unit setVariable [QGVAR(coagulationFactor), (_coagulationFactor - 1), true]; - }; + private _part = _x; + { + _x params ["", "_amountOf", "_bleeding"]; + if (_amountOf * _bleeding > 0) exitWith { + [QACEGVAR(medical_treatment,bandageLocal), [_unit, _part, "PackingBandage"], _unit] call CBA_fnc_targetEvent; + _unit setVariable [QGVAR(coagulationFactor), (_coagulationFactor - 1), true]; + }; + } forEach _y; } forEach _openWounds; }; }, 8, [_unit]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateLocal.sqf index 237688ec7..a111bf7fd 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_CarbonateLocal.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" /* - * Author: Mazinski.H + * Author: Mazinski.H, Blue * Checks for Carbonate Wakeup values to restore consciousness * * Arguments: @@ -24,6 +24,6 @@ if (_sedated) exitWith {}; private _bloodPressure = GET_BLOOD_PRESSURE(_patient); _bloodPressureH = _bloodPressure select 1; -if (_bloodPressureH >= 100 && _bloodPressureH <= 140 && (random 100 <= GVAR(carbonateChance)) && {[_patient] call EFUNC(misc,hasStableVitals)} ) then { +if ((floor (random 100) < ((linearConversion [50, 100, _bloodPressureH, 0, GVAR(carbonateChance), true]) min (linearConversion [140, 200, _bloodPressureH, GVAR(carbonateChance), 0, true]))) && {[_patient] call EFUNC(misc,hasStableVitals)}) then { [_patient, false] call ACEFUNC(medical,setUnconscious); }; \ No newline at end of file diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf index 0f15ba217..1f8ed2193 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_EACALocal.sqf @@ -16,7 +16,7 @@ * Public: No */ -params ["_patient","_bodyPart"]; +params ["_patient", "_bodyPart"]; private _partIndex = ALL_BODY_PARTS find toLower _bodyPart; private _IVarray = _patient getVariable [QGVAR(IV), [0,0,0,0,0,0]]; @@ -42,38 +42,49 @@ if (_IVactual > 1) then { params ["_args", "_idPFH"]; _args params ["_patient"]; - private _stitchableWounds = _patient call ACEFUNC(medical_treatment,getStitchableWounds); + private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); private _alive = alive _patient; - - if ((!_alive) || (_stitchableWounds isEqualTo [])) exitWith { - [_idPFH] call CBA_fnc_removePerFrameHandler; - }; + private _exit = true; private _random = random 750; private _ph = (_patient getVariable [QGVAR(pH), 1500]) - 750; if (_random <= _ph) then { - private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); - private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); - - private _treatedWound = _bandagedWounds deleteAt (_bandagedWounds find (_stitchableWounds select 0)); - _treatedWound params ["_treatedID", "_treatedBodyPartN", "_treatedAmountOf"]; - - private _woundIndex = _stitchedWounds findIf { - _x params ["_classID", "_bodyPartN"]; - - _classID == _treatedID && {_bodyPartN == _treatedBodyPartN} - }; - - if (_woundIndex == -1) then { - _stitchedWounds pushBack _treatedWound; - } else { - private _wound = _stitchedWounds select _woundIndex; - _wound set [2, (_wound select 2) + _treatedAmountOf]; - }; + { + private _part = _x; + if ([_patient,_x] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) then { + continue; + }; + { + _x params ["_classID", "_amountOf", "", "_damageOf"]; + private _bandagedWoundsOnPart = _bandagedWounds get _part; + private _treatedWound = _bandagedWoundsOnPart deleteAt (count _bandagedWoundsOnPart - 1); + _treatedWound params ["_treatedID", "_treatedAmountOf", "", "_treatedDamageOf"]; + + private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); + private _stitchedWoundsOnPart = _stitchedWounds getOrDefault [_part, [], true]; + + private _woundIndex = _stitchedWoundsOnPart findIf { + _x params ["_classID"]; + _classID == _treatedID + }; + + if (_woundIndex == -1) then { + _stitchedWoundsOnPart pushBack _treatedWound; + } else { + private _wound = _stitchedWoundsOnPart select _woundIndex; + _wound set [1, (_wound select 1) + _treatedAmountOf]; + }; + + _patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; + _patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; + _exit = false; + } forEach _y; + } forEach _bandagedWounds; + }; - _patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; - _patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; + if ((!_alive) || (_exit)) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }, 6, [_patient]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf index 14431ab52..5c11543db 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_PervitinLocal.sqf @@ -102,7 +102,7 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { /// ACE Fatigue Weapon Sway - if (GVAR(weapon_sway_pervitin)) then { + /*if (GVAR(weapon_sway_pervitin)) then { // TODO REWORK OR REMOVE if (isNil GVAR(originalSwayFactor)) then { GVAR(originalSwayFactor) = ACEGVAR(advanced_fatigue,swayFactor); @@ -194,7 +194,7 @@ if (ACEGVAR(advanced_fatigue,enabled)) then { ACEGVAR(advanced_fatigue,swayFactor) = GVAR(originalSwayFactor); }, [_patient], 540] call CBA_fnc_waitAndExecute; /// 9m - }; + };*/ } else { /// Normal Stamina & Weapon Sway diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_ReorientationLocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_ReorientationLocal.sqf index db69a5570..4512611bf 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_ReorientationLocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_ReorientationLocal.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" /* - * Author: Mazinski.H + * Author: Mazinski.H, Blue * Checks for Reorientation Wakeup values to restore consciousness * * Arguments: @@ -20,7 +20,7 @@ params ["_medic", "_patient"]; private _pulse = GET_HEART_RATE(_patient); -if (_pulse >= 70 && _pulse <= 100 && (random 100 <= GVAR(reorientationChance)) && {[_patient] call EFUNC(misc,hasStableVitals)}) then { +if ((floor (random 100) < ((linearConversion [40, 79, _pulse, 0, GVAR(reorientationChance), true]) min (linearConversion [80, 220, _pulse, GVAR(reorientationChance), 0, true]))) && {[_patient] call EFUNC(misc,hasStableVitals)}) then { [_patient, false] call ACEFUNC(medical,setUnconscious); _output = LLSTRING(ReorientingSuccess); [_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured); diff --git a/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf b/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf index 55c4e66f6..5d45ab855 100644 --- a/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf +++ b/addons/pharma/functions/fnc_treatmentAdvanced_TXALocal.sqf @@ -57,13 +57,17 @@ if !(GVAR(coagulation)) then { if (_random <= _ph) then { { - _x params ["", "_bodyPart", "_amount", "_bleeding"]; - - if (_amount * _bleeding > 0) exitWith { - private _part = ALL_BODY_PARTS select _bodyPart; - [QACEGVAR(medical_treatment,bandageLocal), [_patient, _part, "PackingBandage"], _patient] call CBA_fnc_targetEvent; - _exit = false; + private _part = _x; + if ([_patient,_x] call ACEFUNC(medical_treatment,hasTourniquetAppliedTo)) then { + continue; }; + { + _x params ["", "_amountOf", "_bleeding"]; + if (_amountOf * _bleeding > 0) exitWith { + [QACEGVAR(medical_treatment,bandageLocal), [_patient, _part, "PackingBandage"], _patient] call CBA_fnc_targetEvent; + _exit = false; + }; + } forEach _y; } forEach _openWounds; }; diff --git a/addons/pharma/functions/script_component.hpp b/addons/pharma/functions/script_component.hpp index 58d434200..67f788f07 100644 --- a/addons/pharma/functions/script_component.hpp +++ b/addons/pharma/functions/script_component.hpp @@ -1,22 +1 @@ -#include "\x\kat\addons\pharma\script_component.hpp" - -#define VAR_BLOOD_PRESS "ACE_medical_bloodPressure" -#define VAR_BLOOD_VOL "ACE_medical_bloodVolume" -#define VAR_WOUND_BLEEDING "ACE_medical_woundBleeding" -#define VAR_CRDC_ARRST "ACE_medical_inCardiacArrest" -#define VAR_HEART_RATE "ACE_medical_heartRate" -#define VAR_PAIN "ACE_medical_pain" -#define VAR_PAIN_SUPP "ACE_medical_painSuppress" -#define VAR_PERIPH_RES "ACE_medical_peripheralResistance" -#define VAR_UNCON "ACE_isUnconscious" -#define VAR_OPEN_WOUNDS "ACE_medical_openWounds" -#define VAR_BANDAGED_WOUNDS "ACE_medical_bandagedWounds" -#define VAR_STITCHED_WOUNDS "ACE_medical_stitchedWounds" -// These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS "ACE_medical_medications" -// These variables track the current state of status values above -#define VAR_HEMORRHAGE "ACE_medical_hemorrhage" -#define VAR_IN_PAIN "ACE_medical_inPain" -#define VAR_TOURNIQUET "ACE_medical_tourniquets" -#define VAR_FRACTURES "ACE_medical_fractures" -#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"] \ No newline at end of file +#include "\x\kat\addons\pharma\script_component.hpp" \ No newline at end of file diff --git a/addons/pharma/stringtable.xml b/addons/pharma/stringtable.xml index e6465ecff..4885688f1 100644 --- a/addons/pharma/stringtable.xml +++ b/addons/pharma/stringtable.xml @@ -1611,7 +1611,7 @@ Suprime a dor - Chance for succesful reorientation + Maximum Reorientation Success Chance Szansa na pomyślne ocucenie 成功进行恢复体态的几率 Possibilità di un riorientamento riuscito @@ -1624,7 +1624,7 @@ Chance de reorientação bem-sucedida - Chance for succesful Carbonate use + Maximum Carbonate Success Chance Szansa na pomyślne użycie soli trzeźwiących 成功使用碳酸盐的几率 Possibilità di utilizzare con successo il carbonato @@ -2832,5 +2832,11 @@ [KAM] Caixa de medicamentos [KAM] Caja de medicina + + Medication Modifies Stamina + + + Allow certain medications to modify (vanilla/advanced fatigue) stamina as a side effect + diff --git a/addons/surgery/ACE_Medical_Treatment_Actions.hpp b/addons/surgery/ACE_Medical_Treatment_Actions.hpp index 548d59e09..d58641c7d 100644 --- a/addons/surgery/ACE_Medical_Treatment_Actions.hpp +++ b/addons/surgery/ACE_Medical_Treatment_Actions.hpp @@ -96,26 +96,20 @@ class ACE_Medical_Treatment_Actions { condition = QUOTE([ARR_4(_medic, _patient, _bodyPart, 2.3)] call FUNC(openReductionCheck)); callbackSuccess = QUOTE([ARR_4(_medic, _patient, _bodyPart, 2.3)] call FUNC(openReductionProgress)); }; - class Debridement: BasicBandage { - displayName = CSTRING(Debride_Use); - displayNameProgress = CSTRING(Debride_Action); + class NPWT: BasicBandage { + displayName = CSTRING(Vacuum_Use); + displayNameProgress = CSTRING(Vacuum_Action); + condition = QFUNC(canNPWT); category = "surgery"; - treatmentLocations = QGVAR(debridementAction_Location); allowedSelections[] = {"All"}; allowSelfTreatment = 0; + treatmentLocations = QGVAR(debridementAction_Location); + treatmentTime = QFUNC(getNPWTTime); medicRequired = QGVAR(debridementAction_MedLevel); - treatmentTime = QGVAR(debrideTime); - items[] = {"kat_scalpel"}; - condition = QFUNC(debridementCheck); - consumeItem = 0; - callbackSuccess = QFUNC(debridement); - }; - class NPWT: Debridement { - displayName = CSTRING(Vacuum_Use); - displayNameProgress = CSTRING(Vacuum_Action); - treatmentTime = QGVAR(npwtTime); items[] = {"kat_vacuum"}; sounds[] = {{QPATHTO_R(sounds\vacuum.ogg),8,1,15}}; - callbackSuccess = QFUNC(npwtTreatment); + consumeItem = 0; + callbackProgress = QFUNC(npwtTreatmentProgress); + callbackSuccess = ""; }; }; diff --git a/addons/surgery/CfgWeapons.hpp b/addons/surgery/CfgWeapons.hpp index 2f250c2bf..9d6c5b065 100644 --- a/addons/surgery/CfgWeapons.hpp +++ b/addons/surgery/CfgWeapons.hpp @@ -8,6 +8,7 @@ class CfgWeapons { picture = QPATHTOF(ui\scalpel.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Scalpel_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.2; }; @@ -18,6 +19,7 @@ class CfgWeapons { picture = QPATHTOF(ui\retractor.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Retractor_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -28,6 +30,7 @@ class CfgWeapons { picture = QPATHTOF(ui\clamp.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Clamp_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.5; }; @@ -38,6 +41,7 @@ class CfgWeapons { picture = QPATHTOF(ui\plate.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Plate_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0.3; }; @@ -48,6 +52,7 @@ class CfgWeapons { picture = QPATHTOF(ui\vacuum.paa); model = "\A3\Structures_F_EPA\Items\Medical\Painkillers_F.p3d"; descriptionShort = CSTRING(Vacuum_DescShort); + ACE_isMedicalItem = 1; class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; diff --git a/addons/surgery/XEH_PREP.hpp b/addons/surgery/XEH_PREP.hpp index 4fc333d84..ab21c7209 100644 --- a/addons/surgery/XEH_PREP.hpp +++ b/addons/surgery/XEH_PREP.hpp @@ -1,16 +1,14 @@ +PREP(canNPWT); PREP(closedReduction); PREP(closedReductionLocal); -PREP(debridement); -PREP(debridementCheck); -PREP(debridementLocal); PREP(fractureCheck); PREP(fractureSelect); PREP(fractureSelectLocal); +PREP(getNPWTTime); PREP(incision); PREP(incisionLocal); PREP(init); -PREP(npwtTreatment); -PREP(npwtTreatmentLocal); +PREP(npwtTreatmentProgress); PREP(openReduction); PREP(openReductionCheck); PREP(openReductionLocal); diff --git a/addons/surgery/XEH_postInit.sqf b/addons/surgery/XEH_postInit.sqf index 57c9f4461..61d7f32bd 100644 --- a/addons/surgery/XEH_postInit.sqf +++ b/addons/surgery/XEH_postInit.sqf @@ -5,5 +5,3 @@ [QGVAR(openReduction), LINKFUNC(openReductionLocal)] call CBA_fnc_addEventHandler; [QGVAR(incision), LINKFUNC(incisionLocal)] call CBA_fnc_addEventHandler; [QGVAR(openReductionProgress), LINKFUNC(openReductionProgressLocal)] call CBA_fnc_addEventHandler; -[QGVAR(debridement), LINKFUNC(debridementLocal)] call CBA_fnc_addEventHandler; -[QGVAR(NPWT), LINKFUNC(npwtTreatmentLocal)] call CBA_fnc_addEventHandler; diff --git a/addons/surgery/XEH_preInit.sqf b/addons/surgery/XEH_preInit.sqf index 5c9edba69..3bc57e2be 100644 --- a/addons/surgery/XEH_preInit.sqf +++ b/addons/surgery/XEH_preInit.sqf @@ -167,11 +167,11 @@ PREP_RECOMPILE_END; // Sets time to debride a patient [ - QGVAR(debrideTime), + QGVAR(woundDebrideTime), "SLIDER", LLSTRING(SETTING_DebrideTime), [CBA_SETTINGS_CAT, LSTRING(SubCategory_SurgicalActions)], - [0,100,20,0], + [0.1, 60, 5, 1], true ] call CBA_Settings_fnc_init; @@ -181,7 +181,7 @@ PREP_RECOMPILE_END; "SLIDER", LLSTRING(SETTING_NPWTTime), [CBA_SETTINGS_CAT, LSTRING(SubCategory_SurgicalActions)], - [0,100,20,0], + [0.1, 60, 5, 1], true ] call CBA_Settings_fnc_init; diff --git a/addons/surgery/functions/fnc_canNPWT.sqf b/addons/surgery/functions/fnc_canNPWT.sqf new file mode 100644 index 000000000..1ff22b18d --- /dev/null +++ b/addons/surgery/functions/fnc_canNPWT.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: MiszczuZPolski + * Check if patient's body part can be healed by NPWT + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * Can use NPWT + * + * Example: + * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_canNPWT + * + * Public: No + */ + +params ["_medic", "_patient", "_bodyPart"]; + +((GET_BANDAGED_WOUNDS(_patient) getOrDefault [_bodyPart, []]) isNotEqualTo []) +||((GET_OPEN_WOUNDS(_patient) getOrDefault [_bodyPart, []]) isNotEqualTo []) diff --git a/addons/surgery/functions/fnc_debridement.sqf b/addons/surgery/functions/fnc_debridement.sqf deleted file mode 100644 index 501eadebf..000000000 --- a/addons/surgery/functions/fnc_debridement.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" -/* - * Author: 1LT.Mazinski.H - * Clears all open wounds on a patient. - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * Nothing - * - * Example: - * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_debridement - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -[QGVAR(debridement), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; diff --git a/addons/surgery/functions/fnc_debridementCheck.sqf b/addons/surgery/functions/fnc_debridementCheck.sqf deleted file mode 100644 index eefd93352..000000000 --- a/addons/surgery/functions/fnc_debridementCheck.sqf +++ /dev/null @@ -1,59 +0,0 @@ -#include "script_component.hpp" -/* - * Author: 1LT.Mazinski.H - * Checks if debridement can be performed - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * Can Perform Debridement - * - * Example: - * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_debridementCheck; - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -private _debridement = _patient getVariable [QGVAR(debridement), [0,0,0,0,0,0]]; -private _compare = ALL_BODY_PARTS find toLower _bodyPart; -private _check = false; - -{ - _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; - - if (_bodyPartN == _compare && (_amountOf > 0)) exitWith { - _check = true; - }; - -} forEach GET_STITCHED_WOUNDS(_patient); - -if (_check) exitWith {true}; - -{ - _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; - - if (_bodyPartN == _compare && (_amountOf > 0)) exitWith { - _check = true; - }; - -} forEach GET_BANDAGED_WOUNDS(_patient); - -if (_check) exitWith {true}; - -{ - _x params ["", "_bodyPartN", "_amountOf", "_bleeding"]; - - if (_bodyPartN == _compare && (_amountOf > 0)) exitWith { - _check = true; - }; - -} forEach GET_OPEN_WOUNDS(_patient); - -if (_check) exitWith {true}; - -false diff --git a/addons/surgery/functions/fnc_debridementLocal.sqf b/addons/surgery/functions/fnc_debridementLocal.sqf deleted file mode 100644 index 70e1fb021..000000000 --- a/addons/surgery/functions/fnc_debridementLocal.sqf +++ /dev/null @@ -1,48 +0,0 @@ -#include "script_component.hpp" -/* - * Author: 2LT.Mazinski - * Local call for clearing all open wounds on a patient - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * None - * - * Example: - * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_debridementLocal; - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart2"]; - -private _debridement = _patient getVariable [QGVAR(debridement), [0,0,0,0,0,0]]; -private _compare = ALL_BODY_PARTS find toLower _bodyPart2; - -_debridement set [_compare, 1]; -_patient setVariable [QGVAR(debridement), _debridement, true]; - -{ - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart == _compare) then { - [QACEGVAR(medical_treatment,bandageLocal), [_patient, _bodyPart2, "Dressing"], _patient] call CBA_fnc_targetEvent; - }; - -} forEach GET_OPEN_WOUNDS(_patient); - -{ - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart == _compare) then { - [QACEGVAR(medical_treatment,bandageLocal), [_patient, _bodyPart2, "Dressing"], _patient] call CBA_fnc_targetEvent; - }; - -} forEach GET_BANDAGED_WOUNDS(_patient); - -[_patient] call ACEFUNC(medical_engine,updateDamageEffects); -[_patient] call ACEFUNC(medical_engine,updateWoundBleedLoss); - diff --git a/addons/surgery/functions/fnc_fractureSelectLocal.sqf b/addons/surgery/functions/fnc_fractureSelectLocal.sqf index 0f11be73e..67e294e0a 100644 --- a/addons/surgery/functions/fnc_fractureSelectLocal.sqf +++ b/addons/surgery/functions/fnc_fractureSelectLocal.sqf @@ -57,4 +57,3 @@ if (random 100 <= GVAR(simpleChance)) then { _fractureArray set [_part, _liveFracture]; _patient setVariable [QGVAR(fractures), _fractureArray, true]; - diff --git a/addons/surgery/functions/fnc_getNPWTTime.sqf b/addons/surgery/functions/fnc_getNPWTTime.sqf new file mode 100644 index 000000000..d0026f91c --- /dev/null +++ b/addons/surgery/functions/fnc_getNPWTTime.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" +/* + * Author: MiszczuZPolski + * Calculates the Debride treatment time based on the amount of debridable wounds. + * + * Arguments: + * 0: Medic (not used) + * 1: Patient + * 2: Body Part + * + * Return Value: + * Treatment Time + * + * Example: + * [player, cursorObject, "head"] call kat_surgery_fnc_getDebrideTime + * + * Public: No + */ + +params ["", "_patient", "_bodyPart"]; + +(count (GET_BANDAGED_WOUNDS(_patient) getOrDefault [_bodyPart, []]) * GVAR(npwtTime)) + +(count (GET_OPEN_WOUNDS(_patient) getOrDefault [_bodyPart, []]) * GVAR(npwtTime)) diff --git a/addons/surgery/functions/fnc_init.sqf b/addons/surgery/functions/fnc_init.sqf index 0eb108f94..ec9cc8e5d 100644 --- a/addons/surgery/functions/fnc_init.sqf +++ b/addons/surgery/functions/fnc_init.sqf @@ -19,7 +19,6 @@ params ["_unit", ["_isRespawn", true]]; if (!local _unit) exitWith {}; -_unit setVariable [QGVAR(debridement), [0,0,0,0,0,0], true]; _unit setVariable [QGVAR(fractures), [0,0,0,0,0,0], true]; _unit setVariable [QGVAR(lidocaine), false, true]; _unit setVariable [QGVAR(etomidate), false, true]; diff --git a/addons/surgery/functions/fnc_npwtTreatment.sqf b/addons/surgery/functions/fnc_npwtTreatment.sqf deleted file mode 100644 index 540f86f5c..000000000 --- a/addons/surgery/functions/fnc_npwtTreatment.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "script_component.hpp" -/* - * Author: 1LT.Mazinski.H - * Clears all stitched wounds on a patient - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * Nothing - * - * Example: - * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_npwtTreatment - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -[QGVAR(NPWT), [_medic, _patient, _bodyPart], _patient] call CBA_fnc_targetEvent; \ No newline at end of file diff --git a/addons/surgery/functions/fnc_npwtTreatmentLocal.sqf b/addons/surgery/functions/fnc_npwtTreatmentLocal.sqf deleted file mode 100644 index 55ce79e09..000000000 --- a/addons/surgery/functions/fnc_npwtTreatmentLocal.sqf +++ /dev/null @@ -1,114 +0,0 @@ -#include "script_component.hpp" -/* - * Author: 1LT.Mazinski.H - * Local call for clearing all stitched and bandaged wounds on a patient - * - * Arguments: - * 0: Medic - * 1: Patient - * 2: Body Part - * - * Return Value: - * None - * - * Example: - * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_npwtTreatmentLocal; - * - * Public: No - */ - -params ["_medic", "_patient", "_bodyPart"]; - -private _part = ALL_BODY_PARTS find toLower _bodyPart; -private _debridement = _patient getVariable [QGVAR(debridement), [0,0,0,0,0,0]]; - -if ((_debridement select _part) != 1) exitWith { - private _output = LLSTRING(debridement_fail); - [_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured); -}; - -private _lidocaine = [_patient, "Lidocaine"] call ACEFUNC(medical_status,getMedicationCount); -private _morphine = [_patient, "Morphine"] call ACEFUNC(medical_status,getMedicationCount); -private _damage = _patient getVariable [QACEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; - -private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); -private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); -private _openWounds = GET_OPEN_WOUNDS(_patient); -private _bandaged = []; -private _stitched = []; -private _open = []; - -private _remainder = false; - -if (_lidocaine == 0 && _morphine == 0) then { - private _pain = random [0.7, 0.8, 0.9]; - [_patient, _pain] call ACEFUNC(medical_status,adjustPainLevel); -}; - -{ - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart != _part) then { - _bandaged pushBack _x; - }; - -} forEach _bandagedWounds; - -{ - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart != _part) then { - _stitched pushBack _x; - }; - -} forEach _stitchedWounds; - -_patient setVariable [VAR_BANDAGED_WOUNDS, _bandaged, true]; -_patient setVariable [VAR_STITCHED_WOUNDS, _stitched, true]; - -_debridement set [_part, 0]; -_patient setVariable [QGVAR(debridement), _debridement, true]; - -{ - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart == _part && _amount > 0) exitWith { - _remainder = true; - }; - -} forEach _openWounds; - -if !(_remainder) then { - _damage set [_part, 0]; - _patient setVariable [QACEGVAR(medical,bodyPartDamage), _damage, true]; - - { - _x params ["_id", "_bodyPart", "_amount"]; - - if (_bodyPart != _part && _amount > 0) then { - _open pushBack _x; - }; - - } forEach _openWounds; - - _patient setVariable [VAR_OPEN_WOUNDS, _open, true]; -}; - -switch (_part) do { - case 0: { - [_patient, true, false, false, false] call ACEFUNC(medical_engine,updateBodyPartVisuals); - }; - case 1: { - [_patient, false, true, false, false] call ACEFUNC(medical_engine,updateBodyPartVisuals); - }; - case 2; - case 3: { - [_patient, false, false, true, false] call ACEFUNC(medical_engine,updateBodyPartVisuals); - }; - default { - [_patient, false, false, false, true] call ACEFUNC(medical_engine,updateBodyPartVisuals); - }; -}; - -[_patient] call ACEFUNC(medical_engine,updateDamageEffects); -[_patient] call ACEFUNC(medical_engine,updateWoundBleedLoss); \ No newline at end of file diff --git a/addons/surgery/functions/fnc_npwtTreatmentProgress.sqf b/addons/surgery/functions/fnc_npwtTreatmentProgress.sqf new file mode 100644 index 000000000..2c7ba7396 --- /dev/null +++ b/addons/surgery/functions/fnc_npwtTreatmentProgress.sqf @@ -0,0 +1,75 @@ +#include "script_component.hpp" +/* + * Author: MiszczuZPolski + * Local call for clearing all wounds on a patient + * + * Arguments: + * 0: Medic + * 1: Patient + * 2: Body Part + * + * Return Value: + * None + * + * Example: + * [player, cursorObject, "LeftLeg"] call kat_surgery_fnc_npwtTreatmentLocal; + * + * Public: No + */ +params ["_args", "_elapsedTime", "_totalTime"]; +_args params ["_medic", "_patient", "_bodyPart"]; +_bodyPart = toLower _bodyPart; + +private _openWounds = GET_OPEN_WOUNDS(_patient); +private _openWoundsOnPart = _openWounds get _bodyPart; + +// Stop treatment if there are no wounds that can be bandaged remaining +if (_openWoundsOnPart isEqualTo []) exitWith {false}; + +if (_totalTime - _elapsedTime > ([_patient, _patient, _bodyPart] call FUNC(getNPWTTime)) - GVAR(npwtTime)) exitWith {true}; + +[QACEGVAR(medical_treatment,bandageLocal), [_patient, _bodyPart, "Dressing"], _patient] call CBA_fnc_targetEvent; + +private _bandagedWounds = GET_BANDAGED_WOUNDS(_patient); +private _bandagedWoundsOnPart = _bandagedWounds get _bodyPart; + +if (_bandagedWoundsOnPart isEqualTo []) exitWith {false}; + +// Remove the first stitchable wound from the bandaged wounds +private _treatedWound = _bandagedWoundsOnPart deleteAt (count _bandagedWoundsOnPart - 1); +_treatedWound params ["_treatedID", "_treatedAmountOf", "", "_treatedDamageOf"]; + +// Check if we need to add a new stitched wound or increase the amount of an existing one +private _stitchedWounds = GET_STITCHED_WOUNDS(_patient); +private _stitchedWoundsOnPart = _stitchedWounds getOrDefault [_bodyPart, [], true]; + +private _woundIndex = _stitchedWoundsOnPart findIf { + _x params ["_classID"]; + _classID == _treatedID +}; + +if (_woundIndex == -1) then { + _stitchedWoundsOnPart pushBack _treatedWound; +} else { + private _wound = _stitchedWoundsOnPart select _woundIndex; + _wound set [1, (_wound select 1) + _treatedAmountOf]; +}; + +_patient setVariable [VAR_BANDAGED_WOUNDS, _bandagedWounds, true]; +_patient setVariable [VAR_STITCHED_WOUNDS, _stitchedWounds, true]; + +private _partIndex = ALL_BODY_PARTS find _bodyPart; +private _bodyPartDamage = _patient getVariable [QACEGVAR(medical,bodyPartDamage), []]; +_bodyPartDamage set [_partIndex, (_bodyPartDamage select _partIndex) - (_treatedDamageOf * _treatedAmountOf)]; +_patient setVariable [QACEGVAR(medical,bodyPartDamage), _bodyPartDamage, true]; + +switch (_bodyPart) do { + case "head": {[_patient, true, false, false, false] call ACEFUNC(medical_engine,updateBodyPartVisuals);}; + case "body": {[_patient, false, true, false, false] call ACEFUNC(medical_engine,updateBodyPartVisuals);}; + case "leftarm"; + case "rightarm": {[_patient, false, false, true, false] call ACEFUNC(medical_engine,updateBodyPartVisuals);}; + default {[_patient, false, false, false, true] call ACEFUNC(medical_engine,updateBodyPartVisuals);}; +}; + +[_patient] call ACEFUNC(medical_engine,updateDamageEffects); +[_patient] call ACEFUNC(medical_status,updateWoundBloodLoss); diff --git a/addons/surgery/functions/script_component.hpp b/addons/surgery/functions/script_component.hpp index cdeeac027..d86acad35 100644 --- a/addons/surgery/functions/script_component.hpp +++ b/addons/surgery/functions/script_component.hpp @@ -1,22 +1,3 @@ #include "\x\kat\addons\surgery\script_component.hpp" -#define VAR_BLOOD_PRESS "ACE_medical_bloodPressure" -#define VAR_BLOOD_VOL "ACE_medical_bloodVolume" -#define VAR_WOUND_BLEEDING "ACE_medical_woundBleeding" -#define VAR_CRDC_ARRST "ACE_medical_inCardiacArrest" -#define VAR_HEART_RATE "ACE_medical_heartRate" -#define VAR_PAIN "ACE_medical_pain" -#define VAR_PAIN_SUPP "ACE_medical_painSuppress" -#define VAR_PERIPH_RES "ACE_medical_peripheralResistance" -#define VAR_UNCON "ACE_isUnconscious" -#define VAR_OPEN_WOUNDS "ACE_medical_openWounds" -#define VAR_BANDAGED_WOUNDS "ACE_medical_bandagedWounds" -#define VAR_STITCHED_WOUNDS "ACE_medical_stitchedWounds" -// These variables track gradual adjustments (from medication, etc.) -#define VAR_MEDICATIONS "ACE_medical_medications" -// These variables track the current state of status values above -#define VAR_HEMORRHAGE "ACE_medical_hemorrhage" -#define VAR_IN_PAIN "ACE_medical_inPain" -#define VAR_TOURNIQUET "ACE_medical_tourniquets" -#define VAR_FRACTURES "ACE_medical_fractures" -#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"] +#define STRING_BODY_PARTS ["head", "body", "left arm", "right arm", "left leg", "right leg"] \ No newline at end of file diff --git a/addons/surgery/script_component.hpp b/addons/surgery/script_component.hpp index e3c848346..0e25ef449 100644 --- a/addons/surgery/script_component.hpp +++ b/addons/surgery/script_component.hpp @@ -14,5 +14,5 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_SURGERY #endif +#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" #include "\x\kat\addons\main\script_macros.hpp" -#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" \ No newline at end of file diff --git a/addons/zeus/functions/fnc_toggleAIDeathModule.sqf b/addons/zeus/functions/fnc_toggleAIDeathModule.sqf index fba3599a4..d7cd6a4c6 100644 --- a/addons/zeus/functions/fnc_toggleAIDeathModule.sqf +++ b/addons/zeus/functions/fnc_toggleAIDeathModule.sqf @@ -34,7 +34,7 @@ if ((_mouseOver select 0) != "OBJECT") then { if !(isPlayer _unit) then { private _enabled = _unit getVariable [QEGVAR(misc,PreventInstantAIDeath), false]; - if (!_enabled) then { + if (_enabled) then { [LSTRING(toggleAIDeath_Module_Toggled), ACELSTRING(Common,Enabled)] call FUNC(showMessage); } else { [LSTRING(toggleAIDeath_Module_Toggled), ACELSTRING(Common,Disabled)] call FUNC(showMessage); diff --git a/include/a3/ui_f/$PBOPREFIX$ b/include/a3/ui_f/$PBOPREFIX$ new file mode 100644 index 000000000..bcaad3e8c --- /dev/null +++ b/include/a3/ui_f/$PBOPREFIX$ @@ -0,0 +1 @@ +a3\ui_f \ No newline at end of file diff --git a/include/x/cba/addons/main/$PBOPREFIX$ b/include/x/cba/addons/main/$PBOPREFIX$ new file mode 100644 index 000000000..835b0c9a0 --- /dev/null +++ b/include/x/cba/addons/main/$PBOPREFIX$ @@ -0,0 +1 @@ +x\cba\addons\main \ No newline at end of file diff --git a/include/x/cba/addons/xeh/$PBOPREFIX$ b/include/x/cba/addons/xeh/$PBOPREFIX$ new file mode 100644 index 000000000..45339387f --- /dev/null +++ b/include/x/cba/addons/xeh/$PBOPREFIX$ @@ -0,0 +1 @@ +x\cba\addons\xeh \ No newline at end of file diff --git a/include/z/ace/addons/medical_engine/script_macros_medical.hpp b/include/z/ace/addons/medical_engine/script_macros_medical.hpp index f2d4fb9a0..56c1eec40 100644 --- a/include/z/ace/addons/medical_engine/script_macros_medical.hpp +++ b/include/z/ace/addons/medical_engine/script_macros_medical.hpp @@ -4,7 +4,7 @@ #define ALL_BODY_PARTS ["head", "body", "leftarm", "rightarm", "leftleg", "rightleg"] #define ALL_SELECTIONS ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] -#define ALL_HITPOINTS ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] +#define ALL_HITPOINTS ["HitHead", "HitChest", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"] #define HITPOINT_INDEX_HEAD 0 #define HITPOINT_INDEX_BODY 1 @@ -54,6 +54,10 @@ #define BLOOD_VOLUME_CLASS_4_HEMORRHAGE 3.600 // lost more than 40% blood, Class IV Hemorrhage #define BLOOD_VOLUME_FATAL 3.0 // Lost more than 50% blood, Unrecoverable +// Minimum blood volume, in liters, for a patient to have the chance to wake up +#define MINIMUM_BLOOD_FOR_STABLE_VITALS EGVAR(medical,const_stableVitalsBloodThreshold) +#define MINIMUM_BLOOD_FOR_STABLE_VITALS_DEFAULT BLOOD_VOLUME_CLASS_2_HEMORRHAGE + // IV Change per second calculation: // 250 ml should take 60 seconds to fill. 250 ml / 60 s ~ 4.1667 ml/s. #define IV_CHANGE_PER_SECOND 4.1667 // in milliliters per second @@ -72,9 +76,15 @@ #define DAMAGE_BLUE_THRESHOLD 0.8 #define DAMAGE_TOTAL_COLORS 10 -// --- pain -#define PAIN_UNCONSCIOUS EGVAR(medical,const_painUnconscious) -#define PAIN_UNCONSCIOUS_DEFAULT 0.5 +// Qualitative bleed rate thresholds as a fraction of knock out blood loss +// Note that half of knock out blood loss is considered unstable, and knock out blood loss is considered critical +#define BLEED_RATE_SLOW 0.1 // Slow - One fifth of unstable blood loss +#define BLEED_RATE_MODERATE 0.5 // Moderate - Vitals considered stable +#define BLEED_RATE_SEVERE 1.0 // Severe - Vitals considered unstable +// Massive - Vitals considered critical + +// Pain above which a unit can go unconscious upon receiving damage +#define PAIN_UNCONSCIOUS EGVAR(medical,painUnconsciousThreshold) // Pain fade out time (time it takes until pain is guaranteed to be completly gone) #define PAIN_FADE_TIME EGVAR(medical,const_painFadeTime) @@ -85,7 +95,8 @@ #define PAIN_SUPPRESSION_FADE_TIME 1800 // Chance to wake up when vitals are stable (checked once every SPONTANEOUS_WAKE_UP_INTERVAL seconds) -#define SPONTANEOUS_WAKE_UP_INTERVAL 15 +#define SPONTANEOUS_WAKE_UP_INTERVAL EGVAR(medical,const_wakeUpCheckInterval) +#define SPONTANEOUS_WAKE_UP_INTERVAL_DEFAULT 15 // Minimum leg damage required for limping #define LIMPING_DAMAGE_THRESHOLD EGVAR(medical,const_limpingDamageThreshold) @@ -99,8 +110,8 @@ #define VISUAL_BODY_DAMAGE_THRESHOLD 0.35 // Empty wound data, used for some default return values -// [classID, bodypartIndex, amountOf, bloodloss, damage] -#define EMPTY_WOUND [-1, -1, 0, 0, 0] +// [classID, amountOf, bloodloss, damage] +#define EMPTY_WOUND [-1, 0, 0, 0] // Base time to bandage each wound category #define BANDAGE_TIME_S 4 @@ -173,9 +184,9 @@ #define IS_BLEEDING(unit) (GET_WOUND_BLEEDING(unit) > 0) #define IS_IN_PAIN(unit) (unit getVariable [VAR_IN_PAIN, false]) #define IS_UNCONSCIOUS(unit) (unit getVariable [VAR_UNCON, false]) -#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, []]) -#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, []]) -#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, []]) +#define GET_OPEN_WOUNDS(unit) (unit getVariable [VAR_OPEN_WOUNDS, createHashMap]) +#define GET_BANDAGED_WOUNDS(unit) (unit getVariable [VAR_BANDAGED_WOUNDS, createHashMap]) +#define GET_STITCHED_WOUNDS(unit) (unit getVariable [VAR_STITCHED_WOUNDS, createHashMap]) #define GET_DAMAGE_THRESHOLD(unit) (unit getVariable [QEGVAR(medical,damageThreshold), [EGVAR(medical,AIDamageThreshold),EGVAR(medical,playerDamageThreshold)] select (isPlayer unit)]) // The following function calls are defined here just for consistency diff --git a/tools/stringtable_validator.py b/tools/stringtable_validator.py index bb5df520c..f6ca04c3d 100644 --- a/tools/stringtable_validator.py +++ b/tools/stringtable_validator.py @@ -68,6 +68,10 @@ def check_stringtable(filepath): for key in keys: key_id = key.get("ID") + + # Skip keys that start with "STR_ACE_" + if key_id.startswith("STR_ACE_"): + continue # Verify that the key has a valid ID attribute if key_id is None: