Skip to content

Commit

Permalink
Merge pull request #14 from Cplhardcore/dev-Tomcat
Browse files Browse the repository at this point in the history
master to rework
  • Loading branch information
Cplhardcore authored Dec 15, 2024
2 parents c2c2c6c + 63f5517 commit 16e3874
Show file tree
Hide file tree
Showing 58 changed files with 951 additions and 234 deletions.
2 changes: 1 addition & 1 deletion addons/airway/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Turkish>ACE-Havayolu yaralanmaları aktive edildi mi?</Turkish>
<Italian>Attivare ACE-Lesioni Respiratorie?</Italian>
<Russian>Активированы травмы ACE-Airway?</Russian>
<Japanese>気道損傷モジュールを有効化</Japanese>
<Japanese>気道障害モジュールを有効化</Japanese>
<Portuguese>ACE - Lesões nas vias aéreas ativadas?</Portuguese>
<Norwegian>ACE - Luftveiskade aktivert?</Norwegian>
<Finnish>Hengitysteiden vammat aktivoituivat?</Finnish>
Expand Down
6 changes: 3 additions & 3 deletions addons/breathing/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class CfgVehicles {
};
class Attach_PersonalOxygen {
displayName = CSTRING(AttachPersonalOxygenTank);
condition = QUOTE(([ARR_2(_player,'kat_personal_oxygen')] call ACEFUNC(common,hasMagazine)) && (_player call EFUNC(airway,checkMask)));
condition = QUOTE(([ARR_2(_player,'kat_personal_oxygen')] call ACEFUNC(common,hasMagazine)) && (_player call FUNC(checkOxygenMask)));
statement = QUOTE(_player call FUNC(attachPersonalOxygen));
showDisabled = 0;
exceptions[] = {"isNotSwimming", "isNotOnLadder"};
Expand Down Expand Up @@ -176,7 +176,7 @@ class CfgVehicles {
class ACE_SelfActions {
class KAT_AttachOxygenVehicle {
displayName = CSTRING(AttachOxygenVehicle);
condition = QUOTE((_player call FUNC(checkAircraftOxygen)) && (_player call EFUNC(airway,checkMask)));
condition = QUOTE((_player call FUNC(checkAircraftOxygen)) && (_player call FUNC(checkOxygenMask)));
statement = QUOTE(_player call FUNC(attachVehicleOxygen));
insertChildren = "";
exceptions[] = {};
Expand All @@ -189,7 +189,7 @@ class CfgVehicles {
class ACE_SelfActions {
class KAT_AttachOxygenVehicle {
displayName = CSTRING(AttachOxygenVehicle);
condition = QUOTE((_player call FUNC(checkAircraftOxygen)) && (_player call EFUNC(airway,checkMask)));
condition = QUOTE((_player call FUNC(checkAircraftOxygen)) && (_player call FUNC(checkOxygenMask)));
statement = QUOTE(_player call FUNC(attachVehicleOxygen));
insertChildren = "";
exceptions[] = {};
Expand Down
1 change: 1 addition & 0 deletions addons/breathing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ PREP(attachVehicleOxygen);
PREP(canUseBVM);
PREP(checkAircraftOxygen);
PREP(checkBreathing);
PREP(checkOxygenMask);
PREP(checkPersonalOxygen);
PREP(checkPulseOximeter);
PREP(detachPersonalOxygen);
Expand Down
3 changes: 2 additions & 1 deletion addons/breathing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
[QACEGVAR(medical,woundReceived),LINKFUNC(handlePulmoHit)] call CBA_fnc_addEventHandler;

private _items = missionNamespace getVariable [QGVAR(availOxyMask), "'G_AirPurifyingRespirator_01_F'"];
private _array = [_items, "CfgGlasses"] call FUNC(getList);
private _array = [_items, "CfgGlasses"] call EFUNC(chemical,getList);

missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true];
2 changes: 1 addition & 1 deletion addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PREP_RECOMPILE_END;
"'G_AirPurifyingRespirator_01_F'",
1,
{
private _array = [_this, "CfgGlasses"] call FUNC(getList);
private _array = [_this, "CfgGlasses"] call EFUNC(chemical,getList);
missionNamespace setVariable [QGVAR(availOxyMaskList), _array, true];
},
true
Expand Down
24 changes: 24 additions & 0 deletions addons/breathing/functions/fnc_checkOxygenMask.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Checks if patient has an oxygen mask on
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_breathing_fnc_checkOxygenMask;
*
* Public: No
*/

params ["_patient"];

if ((goggles _patient in (missionNamespace getVariable [QGVAR(availOxyMaskList), []]))) exitWith {
true
};

false
28 changes: 24 additions & 4 deletions addons/breathing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<Turkish>Ölümcül SpO2 değeri</Turkish>
<Italian>Valore letale di SpO2</Italian>
<Russian>Смертельное значение SpO2</Russian>
<Japanese>SpO2の致命値</Japanese>
<Japanese>致死に至るSpO2値</Japanese>
<Portuguese>Valor letal de SpO2</Portuguese>
<Finnish>Tappava SpO2-arvo</Finnish>
<Dutch>Dodelijke SpO2 waarde</Dutch>
Expand All @@ -54,7 +54,7 @@
<Turkish>Ölümcül SpO2 değerini etkinleştir</Turkish>
<Italian>Attivare il valore letale di SpO2</Italian>
<Russian>Активировать летальное значение SpO2</Russian>
<Japanese>SpO2の致命値を有効化</Japanese>
<Japanese>SpO2値による致死を有効化</Japanese>
<Portuguese>Ativar o valor letal de SpO2</Portuguese>
<Finnish>Aktivoi tappava SpO2-arvo</Finnish>
<Dutch>Activeer dodelijke SpO2 waarde</Dutch>
Expand All @@ -63,7 +63,7 @@
<English>Cardiac arrest SpO2 value</English>
<Russian>Значение SpO2 при остановке сердца</Russian>
<Spanish>Valor de SpO2 de parada cardíaca</Spanish>
<Japanese>SpO2の心停止値</Japanese>
<Japanese>心停止に至るSpO2値</Japanese>
<French>Valeur d'arrêt cardiaque de la SpO2</French>
<Portuguese>Valor de SpO2 para parada cardíaca</Portuguese>
<Dutch>Hartstilstand SpO2 waarde</Dutch>
Expand All @@ -73,7 +73,7 @@
<English>Activate cardiac arrest SpO2 value</English>
<Russian>Активируйте значение SpO2 при остановке сердца</Russian>
<Spanish>Activar parada cardíaca por valor de SpO2</Spanish>
<Japanese>SpO2の心停止値を有効化</Japanese>
<Japanese>SpO2値による心停止を有効化</Japanese>
<French>Activer la valeur d'arrêt cardique de la SpO2</French>
<Portuguese>Ativar parada cardíaca por valor de SpO2</Portuguese>
<Dutch>Activeer hartstilstand SpO2 waarde</Dutch>
Expand Down Expand Up @@ -146,11 +146,13 @@
<English>Enable PaCO2</English>
<Japanese>PaCO2を有効化</Japanese>
<Italian>Abilitare PaCO2</Italian>
<French>Activation de la PaCO2</French>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_PACO2_ENABLE_DESC">
<English>Enables PaCO2 movement and effects on ph and breathing rate</English>
<Japanese>phや呼吸速度へ影響を与えるPaCO2(動脈血二酸化炭素分圧)の変動を有効にします</Japanese>
<Italian>Abilita il movimento di PaCO2 e gli effetti su pH e frequenza respiratoria</Italian>
<French>Permet le déplacement de la PaCO2 et les effets sur le pH et la fréquence respiratoire</French>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_pneumothorax">
<English>Probability for a pneumothorax</English>
Expand Down Expand Up @@ -2020,9 +2022,11 @@
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Display">
<English>Personal Oxygen Tank</English>
<Japanese>個人用酸素ボンベ</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Desc_Short">
<English>Personal oxygen tank for high altitude operations</English>
<Japanese>高高度作戦に用いる個人用酸素ボンベ</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PortableOxygenTank_150_Empty_Display">
<English>Empty Portable Oxygen Tank (150L)</English>
Expand Down Expand Up @@ -2731,47 +2735,63 @@
</Key>
<Key ID="STR_KAT_Breathing_SETTING_enableCheckBreathing">
<English>Enable Check Breathing</English>
<French>Activer le contrôle de la respiration</French>
<Italian>Abilitare il controllo della respirazione</Italian>
<Japanese>"呼吸を確認"を有効化</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_enableCheckBreathing_DESC">
<English>Whether or not Check Breathing medical action is enabled</English>
<Italian>Se l'azione medica di controllo della respirazione è abilitata o meno</Italian>
<French>Si "Contrôle de la respiration" est activée ou non</French>
<Japanese>呼吸を確認のアクションを可能にするかどうかを設定します</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYMASK">
<English>Available Oxygen Masks</English>
<Japanese>使用可能な酸素マスク</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_SETTING_AVAIL_OXYMASK_DISC">
<English>Sets which goggles can act as oxygen masks</English>
<Japanese>酸素マスクとして動作させたいゴーグルを指定します</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_AttachPersonalOxygenTank">
<English>Connect Personal Oxygen</English>
<Japanese>個人用酸素供給機に接続</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_RemovePersonalOxygenTank">
<English>Disconnect Personal Oxygen</English>
<Japanese>個人用酸素供給機を切断</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_CheckPersonalOxygenTank">
<English>Check Personal Oxygen Status</English>
<Japanese>個人用酸素供給機の状態を確認</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Remaining">
<English>Minutes Remaining</English>
<Japanese>分残っています</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Empty">
<English>Oxygen Tank Empty</English>
<Japanese>酸素ボンベは空です</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_AttachOxygenVehicle">
<English>Connect to Aircraft Oxygen</English>
<Japanese>航空機酸素供給機に接続</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_VehicleOxygen_Affirm">
<English>Attached to Aircraft Oxygen</English>
<Japanese>航空機酸素供給機に接続済</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Affirm">
<English>Oxygen already connected</English>
<Japanese>既に酸素供給機に接続済です</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_PersonalOxygen_Disconnect">
<English>Oxygen tank disconnected</English>
<Japanese>酸素供給機から切断しました</Japanese>
</Key>
<Key ID="STR_KAT_Breathing_Remove_OxyMask">
<English>Remove Oxygen Mask</English>
<Japanese>酸素マスクを取り外す</Japanese>
</Key>
</Package>
</Project>
12 changes: 11 additions & 1 deletion addons/chemical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PREP_RECOMPILE_END;
[
QGVAR(gasMaskSoundVolume),
"SLIDER",
[LLSTRING(SETTING_stethoscopeSoundVolume), LLSTRING(SETTING_stethoscopeSoundVolume_DESC)],
[LLSTRING(SETTING_gasMaskSoundVolume), LLSTRING(SETTING_gasMaskSoundVolume_DESC)],
CBA_SETTINGS_CHEM,
[0, 2, 1, 1],
2,
Expand All @@ -54,4 +54,14 @@ PREP_RECOMPILE_END;
[0, 1, 0, 2, true],
true
] call CBA_Settings_fnc_init;

// Infection time
[
QGVAR(infectionTime),
"TIME",
[LLSTRING(SETTING_infectionTime), LLSTRING(SETTING_infectionTime_DESC)],
CBA_SETTINGS_CHEM,
[0, 3600, 60],
true
] call CBA_Settings_fnc_init;
ADDON = true;
2 changes: 2 additions & 0 deletions addons/chemical/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ TRACE_1("fullHealLocal kat chemical",_patient);
_patient setVariable [QGVAR(gasmask_durability), 10, true];
_patient setVariable [QGVAR(CSGas), 0, true];
_patient setVariable [QGVAR(airPoisoning), false, true];
_patient setVariable [QGVAR(infectionTime), missionNamespace getVariable [QGVAR(infectionTime), 60], true];
_patient setVariable [QGVAR(infectionArray), [], true];
5 changes: 3 additions & 2 deletions addons/chemical/functions/fnc_gasManagerPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
_y params ["_gasLogic", "_radius", "_gasLevel", "_condition", "_conditionArgs", "_isSealable"];
TRACE_2("gasManagerPFH loop",_x,_y);

private _infectedObject = _y;

// Remove when condition is no longer valid
if !(_conditionArgs call _condition) then {
TRACE_2("condition no longer valid, deleting",_x,_y);
Expand All @@ -34,7 +36,6 @@

// Poison units (alive or dead) close to the gas source
{

// Get the distance of the unit from the center of the sphere (_gasLogic)
private _distance = _x distance _gasLogic;

Expand All @@ -46,7 +47,7 @@

_x setVariable [QGVAR(areaIntensity), _intensity, true];

[QGVAR(poison), [_x, _gasLevel], _x] call CBA_fnc_targetEvent;
[QGVAR(poison), [_x, _gasLevel, _infectedObject], _x] call CBA_fnc_targetEvent;

} forEach nearestObjects [_gasLogic, ["CAManBase"], _radius];
} forEach GVAR(gasSources);
2 changes: 2 additions & 0 deletions addons/chemical/functions/fnc_gasmodule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ private _radius = _logic getVariable ["Radius", 20];
private _gasLevel = _logic getVariable ["GAS_type", 0];
private _isSealable = _logic getVariable ["IsSealable", false];

if (count _units == 0) then {_units pushBack _logic;};

if (!_activated) exitWith {};
if (isServer) then {

Expand Down
44 changes: 33 additions & 11 deletions addons/chemical/functions/fnc_poison.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Public: No
*/

params ["_unit", "_gasLevel"];
params ["_unit", "_gasLevel", "_infectedObject"];

// Check if unit is remote (objNull is remote)
if (!local _unit) exitWith {
Expand All @@ -37,15 +37,37 @@ if ((goggles _unit in (missionNamespace getVariable [QGVAR(availGasmaskList), []
[QGVAR(handleGasMaskDur), _unit, _unit] call CBA_fnc_targetEvent;
};

switch (_gasLevel) do {
case 0: {
_unit setVariable [QGVAR(CSGas), 30, true];
if (random 1 <= GVAR(tearGasDropChance)) then {
[QACEGVAR(hitreactions,dropWeapon), _unit, _unit] call CBA_fnc_targetEvent;
};
if (_gasLevel == 0) exitWith {
_unit setVariable [QGVAR(CSGas), 30, true];
if (random 1 <= GVAR(tearGasDropChance)) then {
[QACEGVAR(hitreactions,dropWeapon), _unit, _unit] call CBA_fnc_targetEvent;
};
case 1: {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
default {};
};

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

if ((_currentInfectionArray findIf { _x isEqualTo _infectedObject}) == -1) then {
_currentInfectionArray append [_infectedObject];
};

_unit setVariable [QGVAR(infectionArray), _currentInfectionArray, true];

//Get max infection time
private _infectionTime = missionNamespace getVariable [QGVAR(infectionTime), 60];

//Get current time left for player
private _currentInfection = _unit getVariable [QGVAR(infectionTime), 60];

private _timeLeft = _currentInfection - 1;
_timeLeft = _timeLeft max 0;

private _newTime = _timeLeft;

if (_currentInfection != _newTime) then {
_unit setVariable [QGVAR(infectionTime), _newTime, true];
};

// Exit if infection reaches 0
if (_newTime <= 0) then {
_unit setVariable [QGVAR(airPoisoning), true, true];
};
12 changes: 8 additions & 4 deletions addons/chemical/functions/fnc_ui_gasModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ if !(isNull attachedTo _logic) then {
};
default {};
};

} else {
[LLSTRING(OnlyObject)] call _fnc_errorAndClose;
};

private _fnc_onUnload = {
Expand Down Expand Up @@ -78,8 +75,15 @@ private _fnc_onConfirm = {
private _gasLevel = _display getVariable [QGVAR(ui_gastype), 0];
private _radius = _display getVariable [QGVAR(ui_radius), 20];
private _isSealable = _display getVariable [QGVAR(ui_sealable), false];
private _center = objNull;

if (isNull attachedTo _logic) then {
_center = _logic;
} else {
_center = attachedTo _logic;
};

[QGVAR(addGasSource), [attachedTo _logic, _radius, _gasLevel, _logic, {
[QGVAR(addGasSource), [_center, _radius, _gasLevel, _logic, {
params ["_endTime", "_logic"];

// If logic no longer exists, exit
Expand Down
2 changes: 1 addition & 1 deletion addons/chemical/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
#define X_PART(num) (W_PART(num) + (safeZoneX + (safeZoneW - SIZEX) / 2))
#define Y_PART(num) (H_PART(num) + (safeZoneY + (safeZoneH - SIZEY) / 2))

#define GAS_MANAGER_PFH_DELAY 0.25
#define GAS_MANAGER_PFH_DELAY 1
Loading

0 comments on commit 16e3874

Please sign in to comment.