Skip to content

Commit

Permalink
Breathing - Improve Check Breathing action (#400)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Rename Breath Check to Check Breathing
- Move Check Breathing action to Breathing addon
- Make action diagnose breathing (chest injury) in addition to checking
smell (kidney function)
  • Loading branch information
BlueTheKing authored Aug 28, 2023
1 parent baa8575 commit 18ce633
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 134 deletions.
17 changes: 17 additions & 0 deletions addons/breathing/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
class ACE_Medical_Treatment_Actions {
class CheckPulse;
class CheckBreathing: CheckPulse {
displayName = CSTRING(Check_Breathing);
displayNameProgress = CSTRING(Check_Breathing_Progress);
category = "airway";
allowedSelections[] = {"Head"};
allowSelfTreatment = 0;
medicRequired = 0;
treatmentTime = 2;
condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)));
callbackSuccess = QFUNC(checkBreathing);
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
animationMedic = "";
animationMedicProne = "";
sounds[] = {};
};
class InspectChest: CheckPulse {
displayName = CSTRING(inspectChest_display);
displayNameProgress = CSTRING(inspectChest_progress);
Expand Down
1 change: 1 addition & 0 deletions addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PREP(canUseBVM);
PREP(checkBreathing);
PREP(checkPulseOximeter);
PREP(handleBreathing);
PREP(handlePulmoHit);
Expand Down
54 changes: 54 additions & 0 deletions addons/breathing/functions/fnc_checkBreathing.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include "script_component.hpp"
/*
* Author: 1LT.Mazinski.H
* Modified: Blue
* Check how patient is breathing and the patient's PH levels
*
* Arguments:
* 0: Medic <OBJECT>
* 1: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, cursorObject] call kat_breathing_fnc_checkBreathing;
*
* Public: No
*/

params ["_medic", "_patient"];

private _ph = _patient getVariable [QEGVAR(pharma,pH), 1500];
private _hr = GET_HEART_RATE(_patient);
private _output = "";
private _output_log = "";

private _breathing = LLSTRING(breathing_isNormal);
private _breathing_log = localize ACELSTRING(medical_treatment,Check_Pulse_Normal);
private _breath = "";

if (_patient getVariable [QGVAR(pneumothorax), false]) then {
_breathing = LLSTRING(breathing_isShallow);
_breathing_log = LLSTRING(breathing_shallow);
};

if (_ph < 750) then {
_breath = LLSTRING(breath_mild);

if (_ph < 250) then {
_breath = LLSTRING(breath_stink);
};
};

_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 {
_output = LLSTRING(breathing_none);
_output_log = ACELSTRING(medical_treatment,Check_Pulse_None);
};

[_output, 1.5, _medic] call ACEFUNC(common,displayTextStructured);

[_patient, "quick_view", LSTRING(CheckBreathing_Log), [[_medic] call ACEFUNC(common,getName), _output_log]] call ACEFUNC(medical_treatment,addToLog);
36 changes: 36 additions & 0 deletions addons/breathing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,42 @@
<Italian>Imposta se i veicoli med o strutture mediche possono fornire ossigeno.</Italian>
<Spanish>Establece si los vehículos o instalaciones médicas pueden suministrar oxígeno</Spanish>
</Key>
<Key ID="STR_KAT_Breathing_Check_Breathing">
<English>Check Breathing</English>
</Key>
<Key ID="STR_KAT_Breathing_Check_Breathing_Progress">
<English>Checking Breathing</English>
</Key>
<Key ID="STR_KAT_Breathing_breath_stink">
<English>, harsh and metallic</English>
</Key>
<Key ID="STR_KAT_Breathing_breath_mild">
<English>, slightly fruity</English>
</Key>
<Key ID="STR_KAT_Breathing_breathing_isNormal">
<English>Patient is breathing normally</English>
</Key>
<Key ID="STR_KAT_Breathing_breathing_isShallow">
<English>Patient's breathing is shallow</English>
</Key>
<Key ID="STR_KAT_Breathing_breathing_shallow">
<English>Shallow</English>
</Key>
<Key ID="STR_KAT_Breathing_breathing_none">
<English>Patient is not breathing</English>
<Japanese>患者は呼吸していません</Japanese>
<Korean>환자가 숨을 쉬지 않습니다</Korean>
<Italian>Il paziente non sta respirando</Italian>
<German>Patient atmet nicht</German>
<Portuguese>O paciente não está respirando</Portuguese>
<French>Le patient ne respire pas</French>
<Polish>Pacjent nie oddycha</Polish>
<Spanish>El paciente no esta respirando</Spanish>
<Czech>Pacient nedýchá</Czech>
</Key>
<Key ID="STR_KAT_Breathing_CheckBreathing_Log">
<English>%1 checked breathing: %2</English>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_inspectChest_enable">
<English>Enable Inspect Chest</English>
</Key>
Expand Down
14 changes: 0 additions & 14 deletions addons/pharma/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,6 @@ class ACE_Medical_Treatment_Actions {
animationMedicProne = "";
sounds[] = {};
};
class BreathCheck: Carbonate {
displayName = CSTRING(Check_Breath);
category = "examine";
allowedSelections[] = {"Head"};
allowSelfTreatment = 1;
medicRequired = 1;
treatmentTime = 2;
items[] = {};
condition = "true";
callbackSuccess = QFUNC(inspectBreath);
animationMedic = "";
animationMedicProne = "";
sounds[] = {};
};
class Norepinephrine: EACA {
displayName = CSTRING(Take_Norep);
allowedSelections[] = {"Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"};
Expand Down
1 change: 0 additions & 1 deletion addons/pharma/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ PREP(fluidLocal);
PREP(getBloodLoss);
PREP(getBloodVolumeChange);
PREP(init);
PREP(inspectBreath);
PREP(inspectCatheter);
PREP(pervitinPP);
PREP(removeItemfromMag);
Expand Down
37 changes: 0 additions & 37 deletions addons/pharma/functions/fnc_inspectBreath.sqf

This file was deleted.

64 changes: 0 additions & 64 deletions addons/pharma/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2392,57 +2392,6 @@
<Spanish>La IV del paciente esta funcionando correctamente</Spanish>
<Portuguese>IV do paciente está funcionando corretamente</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_breath_stink">
<English>Patient's breath is harsh and metallic</English>
<Czech>Dech pacienta je trpký a kovový</Czech>
<Italian>Il respiro del paziente è anormale e affannoso</Italian>
<French>L'haleine du patient est mauvaise et métallique</French>
<Korean>환자의 호흡이 거칠고 쇠같습니다.</Korean>
<German>Der Atem des Patienten ist rau und metallisch</German>
<Chinesesimp>病人的呼吸是沙哑的</Chinesesimp>
<Japanese>患者の息はきつく金属臭がします</Japanese>
<Spanish>El aliento del paciente es áspero y metálico</Spanish>
<Polish>Oddech pacjenta jest ostry i metaliczny</Polish>
<Portuguese>O hálito do paciente está áspero e metálico</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_breath_mild">
<English>Patient's breath is slightly fruity</English>
<Italian>Il respiro del paziente è leggermente fruttato</Italian>
<Czech>Dech pacienta je mírně ovocný</Czech>
<French>L'haleine du patient est légèrement fruitée</French>
<Korean>환자의 호흡에서 과일향이 약간 납니다</Korean>
<German>Der Atem des Patienten ist leicht fruchtig</German>
<Chinesesimp>病人的呼吸是平和的</Chinesesimp>
<Japanese>患者の息は少し果物臭がします</Japanese>
<Spanish>El aliento del paciente es dulce</Spanish>
<Polish>Oddech pacjenta jest lekko owocowy</Polish>
<Portuguese>O hálito do paciente está ligeiramente frutado</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_breath_good">
<English>Patient's breath is ok</English>
<Italian>Il respiro del paziente è ok</Italian>
<Czech>Dech pacienta je v pořádku</Czech>
<French>L'haleine du patient est bonne</French>
<Korean>환자의 호흡은 정상이다</Korean>
<German>Der Atem des Patienten ist in Ordnung</German>
<Chinesesimp>病人的呼吸是正常的</Chinesesimp>
<Japanese>患者の息は普通です</Japanese>
<Spanish>El aliento del paciente es normal</Spanish>
<Polish>Oddech pacjenta jest w porządku</Polish>
<Portuguese>O hálito do paciente está normal</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_breath_none">
<English>Patient is not breathing</English>
<Japanese>患者は呼吸していません</Japanese>
<Korean>환자가 숨을 쉬지 않습니다</Korean>
<Italian>Il paziente non sta respirando</Italian>
<German>Patient atmet nicht</German>
<Portuguese>O paciente não está respirando</Portuguese>
<French>Le patient ne respire pas</French>
<Polish>Pacjent nie oddycha</Polish>
<Spanish>El paciente no esta respirando</Spanish>
<Czech>Pacient nedýchá</Czech>
</Key>
<Key ID="STR_KAT_Pharma_SETTING_Kidney_Action">
<English>Kidney damage/failure</English>
<Italian>Rene danneggiato/collassato</Italian>
Expand Down Expand Up @@ -2764,19 +2713,6 @@
<Spanish>Favorece la coagulación</Spanish>
<Portuguese>Favorece a coagulação</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_Check_Breath">
<English>Check Breath</English>
<Italian>Controlla il respiro</Italian>
<Czech>Zkontrolovat dech</Czech>
<French>Contrôler l'haleine</French>
<Polish>Sprawdź oddech</Polish>
<Korean>호흡 확인</Korean>
<German>Überprüfe Atem</German>
<Chinesesimp>检查呼吸</Chinesesimp>
<Japanese>呼吸の確認</Japanese>
<Spanish>Revisar aliento</Spanish>
<Portuguese>Checar hálito</Portuguese>
</Key>
<Key ID="STR_KAT_Pharma_Inspect_Catheter">
<English>Inspect Catheter</English>
<Italian>Ispeziona il catetere</Italian>
Expand Down
18 changes: 0 additions & 18 deletions addons/surgery/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,6 @@ PREP_RECOMPILE_END;

#define CBA_SETTINGS_CAT "KAT - ADV Medical: Surgery"

[
QGVAR(BreathCheck_Time),
"SLIDER",
LLSTRING(BREATH_CHECK_TIME),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)],
[0,100,2,0],
true
] call CBA_Settings_fnc_init;

[
QGVAR(BreathCheck_MedLevel),
"LIST",
LLSTRING(BREATH_CHECK_MEDLEVEL),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_Basic)],
[[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(enable_fracture),
"CHECKBOX",
Expand Down

0 comments on commit 18ce633

Please sign in to comment.