Skip to content

Commit

Permalink
Hearing - Add deafness coefficient for explosions (#10408)
Browse files Browse the repository at this point in the history
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
  • Loading branch information
johnb432 and LinkIsGrim authored Oct 13, 2024
1 parent 5c4b912 commit d9d3e95
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/hearing/functions/fnc_explosion.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (_distance > _maxDistance) exitWith {

private _strength = _vehAttenuation * _explosive * _volume * _maxDistance / _distance^2;

TRACE_2("strength",_volume,_strength);
TRACE_6("strength",_vehAttenuation,_explosive,_volume,_maxDistance,_distance,_strength);

// Call immediately, as it will get picked up later by the update thread anyway
_strength call FUNC(earRinging);
(_strength * GVAR(explosionDeafnessCoefficient)) call FUNC(earRinging);
9 changes: 9 additions & 0 deletions addons/hearing/initSettings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ private _category = format ["ACE %1", LLSTRING(Module_DisplayName)];
true // Needs mission restart
] call CBA_fnc_addSetting;

[
QGVAR(explosionDeafnessCoefficient),
"SLIDER",
[LSTRING(explosionDeafnessCoefficient_DisplayName), LSTRING(explosionDeafnessCoefficient_Description)],
_category,
[0, 5, 1, 2],
1
] call CBA_fnc_addSetting;

[
QGVAR(earplugsVolume),
"SLIDER",
Expand Down
6 changes: 6 additions & 0 deletions addons/hearing/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@
<Chinesesimp>当玩家听力受损时降低听力能力?</Chinesesimp>
<Chinese>當玩家聽力受損時降低聽力能力?</Chinese>
</Key>
<Key ID="STR_ACE_Hearing_explosionDeafnessCoefficient_DisplayName">
<English>Explosion Deafness Coefficient</English>
</Key>
<Key ID="STR_ACE_Hearing_explosionDeafnessCoefficient_Description">
<English>Changes how much deafness explosions cause.\nSetting to 0 will disable explosion hearing damage.</English>
</Key>
<Key ID="STR_ACE_Hearing_Module_Description">
<English>Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection</English>
<Hungarian>Harci süketség engedélyezése?</Hungarian>
Expand Down

0 comments on commit d9d3e95

Please sign in to comment.