Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hearing - Add deafness coefficient for explosions #10408

Merged
merged 2 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
johnb432 marked this conversation as resolved.
Show resolved Hide resolved
] 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
Loading