Skip to content

Commit

Permalink
Hearing - Tweak EHP effects, add 🦆ing setting (#10686)
Browse files Browse the repository at this point in the history
Tweak EHP effects, add setting
  • Loading branch information
BaerMitUmlaut authored Jan 28, 2025
1 parent c702a18 commit 9010fe5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions addons/hearing/functions/fnc_earRinging.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TRACE_2("adding",_strength * GVAR(damageCoefficent),GVAR(deafnessDV));
// Handle volume reduction by electronic hearing protection
if (
_strength >= EHP_MIN_STRENGTH
&& GVAR(enableNoiseDucking)
&& {ACE_player getVariable ["ACE_hasEHP", false] || {ACE_player getVariable ["ACE_hasBuiltInEHP", false]}}
) then {
if (GVAR(ehpTimeout) == -1) then {
Expand Down
2 changes: 1 addition & 1 deletion addons/hearing/functions/fnc_removeEHP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if !([_unit, "ACE_EHP"] call CBA_fnc_canAddItem) exitWith {
[LELSTRING(common,Inventory_Full)] call EFUNC(common,displayTextStructured);
};

// Plugs already in and removing them.
// EHP already in and removing them.
_unit addItem "ACE_EHP";

_unit setVariable ["ACE_hasEHP", false, true];
Expand Down
8 changes: 8 additions & 0 deletions addons/hearing/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ private _category = format ["ACE %1", LLSTRING(Module_DisplayName)];
[[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(heavyWeaponUnits), ELSTRING(common,Enabled)], 1],
1
] call CBA_fnc_addSetting;

[
QGVAR(enableNoiseDucking),
"CHECKBOX",
[LSTRING(EnableNoiseDucking_DisplayName), LSTRING(EnableNoiseDucking_Description)],
_category,
true
] call CBA_fnc_addSetting;
6 changes: 3 additions & 3 deletions addons/hearing/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#define UPDATE_HEARING -1

// Electronic hearing protection FX
#define EHP_REDUCTION 0.125
#define EHP_REDUCTION 0.3
#define EHP_MIN_STRENGTH 0.07
#define EHP_TIMEOUT 0.7
#define EHP_FADE_IN 0.1
#define EHP_TIMEOUT 0.6
#define EHP_FADE_IN 0.25

// Vehicle explosion hearing damage
#define VEHICLE_EXPLOSION_STRENGTH 200
Expand Down
8 changes: 8 additions & 0 deletions addons/hearing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -487,5 +487,13 @@
<Chinese>昏迷時音量</Chinese>
<Chinesesimp>无意识时音量</Chinesesimp>
</Key>
<Key ID="STR_ACE_Hearing_EnableNoiseDucking_Description">
<English>Reduces volume of impulse noises like shots and explosions when wearing electronic hearing protection</English>
<German>Blendet Impulsgeräusche wie Schüsse oder Explosionen beim Tragen von elektronischem Gehörschutz aus</German>
</Key>
<Key ID="STR_ACE_Hearing_EnableNoiseDucking_DisplayName">
<English>Enable Noise Ducking Effect</English>
<German>Aktiviere Geräuschunterdrückungseffekt</German>
</Key>
</Package>
</Project>

0 comments on commit 9010fe5

Please sign in to comment.