Skip to content

Commit

Permalink
Airway - Add Manual Suction Pump (#453)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- _Add `Manual Suction Pump` (almost same as ACCUVAC but it disposable
and long use time). Disposable features can be optionally disabled or
enabled. Of course, you can change the time._
- _Add "suction success hint" if suction is completed when there
occluded._
- _Add display name string table for ACCUVAC (Item, Treatment menu)._
- _Change treatment action name for ACCUVAC. New name is `Airway
Suction` at EN._
- _Change triage card treatment display name for ACCUVAC (show as
`Airway Suction` at EN). This is treated as the same treatment display
name as Manual Suction Pump._

Todo:
- [x] Add reusability option. (I don't know how... trying to refer IV
reuse setting.)
- [x] Add dedicated hand pumping sound and suction sound.

Picture of item:

![suction_normal](https://github.com/KAT-Advanced-Medical/KAM/assets/50947830/cdc4dbe6-efd8-4381-9d2f-86fdf8557488)

### 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}`.
  • Loading branch information
Apricot-ale authored Jan 30, 2024
1 parent 78669c5 commit 2897cea
Show file tree
Hide file tree
Showing 16 changed files with 203 additions and 59 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Originaly created by Katalam, currently maintained by Tomcat, Kygan, YetheSamart
- [x] Head hyper-extension
- [x] Intubation
- [x] Aspiration
- [x] Items such as Guedel Tube, King LT and Accuvacc
- [x] Items such as Guedel Tube, King LT and Suction Devices (Accuvac, Manual Suction Pump)
- [x] Recovery position
- Breathing
- [x] Oxygen saturation
Expand Down
15 changes: 12 additions & 3 deletions addons/airway/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QFUNC(treatmentAdvanced_RemoveAirwayItem);
};
class Accuvac: Larynxtubus {
displayName = "Accuvac";
displayName = CSTRING(AccuvacTreatment_displayName);
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'));
Expand All @@ -64,10 +64,19 @@ class ACE_Medical_Treatment_Actions {
callbackStart = QFUNC(treatmentAdvanced_AccuvacStart);
callbackSuccess = QFUNC(treatmentAdvanced_accuvac);
callbackProgress = "";
sounds[] = {{QPATHTO_R(sounds\accuvac.wav),6,1,15}};
sounds[] = {{QPATHTO_R(sounds\accuvac_start.wav),6,1,15}};
};
class Suction: Accuvac {
displayName = CSTRING(SuctionTreatment_displayName);
treatmentTime = QGVAR(Suction_time);
items[] = {"kat_suction"};
icon = QPATHTOF(ui\suction.paa);
consumeItem = 1;
medicRequired = QGVAR(medLvl_Suction);
sounds[] = {{QPATHTO_R(sounds\manualpump_start.wav),6,1,15}};
};
class HyperextendHead: Larynxtubus {
displayName = CSTRING(Hyperextend_diplayName);
displayName = CSTRING(Hyperextend_displayName);
displayNameProgress = CSTRING(Hyperextend_progress);
treatmentTime = QGVAR(Hyperextend_Time);
medicRequired = 0;
Expand Down
13 changes: 12 additions & 1 deletion addons/airway/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,23 @@ class CfgVehicles {
class kat_accuvacItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName= "Accuvac";
displayName= CSTRING(Accuvac_Display);
author = "Katalam";
vehicleClass = "Items";
class TransportItems {
MACRO_ADDITEM(kat_accuvac,1);
};
};
class kat_suctionItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName= CSTRING(Suction_Display);
author = "Apricot_ale";
vehicleClass = "Items";
class TransportItems {
MACRO_ADDITEM(kat_suction,1);
};
};
class BloodSplatter_01_Small_Old_F;
class kat_vomit: BloodSplatter_01_Small_Old_F {
displayName = CSTRING(Vomit_Display);
Expand All @@ -45,6 +55,7 @@ class CfgVehicles {
class TransportItems: TransportItems {
MACRO_ADDITEM(kat_larynx,15);
MACRO_ADDITEM(kat_guedel,15);
MACRO_ADDITEM(kat_suction,15);
MACRO_ADDITEM(kat_accuvac,1);
};
};
Expand Down
13 changes: 12 additions & 1 deletion addons/airway/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CfgWeapons {
class kat_accuvac: ACE_ItemCore {
scope = 2;
author = "Katalam";
displayName= "Accuvac";
displayName= CSTRING(Accuvac_Display);
descriptionShort = CSTRING(Accuvac_Desc_Short);
picture = QPATHTOF(ui\accuvac_normal.paa);
model = QPATHTOF(models\accuvac\accuvac.p3d);
Expand All @@ -38,4 +38,15 @@ class CfgWeapons {
mass = 7;
};
};
class kat_suction: ACE_ItemCore {
scope = 2;
author = "Apricot_ale";
displayName= CSTRING(Suction_Display);
descriptionShort = CSTRING(Suction_Desc_Short);
picture = QPATHTOF(ui\suction_normal.paa);
ACE_isMedicalItem = 1;
class ItemInfo: CBA_MiscItem_ItemInfo {
mass = 0.5;
};
};
};
36 changes: 33 additions & 3 deletions addons/airway/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ In real life, this will happen sometimes, not quiet often.
QGVAR(medLvl_Accuvac),
"LIST",
[LLSTRING(ALLOW_ACCUVAC),LLSTRING(ALLOW_ACCUVAC_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Items)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Suction)],
[[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;
Expand All @@ -163,8 +163,38 @@ In real life, this will happen sometimes, not quiet often.
QGVAR(Accuvac_time),
"SLIDER",
[LLSTRING(TIME_ACCUVAC),LLSTRING(TIME_ACCUVAC_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Items)],
[1, 20, 8, 0],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Suction)],
[1, 30, 8, 0],
true
] call CBA_Settings_fnc_init;

//Settable list for using Manual Suction Pump per medical class
[
QGVAR(medLvl_Suction),
"LIST",
[LLSTRING(ALLOW_SUCTION),LLSTRING(ALLOW_SUCTION_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Suction)],
[[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;

// Settable action time for Manual Suction Pump
[
QGVAR(Suction_time),
"SLIDER",
[LLSTRING(TIME_SUCTION),LLSTRING(TIME_SUCTION_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Suction)],
[1, 30, 12, 0],
true
] call CBA_Settings_fnc_init;

// Reuse Item checkbox for Manual Suction Pump
[
QGVAR(Suction_reuse),
"CHECKBOX",
[LLSTRING(SUCTION_REUSE),LLSTRING(SUCTION_REUSE_DESC)],
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Suction)],
[false],
true
] call CBA_Settings_fnc_init;

Expand Down
2 changes: 2 additions & 0 deletions addons/airway/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ class CfgPatches {
units[] = {
"kat_guedelItem",
"kat_larynxItem",
"kat_suctionItem",
"kat_accuvacItem",
"kat_vomit"
};
weapons[] = {
"kat_guedel",
"kat_larynx",
"kat_suction",
"kat_accuvac"
};
magazines[] = {};
Expand Down
18 changes: 17 additions & 1 deletion addons/airway/functions/fnc_treatmentAdvanced_Accuvac.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,24 @@ params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"];
if !(_patient getVariable [QGVAR(occluded), false]) exitWith {
private _output = LLSTRING(Accuvac_NA);
[_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured);

if (_usedItem isEqualTo "kat_suction") then {
if (GVAR(Suction_reuse)) then {
_medic addItem "kat_suction";
};
};
};

if (_usedItem isEqualTo "kat_suction") then {
if (GVAR(Suction_reuse)) then {
_medic addItem "kat_suction";
};
};

[_patient, _classname] call ACEFUNC(medical_treatment,addToTriageCard);
private _treatmentName = LLSTRING(AccuvacTreatment_displayName);
[_patient, _treatmentName] call ACEFUNC(medical_treatment,addToTriageCard);

private _outputSuccess = LLSTRING(Accuvac_Success);
[_outputSuccess, 1.5, _medic] call ACEFUNC(common,displayTextStructured);

[QGVAR(accuvacLocal), _patient, _patient] call CBA_fnc_targetEvent;
28 changes: 20 additions & 8 deletions addons/airway/functions/fnc_treatmentAdvanced_AccuvacStart.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: Blue
* Play Accuvac suction sound
* Play Suction Devices sound
*
* Arguments:
* 0: Medic <OBJECT>
Expand All @@ -24,12 +24,24 @@ params ["_medic", "_patient", "_bodyPart", "_classname", "", "_usedItem"];

if !(_patient getVariable [QGVAR(occluded), false]) exitWith {};

private _accuvacSuction = playSound3D [QPATHTOF_SOUND(sounds\suction.wav), _patient, false, getPosASL _patient, 6, 1, 15];
if (_usedItem isEqualTo "kat_suction") then {
private _suctionSound = playSound3D [QPATHTOF_SOUND(sounds\manualpump_suction.wav), _patient, false, getPosASL _patient, 6, 1, 15];

[{
!dialog;
}, {
params ["_accuvacSuction"];
[{
!dialog;
}, {
params ["_suctionSound"];

stopSound _accuvacSuction;
}, [_accuvacSuction], 5.7] call CBA_fnc_waitUntilAndExecute;
stopSound _suctionSound;
}, [_suctionSound], 7.5] call CBA_fnc_waitUntilAndExecute;
} else {
private _suctionSound = playSound3D [QPATHTOF_SOUND(sounds\accuvac_suction.wav), _patient, false, getPosASL _patient, 6, 1, 15];

[{
!dialog;
}, {
params ["_suctionSound"];

stopSound _suctionSound;
}, [_suctionSound], 5.7] call CBA_fnc_waitUntilAndExecute;
};
File renamed without changes.
File renamed without changes.
Binary file added addons/airway/sounds/manualpump_start.wav
Binary file not shown.
Binary file added addons/airway/sounds/manualpump_suction.wav
Binary file not shown.
Loading

0 comments on commit 2897cea

Please sign in to comment.