1+ #include " ..\script_component.hpp"
2+ /*
3+ * Author: JetfireBlack
4+ * Checks if respirator interactions should be shown based on equipment combinations
5+ *
6+ * Arguments:
7+ * 0: mode <STRING>
8+ *
9+ * Return Value:
10+ * Should interaction be shown? <BOOL>
11+ *
12+ * Example:
13+ * ["combo"] call ace_goggles_fnc_respiratorConditions
14+ *
15+ * Public: yes
16+ */
17+
118private _unit = ACE_player;
219
320if (! local _unit ) exitWith {false };
421
5- private _mode = _this ;
22+ params [ " _mode" ] ;
623
724private _goggles = goggles _unit ;
825private _backpack = backpackContainer _unit ;
926private _backpackType = backpack _unit ;
1027private _objectTextures = getObjectTextures _backpack ;
1128private _showAction = false ;
1229
30+ // Contact DLC respirators
1331private _allowedGoggles = [
1432 " G_AirPurifyingRespirator_01_F" ,
1533 " G_AirPurifyingRespirator_01_nofilter_F" ,
@@ -21,6 +39,7 @@ private _allowedGoggles = [
2139 " G_AirPurifyingRespirator_02_sand_nofilter_F" ,
2240 " G_RegulatorMask_F"
2341 ];
42+ // Contact DLC respirator backpacks
2443private _allowedBackpacks = [
2544 " B_CombinationUnitRespirator_01_F" ,
2645 " B_SCBA_01_F"
@@ -29,17 +48,20 @@ private _allowedBackpacks = [
2948if (isNull _backpack || {! (_backpackType in _allowedBackpacks )}) then {_objectTextures = [" " ," " ," " ," " ," " ]};
3049
3150switch _mode do {
51+ // only show when appropriate respirator and backpack are worn
3252 case " combo" : {
3353 if ! (_goggles in _allowedGoggles ) exitWith {};
3454 if ! (_backpackType in _allowedBackpacks ) exitWith {};
3555 if (_objectTextures #1 isNotEqualTo " " || _objectTextures #2 isNotEqualTo " " ) exitWith {};
3656 _showAction = true ;
3757 };
58+ // always show when wearing mask with filters
3859 case " mask" : {
3960 if ! (_goggles in (_allowedGoggles - [" G_RegulatorMask_F" ])) exitWith {};
4061 if (_objectTextures #1 isNotEqualTo " " || _objectTextures #2 isNotEqualTo " " ) exitWith {};
4162 _showAction = true ;
4263 };
64+ // shown only when hose is present regardless of respirator (Arma does not dynamically remove the hose)
4365 case " hose" : {
4466 if ! (_backpackType in _allowedBackpacks ) exitWith {};
4567 if ! (_objectTextures #1 isNotEqualTo " " || _objectTextures #2 isNotEqualTo " " ) exitWith {};
0 commit comments