Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breathing - Add/Improve Pneumothoraces #678

Open
wants to merge 21 commits into
base: dev-Tomcat
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 131 additions & 7 deletions addons/breathing/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class ACE_Medical_Treatment_Actions {
class CheckPulse;
class BasicBandage;
class ListenToLungs: CheckPulse {
displayName = CSTRING(auscultateLung_display);
displayNameProgress = CSTRING(listening_progress);
Expand All @@ -9,7 +10,7 @@ class ACE_Medical_Treatment_Actions {
category = "airway";
medicRequired = 0;
consumeItem = 0;
callbackStart = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope),true,true)]; [ARR_2(_medic,_patient)] call FUNC(listenLungs));
callbackStart = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope),true,true)]; [ARR_3(_medic,_patient,0)] call FUNC(listenLungs));
callbackSuccess = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope),false,true)]);
callbackProgress = "";
callbackFailure = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope),false,true)]);
Expand All @@ -19,6 +20,10 @@ class ACE_Medical_Treatment_Actions {
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"};
};
class ListenToRightLungs: ListenToLungs {
displayName = CSTRING(auscultateRightLung_display);
callbackStart = QUOTE(_medic setVariable [ARR_3(QQGVAR(usingStethoscope),true,true)]; [ARR_3(_medic,_patient,1)] call FUNC(listenLungs));
};
class CheckBreathing: CheckPulse {
displayName = CSTRING(Check_Breathing);
displayNameProgress = CSTRING(Check_Breathing_Progress);
Expand Down Expand Up @@ -109,7 +114,7 @@ class ACE_Medical_Treatment_Actions {
treatmentTime = 7;
items[] = {"kat_chestSeal"};
condition = "true";
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_6(_medic,_patient,_bodyPart,_className,objNull,_usedItem)] call FUNC(treatmentAdvanced_chestSeal););
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,0)] call FUNC(treatmentAdvanced_chestSeal););
callbackFailure = "";
callbackProgress = "";
consumeItem = 1;
Expand All @@ -122,6 +127,10 @@ class ACE_Medical_Treatment_Actions {
animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {};
};
class RightChestSeal: ChestSeal {
displayName = CSTRING(rightchestseal_display);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,1)] call FUNC(treatmentAdvanced_chestSeal););
};
class HemopneumothoraxTreatment {
displayName = CSTRING(hemopneumothorax_display);
displayNameProgress = CSTRING(treating);
Expand All @@ -132,8 +141,8 @@ class ACE_Medical_Treatment_Actions {
medicRequired = QGVAR(medLvl_hemopneumothoraxTreatment);
treatmentTime = 7;
items[] = {"kat_aatKit"};
condition = "true";
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_6(_medic,_patient,_bodyPart,_className,objNull,_usedItem)] call FUNC(treatmentAdvanced_hemopneumothorax););
condition = QUOTE(!GVAR(hardcoreBreathingTreatment));
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,0)] call FUNC(treatmentAdvanced_hemopneumothorax););
callbackFailure = "";
callbackProgress = "";
consumeItem = 1;
Expand All @@ -146,6 +155,38 @@ class ACE_Medical_Treatment_Actions {
animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {};
};
class RightHemopneumothoraxTreatment: HemopneumothoraxTreatment {
displayName = CSTRING(righthemopneumothorax_display);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,1)] call FUNC(treatmentAdvanced_hemopneumothorax););
};
class FingerThoracostomy {
displayName = CSTRING(FingerThoracostomy_display);
displayNameProgress = CSTRING(treating);
category = "airway";
treatmentLocations = 0;
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
medicRequired = QGVAR(medLvl_FingerThoracostomyTreatment);
treatmentTime = 12;
items[] = {"kat_scalpel"};
condition = QGVAR(hardcoreBreathingTreatment);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_3(_medic,_patient,0)] call FUNC(treatmentAdvanced_FingerThoracostomy););
callbackFailure = "";
callbackProgress = "";
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"};
animationMedic = "AinvPknlMstpSlayWrflDnon_medicOther";
animationMedicProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationMedicSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {};
};
class RightFingerThoracostomy: FingerThoracostomy{
displayName = CSTRING(FingerThoracostomyRight_display);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_3(_medic,_patient,1)] call FUNC(treatmentAdvanced_FingerThoracostomy););
};
class TensionpneumothoraxTreatment {
displayName = CSTRING(tensionpneumothorax_display);
displayNameProgress = CSTRING(treating);
Expand All @@ -155,9 +196,9 @@ class ACE_Medical_Treatment_Actions {
allowSelfTreatment = 0;
medicRequired = QGVAR(medLvl_hemopneumothoraxTreatment);
treatmentTime = 7;
condition = QUOTE(!GVAR(hardcoreBreathingTreatment));
items[] = {"kat_aatKit"};
condition = "true";
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_6(_medic,_patient,_bodyPart,_className,objNull,_usedItem)] call FUNC(treatmentAdvanced_tensionpneumothorax););
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,0)] call FUNC(treatmentAdvanced_tensionpneumothorax););
callbackFailure = "";
callbackProgress = "";
consumeItem = 1;
Expand All @@ -170,6 +211,10 @@ class ACE_Medical_Treatment_Actions {
animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {};
};
class RightTensionpneumothoraxTreatment: TensionpneumothoraxTreatment{
displayName = CSTRING(righttensionpneumothorax_display);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,1)] call FUNC(treatmentAdvanced_tensionpneumothorax););
};
class ncdKit: TensionpneumothoraxTreatment {
displayName = CSTRING(tensionpneumothoraxNCDKit_display);
displayNameProgress = CSTRING(treating);
Expand All @@ -181,7 +226,7 @@ class ACE_Medical_Treatment_Actions {
treatmentTime = 7;
items[] = {"kat_ncdKit"};
condition = "true";
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_6(_medic,_patient,_bodyPart,_className,objNull,_usedItem)] call FUNC(treatmentAdvanced_tensionpneumothorax););
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,0)] call FUNC(treatmentAdvanced_tensionpneumothorax););
callbackFailure = "";
callbackProgress = "";
consumeItem = 1;
Expand All @@ -194,6 +239,10 @@ class ACE_Medical_Treatment_Actions {
animationMedicSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = {};
};
class RightncdKit: ncdKit {
displayName = CSTRING(righttensionpneumothoraxNCDKit_display);
callbackSuccess = QUOTE([ARR_2(_medic,_patient)] call EFUNC(airway,handleRecoveryPosition); [ARR_7(_medic,_patient,_bodyPart,_className,objNull,_usedItem,1)] call FUNC(treatmentAdvanced_tensionpneumothorax););
};
class DisablePulseOximeterAudio {
displayName = CSTRING(PulseOximeter_Action_removeSound);
displayNameProgress = "";
Expand Down Expand Up @@ -314,4 +363,79 @@ class ACE_Medical_Treatment_Actions {
condition = QUOTE(_patient call EFUNC(airway,checkMask));
callbackSuccess = QFUNC(removeOxygenMask);
};
class ChestTube: CheckPulse {
displayName = CSTRING(Chest_Tube_Use);
displayNameProgress = CSTRING(Chest_Tube_Action);
category = "surgery";
treatmentLocations = QGVAR(chestTubeLocation);
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
medicRequired = QGVAR(chestTubeAction_MedLevel);
treatmentTime = QGVAR(openTime);
items[] = {"kat_aatKit"};
consumeItem = 1;
condition = QUOTE(([ARR_4(_medic,_patient,0.5,0)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_3(_medic,_patient,0)] call FUNC(treatmentAdvanced_chestTube));
};
class RightChestTube: ChestTube {
displayName = CSTRING(Chest_TubeRight_Use);
condition = QUOTE(([ARR_4(_medic,_patient,0.5,1)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_3(_medic,_patient,1)] call FUNC(treatmentAdvanced_chestTube));
};
class Incision: BasicBandage {
displayName = CSTRING(Scalpel_Use);
displayNameProgress = CSTRING(Scalpel_Action);
category = "surgery";
treatmentLocations = QGVAR(surgicalLocation);
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
medicRequired = QGVAR(surgicalAction_MedLevel);
treatmentTime = QGVAR(incisionTime);
items[] = {"kat_scalpel"};
condition = QUOTE(([ARR_4(_medic,_patient,5,0)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_3(_medic,_patient,0)] call FUNC(treatmentAdvanced_chestTubeIncision));
};
class RightIncision: Incision {
displayName = CSTRING(ScalpelRight_Use);
condition = QUOTE(([ARR_4(_medic,_patient,5,1)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_3(_medic,_patient,1)] call FUNC(treatmentAdvanced_chestTubeIncision));
};
class Spread: BasicBandage {
displayName = CSTRING(Retractor_Use);
displayNameProgress = CSTRING(Retractor_Action);
category = "surgery";
treatmentLocations = QGVAR(surgicalLocation);
treatmentTime = QGVAR(ChestTubeintermediateTime);
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
medicRequired = QGVAR(surgicalAction_MedLevel);
items[] = {"kat_retractor"};
consumeItem = 1;
condition = QUOTE(([ARR_4(_medic,_patient,0.1,0)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_4(_medic,_patient,0.1,0)] call FUNC(treatmentAdvanced_chestTubeProgress));
};
class RightSpread: Spread {
displayName = CSTRING(RetractorRight_Use);
condition = QUOTE(([ARR_4(_medic,_patient,0.1,1)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_4(_medic,_patient,0.1,1)] call FUNC(treatmentAdvanced_chestTubeProgress));
};
class Clamp: BasicBandage {
displayName = CSTRING(Clamp_Use);
displayNameProgress = CSTRING(Clamp_Action);
category = "surgery";
treatmentLocations = QGVAR(surgicalLocation);
treatmentTime = QGVAR(ChestTubeintermediateTime);
allowedSelections[] = {"Body"};
allowSelfTreatment = 0;
medicRequired = QGVAR(surgicalAction_MedLevel);
items[] = {"kat_clamp"};
consumeItem = 1;
condition = QUOTE(([ARR_4(_medic,_patient,0.3,0)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_4(_medic,_patient,0.3,0)] call FUNC(treatmentAdvanced_chestTubeProgress));
};
class RightClamp: Incision {
displayName = CSTRING(ClampRight_Use);
condition = QUOTE(([ARR_4(_medic,_patient,0.3,1)] call FUNC(treatmentAdvanced_chestTubeCheck)) && (GVAR(hardcoreBreathingTreatment)));
callbackSuccess = QUOTE([ARR_4(_medic,_patient,0.3,1)] call FUNC(treatmentAdvanced_chestTubeProgress));
};
};
2 changes: 1 addition & 1 deletion addons/breathing/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CfgVehicles {
class kat_chestSealItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName= CSTRING(chestseal_display);
displayName= CSTRING(chestseal_item_display);
author = "Katalam";
vehicleClass = "Items";
class TransportItems {
Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CfgWeapons {
scopeCurator = 2;
scopeArsenal = 2;
author = "Katalam";
displayName = CSTRING(chestseal_display);
displayName = CSTRING(chestseal_item_display);
descriptionShort = CSTRING(chestseal_desc);
picture = QPATHTOF(ui\chest-seal.paa);
ACE_isMedicalItem = 1;
Expand Down
9 changes: 9 additions & 0 deletions addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ PREP(refillOxygenTank);
PREP(removeOxygenMask);
PREP(treatmentAdvanced_chestSeal);
PREP(treatmentAdvanced_chestSealLocal);
PREP(treatmentAdvanced_chestTube);
PREP(treatmentAdvanced_chestTubeCheck);
PREP(treatmentAdvanced_chestTubeIncision);
PREP(treatmentAdvanced_chestTubeIncisionLocal);
PREP(treatmentAdvanced_chestTubeLocal);
PREP(treatmentAdvanced_chestTubeProgress);
PREP(treatmentAdvanced_chestTubeProgressLocal);
PREP(treatmentAdvanced_fingerThoracostomy);
PREP(treatmentAdvanced_fingerThoracostomyLocal);
PREP(treatmentAdvanced_hemopneumothorax);
PREP(treatmentAdvanced_hemopneumothoraxLocal);
PREP(treatmentAdvanced_nasalCannula);
Expand Down
4 changes: 4 additions & 0 deletions addons/breathing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
[QGVAR(chestSealLocal), LINKFUNC(treatmentAdvanced_chestSealLocal)] call CBA_fnc_addEventHandler;
[QGVAR(handleBreathing), LINKFUNC(handleBreathing)] call CBA_fnc_addEventHandler;
[QGVAR(hemopneumothoraxLocal), LINKFUNC(treatmentAdvanced_hemopneumothoraxLocal)] call CBA_fnc_addEventHandler;
[QGVAR(fingerThoracostomyLocal), LINKFUNC(treatmentAdvanced_fingerThoracostomyLocal)] call CBA_fnc_addEventHandler;
[QGVAR(tensionpneumothoraxLocal), LINKFUNC(treatmentAdvanced_tensionpneumothoraxLocal)] call CBA_fnc_addEventHandler;
[QGVAR(cyanosisLocal), LINKFUNC(treatmentAdvanced_CyanosisLocal)] call CBA_fnc_addEventHandler;
[QGVAR(nasalCannulaLocal), LINKFUNC(treatmentAdvanced_nasalCannulaLocal)] call CBA_fnc_addEventHandler;
[QGVAR(removeNasalCannulaLocal), LINKFUNC(treatmentAdvanced_removeNasalCannulaLocal)] call CBA_fnc_addEventHandler;
[QGVAR(chestTubeIncision), LINKFUNC(treatmentAdvanced_chestTubeIncisionLocal)] call CBA_fnc_addEventHandler;
[QGVAR(chestTubeProgress), LINKFUNC(treatmentAdvanced_chestTubeProgressLocal)] call CBA_fnc_addEventHandler;
[QGVAR(chestTube), LINKFUNC(treatmentAdvanced_chestTubeLocal)] call CBA_fnc_addEventHandler;

[QGVAR(playCough), {
params ["_unit"];
Expand Down
76 changes: 76 additions & 0 deletions addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -567,4 +567,80 @@ PREP_RECOMPILE_END;
true
] call CBA_settings_fnc_init;

[
QGVAR(medLvl_FingerThoracostomyTreatment),
"LIST",
LLSTRING(SETTING_FingerThoracostomyTreatment_medLvl),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[[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;

[
QGVAR(hardcoreBreathingTreatment),
"CHECKBOX",
[LLSTRING(SETTING_hardcoreBreathingTreatment),LLSTRING(SETTING_hardcoreBreathingTreatment_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[true],
true
] call CBA_Settings_fnc_init;

[
QGVAR(incisionTime),
"SLIDER",
LLSTRING(INCISION_TIMER),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[0,100,10,0],
true
] call CBA_Settings_fnc_init;

[
QGVAR(ChestTubeintermediateTime),
"SLIDER",
[LLSTRING(INTERMEDIATE_TIMER), LLSTRING(INTERMEDIATE_TIMER_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[0,100,8,0],
true
] call CBA_Settings_fnc_init;

[
QGVAR(openTime),
"SLIDER",
LLSTRING(OPEN_TIMER),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[0,100,15,0],
true
] call CBA_Settings_fnc_init;

[
QGVAR(chestTubeAction_MedLevel),
"LIST",
LLSTRING(CHESTTUBE_ACTION_MEDLEVEL),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 2],
true
] call CBA_Settings_fnc_init;

[
QGVAR(chestTubeLocation),
"LIST",
LLSTRING(CHESTTUBE_LOCATION),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[[0,1,2,3],["STR_ACE_Common_Anywhere", "STR_ACE_Common_Vehicle", "STR_ACE_Medical_Treatment_MedicalFacilities", "STR_ACE_Medical_Treatment_VehiclesAndFacilities"],3],
true
] call CBA_Settings_fnc_init;

// 0 Surgery Causes Unconsciousness: If you do an incision (without anesthesia & sedative) patient will go into CA
// 1 Unconsciousness Required for Surgery: Surgery fails unless patient is unconscious, needs anesthesia
// 2 No Unconsciousness from Surgery: Patient can stay awake without anesthesia, causes pain
// 3 Surgery Anesthesia: The patient is able to stay awake through the entirety of the surgery. If Etomidate has not been applied, then the patient will go into CA.
[
QGVAR(chestTube_ConsciousnessRequirement),
"LIST",
[LLSTRING(SETTING_ConsciousnessRequirement), LLSTRING(SETTING_ConsciousnessRequirement_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_ThoraxInjuries)],
[[0, 1, 2, 3], [LLSTRING(SETTING_Causes_Unconsciousness), LLSTRING(SETTING_Unconsciousness_Required), LLSTRING(SETTING_No_Unconsciousness), LLSTRING(SETTING_Anesthesia)], 0],
true
] call CBA_Settings_fnc_init;

ADDON = true;
Loading
Loading