Skip to content

Commit

Permalink
Merge branch 'KAT-Advanced-Medical:dev-Tomcat' into dev-Tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
AtrixZockt authored Dec 17, 2024
2 parents c9a6a45 + b365921 commit 83a45e2
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addons/airway/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class ACE_Medical_Treatment_Actions {
allowedSelections[] = {"Head"};
allowSelfTreatment = 0;
callbackSuccess = QFUNC(checkAirway);
condition = QUOTE(!([_patient] call ACEFUNC(common,isAwake)) && (missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !([_patient] call FUNC(checkMask)));
condition = QUOTE((missionNamespace getVariable [ARR_2(QQGVAR(enable),true)]) && !([_patient] call FUNC(checkMask)));
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon", "kat_recoveryposition"};
};
Expand Down
9 changes: 9 additions & 0 deletions addons/airway/functions/fnc_checkAirway.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ if (!(_patient getVariable [QGVAR(occluded), false]) && !(_patient getVariable [
_hintWidth = 10;
};

if (_patient getVariable [QEGVAR(chemical,airPoisoning), false]) exitWith {
_message = LLSTRING(AirwayStatus_Poison);

[_message, _hintSize, _medic, _hintWidth] call ACEFUNC(common,displayTextStructured);
[_patient, "quick_view", LSTRING(checkAirway_log)] call EFUNC(circulation,removeLog);
[_patient, "quick_view", LSTRING(checkAirway_poisonLog)] call EFUNC(circulation,removeLog);
[_patient, "quick_view", LSTRING(checkAirway_poisonLog), [[_medic] call ACEFUNC(common,getName)]] call ACEFUNC(medical_treatment,addToLog);
};

[_message, _hintSize, _medic, _hintWidth] call ACEFUNC(common,displayTextStructured);

[_patient, "quick_view", LSTRING(checkAirway_log)] call EFUNC(circulation,removeLog);
Expand Down
6 changes: 6 additions & 0 deletions addons/airway/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@
<Chinesesimp>%1 检查呼吸道: %2, %3</Chinesesimp>
<Dutch>%1 Heeft de luchtwegen gecheckt: %2, %3</Dutch>
</Key>
<Key ID="STR_KAT_Airway_checkAirway_poisonLog">
<English>%1 checked airways: Heavily Blistered</English>
</Key>
<Key ID="STR_KAT_Airway_airway_log">
<English>%1 inserted a %2</English>
<German>%1 intubierte mit %2</German>
Expand Down Expand Up @@ -399,6 +402,9 @@
<Finnish>Tuuliputki on selkeä</Finnish>
<Dutch>Luchtweg is vrij</Dutch>
</Key>
<Key ID="STR_KAT_Airway_AirwayStatus_Poison">
<English>Airway is heavily blistered</English>
</Key>
<Key ID="STR_KAT_Airway_AirwayStatus_NotClearForItem">
<English>Item could not be used, airways are not clear</English>
<German>Gegenstand konnte nicht verwendet werden, Atemwege sind nicht frei</German>
Expand Down
4 changes: 2 additions & 2 deletions addons/breathing/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class CfgMagazines {
picture = QPATHTOF(ui\oxygenTank.paa);

ammo = "";
count = 60;
count = 30;
initSpeed = 0;
tracersEvery = 0;
lastRoundsTracer = 0;
mass = 3;
mass = 5;
ACE_isMedicalItem = 1;
ACE_asItem = 1;
};
Expand Down
7 changes: 7 additions & 0 deletions addons/breathing/CfgSounds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ class CfgSounds
sound[] = { QPATHTOF(audio\pneumothoraxcough.ogg), 5, 1, 2 };
titles[] = {};
};
class GVAR(respiratorTone) {
name = QGVAR(respiratorTone);

// filename, volume, pitch, distance (optional)
sound[] = { QPATHTOF(audio\respiratorTone.ogg), 5, 1, 2 };
titles[] = {};
};
};
6 changes: 6 additions & 0 deletions addons/breathing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
_unit say3D [QGVAR(pneumothoraxcough), 15];
}] call CBA_fnc_addEventHandler;

[QGVAR(playRespiratorTone), {
params ["_unit"];
_unit say3D [QGVAR(respiratorTone), 10];
}] call CBA_fnc_addEventHandler;


[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;

[QACEGVAR(medical_status,initialized), LINKFUNC(handleBreathingConditions)] call CBA_fnc_addEventHandler;
Expand Down
Binary file added addons/breathing/audio/respiratorTone.ogg
Binary file not shown.
8 changes: 7 additions & 1 deletion addons/breathing/functions/fnc_attachPersonalOxygen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ _patient removeMagazines "kat_personal_oxygen";

_patient setVariable [QGVAR(oxygenMaskStatus), [(_largestTankValue + 1), 1], true];

[QGVAR(playRespiratorTone), [_patient], _patient] call CBA_fnc_targetEvent;

[{
_this params ["_args", "_pfhID"];
_args params ["_patient"];
Expand All @@ -68,6 +70,11 @@ _patient setVariable [QGVAR(oxygenMaskStatus), [(_largestTankValue + 1), 1], tru
};

private _maskStatus = _patient getVariable [QGVAR(oxygenMaskStatus), [0,0]];
_patient setVariable [QGVAR(oxygenMaskStatus), [((_maskStatus select 0) - 1), _pfhID]];

if ((_maskStatus select 0) < 4) then {
[QGVAR(playRespiratorTone), [_patient], _patient] call CBA_fnc_targetEvent;
};

if ((_maskStatus select 0) == 0) exitWith {
[LLSTRING(PersonalOxygen_Empty), 1.5, _patient] call ACEFUNC(common,displayTextStructured);
Expand All @@ -78,7 +85,6 @@ _patient setVariable [QGVAR(oxygenMaskStatus), [(_largestTankValue + 1), 1], tru
_pfhID call CBA_fnc_removePerFrameHandler;
};

_patient setVariable [QGVAR(oxygenMaskStatus), [((_maskStatus select 0) - 1), _pfhID]];
}, 60, [
_patient
]] call CBA_fnc_addPerFrameHandler;
2 changes: 2 additions & 0 deletions addons/breathing/functions/fnc_attachVehicleOxygen.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ if (_patient getVariable [QGVAR(oxygenMaskActive), false]) exitWith {

_patient setVariable [QGVAR(oxygenMaskActive), true, true];

[QGVAR(playRespiratorTone), [_patient], _patient] call CBA_fnc_targetEvent;

[{
_this params ["_args", "_pfhID"];
_args params ["_patient"];
Expand Down
3 changes: 2 additions & 1 deletion addons/breathing/functions/fnc_checkBreathing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private _breathing = LLSTRING(breathing_isNormal);
private _breathing_log = localize ACELSTRING(medical_treatment,Check_Pulse_Normal);
private _breath = "";

if (_patient getVariable [QGVAR(pneumothorax), 0] > 0) then {
if ((_patient getVariable [QGVAR(pneumothorax), 0] > 0) || (_patient getVariable [QEGVAR(chemical,airPoisoning), false])) then {
_breathing = LLSTRING(breathing_isShallow);
_breathing_log = LLSTRING(breathing_shallow);
};
Expand All @@ -44,6 +44,7 @@ if (_ph < 7.2) 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,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
12 changes: 12 additions & 0 deletions addons/breathing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2748,50 +2748,62 @@
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYMASK">
<English>Available Oxygen Masks</English>
<Japanese>使用可能な酸素マスク</Japanese>
<French>Masques à oxygène disponibles</French>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYMASK_DISC">
<English>Sets which goggles can act as oxygen masks</English>
<Japanese>酸素マスクとして動作させたいゴーグルを指定します</Japanese>
<French>Spécifiez les masques que vous souhaitez utiliser comme masque à oxygène.</French>
</Key>
<Key ID="STR_KAT_Breathing_AttachPersonalOxygenTank">
<English>Connect Personal Oxygen</English>
<Japanese>個人用酸素供給機に接続</Japanese>
<French>Connecter de l'oxygène personnel</French>
</Key>
<Key ID="STR_KAT_Breathing_RemovePersonalOxygenTank">
<English>Disconnect Personal Oxygen</English>
<Japanese>個人用酸素供給機を切断</Japanese>
<French>Déconnexion de l'oxygène personnel</French>
</Key>
<Key ID="STR_KAT_Breathing_CheckPersonalOxygenTank">
<English>Check Personal Oxygen Status</English>
<Japanese>個人用酸素供給機の状態を確認</Japanese>
<French>Vérifier l'état de l'oxygène personnel</French>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Remaining">
<English>Minutes Remaining</English>
<Japanese>分残っています</Japanese>
<French>Minutes restantes</French>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Empty">
<English>Oxygen Tank Empty</English>
<Japanese>酸素ボンベは空です</Japanese>
<French>Réservoir d'oxygène vide</French>
</Key>
<Key ID="STR_KAT_Breathing_AttachOxygenVehicle">
<English>Connect to Aircraft Oxygen</English>
<Japanese>航空機酸素供給機に接続</Japanese>
<French>Connexion à l'oxygène de l'aéronef</French>
</Key>
<Key ID="STR_KAT_Breathing_VehicleOxygen_Affirm">
<English>Attached to Aircraft Oxygen</English>
<Japanese>航空機酸素供給機に接続済</Japanese>
<French>Attaché à l'oxygène de l'aéronef</French>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Affirm">
<English>Oxygen already connected</English>
<Japanese>既に酸素供給機に接続済です</Japanese>
<French>Oxygène déjà connecté</French>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Disconnect">
<English>Oxygen tank disconnected</English>
<Japanese>酸素供給機から切断しました</Japanese>
<French>Réservoir d'oxygène déconnecté</French>
</Key>
<Key ID="STR_KAT_Breathing_Remove_OxyMask">
<English>Remove Oxygen Mask</English>
<Japanese>酸素マスクを取り外す</Japanese>
<French>Retirer le masque à oxygène</French>
</Key>
</Package>
</Project>
10 changes: 10 additions & 0 deletions addons/chemical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@ PREP_RECOMPILE_END;
[0, 3600, 60],
true
] call CBA_Settings_fnc_init;

// Shows poisioning image
[
QGVAR(showPoisoning),
"CHECKBOX",
[LLSTRING(SETTING_showPoisoning), LLSTRING(SETTING_showPoisoning_DESC)],
CBA_SETTINGS_CHEM,
[true],
true
] call CBA_Settings_fnc_init;
ADDON = true;
2 changes: 1 addition & 1 deletion addons/chemical/functions/fnc_gui_updateBodyImage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
params ["_ctrlGroup", "_target", "_selectionN"];

private _ctrlAirInfected = _ctrlGroup controlsGroupCtrl IDC_BODY_TORSO_I;
if (_target getVariable [QGVAR(airPoisoning), false]) then {
if ((_target getVariable [QGVAR(airPoisoning), false]) && (missionNamespace getVariable [QGVAR(showPoisoning), true])) then {
_ctrlAirInfected ctrlShow true;
} else {
_ctrlAirInfected ctrlShow false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
params ["_ctrl", "_target", "_selectionN", "_entries"];

private _poisontype = _target getVariable [QGVAR(poisonType),""];
if (_target getVariable [QGVAR(airPoisoning),false]) then{

if (_target getVariable [QGVAR(airPoisoning),false] && (missionNamespace getVariable [QGVAR(showPoisoning), true])) then{
_entries pushBack [LLSTRING(Intoxication), [0.4,0,0.5,1]];
};
5 changes: 5 additions & 0 deletions addons/chemical/functions/fnc_poison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ if (_gasLevel == 0) exitWith {
};
};

// We assume that oxygen masks only cover the mouth and nose, leaving the eyes exposed to CS gas
if ((_unit getVariable [QEGVAR(breathing,oxygenMaskActive)])) exitWith {
TRACE_1("unit has oxygen mask",_unit);
};

private _currentInfectionArray = _unit getVariable [QGVAR(infectionArray), []];

if ((_currentInfectionArray findIf { _x isEqualTo _infectedObject}) == -1) then {
Expand Down
12 changes: 10 additions & 2 deletions addons/chemical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@
<Russian>Определяет, влияет ли GAS на искусственный интеллект (если вы запускаете его на локальном сервере, это может вызвать проблемы с производительностью).</Russian>
<Dutch>Bepaald of KI/AI beïnvloed wordt door gas (als je dit doet op een lokale server kan dit leiden tot prestatieproblemen)</Dutch>
</Key>
<Key ID="STR_KAT_Chemical_SETTING_showPoisoning">
<English>Show Poisoning</English>
</Key>
<Key ID="STR_KAT_Chemical_SETTING_showPoisoning_DESC">
<English>Determines if poisoning and intoxication is shown in the medical menu</English>
</Key>
<Key ID="STR_KAT_Chemical_GasFilterItem">
<English>Gas mask filter</English>
<Spanish>Filtro de la mascara de gas</Spanish>
Expand Down Expand Up @@ -793,7 +799,7 @@
<Key ID="STR_KAT_Chemical_PutOnGasMask">
<English>Put on gas mask</English>
<Japanese>ガスマスクを装着</Japanese>
<French>Mettre le masque à gaz</French>
<French>Mettre le masque à gaz</French>
</Key>
<Key ID="STR_KAT_Chemical_TakeOffGasMask">
<English>Take off gas mask</English>
Expand All @@ -814,9 +820,11 @@
</Key>
<Key ID="STR_KAT_Chemical_SETTING_dropWeaponChance">
<English>Drop Weapon Chance</English>
<French>Chance de lâcher l'arme</French>
</Key>
<Key ID="STR_KAT_Chemical_SETTING_dropWeaponChance_DESC">
<English>Determines chance for dropping weapon while in tear gas</English>
<French>Détermine les chances de lâcher l'arme en cas d'exposition aux gaz lacrymogènes.</French>
</Key>
</Package>
</Project>
</Project>
1 change: 1 addition & 0 deletions addons/circulation/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,7 @@
<Key ID="STR_KAT_Circulation_ChangeCPRDevice">
<English>Change Monitoring Device</English>
<Japanese>モニタリングする装置を変更</Japanese>
<French>Changer le dispositif de surveillance</French>
</Key>
<Key ID="STR_KAT_Circulation_StartCPR">
<English>CPR Started</English>
Expand Down

0 comments on commit 83a45e2

Please sign in to comment.