Skip to content

Commit

Permalink
Miscellaneous fixes for ACE update (#413)
Browse files Browse the repository at this point in the history
**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 <[email protected]>
  • Loading branch information
MiszczuZPolski and BlueTheKing authored Oct 17, 2023
1 parent b8020e4 commit 49c0157
Show file tree
Hide file tree
Showing 88 changed files with 1,115 additions and 1,207 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ keys/*
####
hemtt.exe
ArmaScriptCompiler.exe

#SQF-VM Server
.vscode\sqfvm-lsp
.vscode
11 changes: 6 additions & 5 deletions addons/airway/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions addons/airway/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down
23 changes: 1 addition & 22 deletions addons/airway/functions/script_component.hpp
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion addons/airway/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
48 changes: 19 additions & 29 deletions addons/breathing/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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 = "";
Expand Down
11 changes: 11 additions & 0 deletions addons/breathing/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down
2 changes: 0 additions & 2 deletions addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
26 changes: 3 additions & 23 deletions addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_checkBreathing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
4 changes: 3 additions & 1 deletion addons/breathing/functions/fnc_handlePulmoHit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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
[{
Expand Down Expand Up @@ -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];
};
};
22 changes: 0 additions & 22 deletions addons/breathing/functions/fnc_treatmentAdvanced_Cyanosis.sqf

This file was deleted.

Loading

0 comments on commit 49c0157

Please sign in to comment.