Skip to content

Commit

Permalink
Breathing - Add Stamina Condition for Chemical Masks (#702)
Browse files Browse the repository at this point in the history
**When merged this pull request will:**
- Adds stamina condition for chemical masks
- Add setting to disable condition

### 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}`.

---------

Co-authored-by: MiszczuZPolski <71414303+MiszczuZPolski@users.noreply.github.com>
  • Loading branch information
mazinskihenry and MiszczuZPolski authored Jan 15, 2025
1 parent 8c0e419 commit 4f2d6c6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions addons/breathing/functions/fnc_handleBreathingConditions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,17 @@ params ["_unit"];
["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor);
};
};

if (EGVAR(chemical,maskStaminaLoss)) then {
if (goggles _target in (missionNamespace getVariable [QGVAR(availGasmaskList), []])) then {
if (ACEGVAR(advanced_fatigue,enabled)) then {
["kat_CMSK", 1.5] call ACEFUNC(advanced_fatigue,addDutyFactor);
} else {
_unit setStamina(getStamina _unit - 3);
};
} else {
["kat_CMSK"] call ACEFUNC(advanced_fatigue,removeDutyFactor);
};
};

}, 10, [_unit]] call CBA_fnc_addPerFrameHandler;
10 changes: 10 additions & 0 deletions addons/chemical/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ PREP_RECOMPILE_END;
false
] call CBA_Settings_fnc_init;

// Should gas mask affect stamina
[
QGVAR(maskStaminaLoss),
"CHECKBOX",
[LLSTRING(SETTING_gasMaskStaminaLoss)],
CBA_SETTINGS_CHEM,
[false],
true
] call CBA_Settings_fnc_init;

// Chance of weapon drop by tear gas
[
QGVAR(tearGasDropChance),
Expand Down
3 changes: 3 additions & 0 deletions addons/chemical/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -920,5 +920,8 @@
<Chinesesimp>确定在催泪瓦斯中投掷武器的几率</Chinesesimp>
<German>Bestimmt die Wahrscheinlichkeit, die Waffe zu verlieren, während man unter dem Einfluss von Tränengas steht</German>
</Key>
<Key ID="STR_KAT_Chemical_SETTING_gasMaskStaminaLoss">
<English>Enable Stamina Loss when using Gas Mask</English>
</Key>
</Package>
</Project>

0 comments on commit 4f2d6c6

Please sign in to comment.