mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Overhaul ACE_Hearing and change default settings.
This commit is contained in:
parent
d69af47030
commit
2f1e96ae4f
@ -2,8 +2,8 @@ class ACE_Settings {
|
||||
class GVAR(EnableCombatDeafness) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(CombatDeafness_DisplayName);
|
||||
description = CSTRING(CombatDeafness_Description);
|
||||
displayName = CSTRING(EnableCombatDeafness_DisplayName);
|
||||
description = CSTRING(EnableCombatDeafness_Description);
|
||||
};
|
||||
class GVAR(EarplugsVolume) {
|
||||
value = 0.5;
|
||||
@ -17,7 +17,8 @@ class ACE_Settings {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(DisableEarRinging);
|
||||
displayName = CSTRING(DisableEarRinging_DisplayName);
|
||||
description = CSTRING(DisableEarRinging_Description);
|
||||
};
|
||||
class GVAR(enabledForZeusUnits) {
|
||||
value = 1;
|
||||
|
@ -11,9 +11,21 @@ class CfgSounds {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\ACE_earringing_heavy.wav)),8,1.7};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Combat_Deafness {
|
||||
class ACE_Combat_Deafness_Heavy {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),8,1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Combat_Deafness_Medium {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),3,1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Combat_Deafness_Heavy_NoRing {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\deafness_noring.ogg)),8,1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Combat_Deafness_Medium_NoRing {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\deafness_noring.ogg)),3,1};
|
||||
titles[] = {};
|
||||
};
|
||||
class ACE_Ring_Backblast {
|
||||
sound[] = {QUOTE(PATHTOF(sounds\backblast_ring.ogg)),1,1};
|
||||
|
@ -103,13 +103,14 @@ class CfgVehicles {
|
||||
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
|
||||
class Arguments {
|
||||
class EnableCombatDeafness {
|
||||
displayName = CSTRING(CombatDeafness_DisplayName);
|
||||
description = CSTRING(CombatDeafness_Description);
|
||||
displayName = CSTRING(EnableCombatDeafness_DisplayName);
|
||||
description = CSTRING(EnableCombatDeafness_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class DisableEarRinging {
|
||||
displayName = CSTRING(DisableEarRinging);
|
||||
displayName = CSTRING(DisableEarRinging_DisplayName);
|
||||
description = CSTRING(DisableEarRinging_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class DoNotForce {
|
||||
|
@ -9,12 +9,7 @@ GVAR(deafnessDV) = 0;
|
||||
GVAR(deafnessPrior) = 0;
|
||||
GVAR(volume) = 1;
|
||||
GVAR(playerVehAttenuation) = 1;
|
||||
|
||||
GVAR(beep) = false;
|
||||
GVAR(beep2) = false;
|
||||
GVAR(time2) = 0;
|
||||
GVAR(time3) = 0;
|
||||
GVAR(time4) = 0;
|
||||
|
||||
["SettingsInitialized", {
|
||||
// Spawn volume updating process
|
||||
@ -30,10 +25,5 @@ GVAR(time4) = 0;
|
||||
GVAR(deafnessDV) = 0;
|
||||
GVAR(deafnessPrior) = 0;
|
||||
ACE_player setVariable [QGVAR(deaf), false];
|
||||
|
||||
GVAR(beep) = false;
|
||||
GVAR(beep2) = false;
|
||||
GVAR(time2) = 0;
|
||||
GVAR(time3) = 0;
|
||||
GVAR(time4) = 0;
|
||||
}] call EFUNC(common,addEventhandler);
|
||||
|
@ -16,8 +16,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//Only run if deafness or ear ringing is enabled:
|
||||
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
|
||||
// Only run if combat deafness is enabled
|
||||
if (!GVAR(EnableCombatDeafness)) exitWith {};
|
||||
|
||||
params ["_unit", "_damage"];
|
||||
|
||||
@ -29,4 +29,5 @@ private ["_strength"];
|
||||
_strength = (0 max _damage) * 30;
|
||||
if (_strength < 0.01) exitWith {};
|
||||
|
||||
[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2] call EFUNC(common,waitAndExecute);
|
||||
// Call inmediately, as it will get pick up later anyway by the update thread
|
||||
[ACE_player, _strength] call FUNC(earRinging);
|
||||
|
@ -22,8 +22,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//Only run if deafness or ear ringing is enabled:
|
||||
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
|
||||
// Only run if combat deafness is enabled
|
||||
if (!GVAR(EnableCombatDeafness)) exitWith {};
|
||||
|
||||
params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"];
|
||||
|
||||
@ -97,4 +97,5 @@ TRACE_1("result",_strength);
|
||||
|
||||
if (_strength < 0.01) exitWith {};
|
||||
|
||||
[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2] call EFUNC(common,waitAndExecute);
|
||||
// Call inmediately, as it will get pick up later anyway by the update thread
|
||||
[ACE_player, _strength] call FUNC(earRinging);
|
||||
|
@ -12,13 +12,12 @@
|
||||
|
||||
params ["_logic"];
|
||||
|
||||
[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(EnableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
// Do Not Force - read module setting only non-default is set due to using SCALAR
|
||||
if ((_logic getVariable "DisableEarRinging") != -1) then {
|
||||
[_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule);
|
||||
};
|
||||
|
||||
[_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(autoAddEarplugsToUnits), "autoAddEarplugsToUnits"] call EFUNC(common,readSettingFromModule);
|
||||
ACE_LOGINFO("Hearing Module Initialized.");
|
||||
|
@ -16,54 +16,32 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//Only run if deafness or ear ringing is enabled:
|
||||
if ((!GVAR(enableCombatDeafness)) && GVAR(DisableEarRinging)) exitWith {};
|
||||
// Only run if combat deafness is enabled
|
||||
if (!GVAR(EnableCombatDeafness)) exitWith {};
|
||||
|
||||
(_this select 0) params ["_justUpdateVolume"];
|
||||
|
||||
|
||||
GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0;
|
||||
GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0;
|
||||
GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0.05;
|
||||
player sideChat format ["Vol: %1, Def: %2, DeltaDef: %3", GVAR(volume), GVAR(deafnessDV), GVAR(deafnessDV) - GVAR(deafnessPrior)];
|
||||
|
||||
if (!_justUpdateVolume) then {
|
||||
//If we got a big increase in the last second:
|
||||
if ((GVAR(deafnessDV) - GVAR(deafnessPrior)) > 2) then {
|
||||
if (ACE_time > GVAR(time3)) then {
|
||||
GVAR(beep2) = false;
|
||||
};
|
||||
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep2)}) then {
|
||||
playSound "ACE_Combat_Deafness";
|
||||
GVAR(beep2) = true;
|
||||
GVAR(time3) = ACE_time + 5;
|
||||
// Ring if we got a big increase in the last second or enough accumulated damage
|
||||
if (GVAR(deafnessDV) - GVAR(deafnessPrior) > 1 ||
|
||||
GVAR(deafnessDV) > 10) then {
|
||||
|
||||
if (ACE_time - GVAR(time3) < 3) exitWith {};
|
||||
GVAR(time3) = ACE_time;
|
||||
|
||||
if (GVAR(deafnessDV) > 19.75) then {
|
||||
playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(DisableEarRinging));
|
||||
} else {
|
||||
playSound (["ACE_Combat_Deafness_Medium", "ACE_Combat_Deafness_Medium_NoRing"] select GVAR(DisableEarRinging));
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(deafnessPrior) = GVAR(deafnessDV);
|
||||
|
||||
if (GVAR(deafnessDV) > 19.75) then {
|
||||
ACE_player setVariable [QGVAR(deaf), true];
|
||||
if ((!GVAR(DisableEarRinging)) && {ACE_time > GVAR(time4)}) then {
|
||||
playSound "ACE_Combat_Deafness";
|
||||
GVAR(beep2) = true;
|
||||
GVAR(time3) = ACE_time + 10;
|
||||
GVAR(time4) = ACE_time + 30;
|
||||
};
|
||||
} else {
|
||||
ACE_player setVariable [QGVAR(deaf), false];
|
||||
};
|
||||
|
||||
if (GVAR(deafnessDV) > 10) then {
|
||||
//check if the ringing is already being played
|
||||
if (ACE_time > GVAR(time2)) then {
|
||||
GVAR(beep) = false;
|
||||
};
|
||||
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep)}) then {
|
||||
playSound "ACE_Ring_Backblast";
|
||||
GVAR(time2) = ACE_time + 22;
|
||||
GVAR(beep) = true;
|
||||
};
|
||||
};
|
||||
|
||||
// Hearing takes longer to return to normal after it hits rock bottom
|
||||
GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0;
|
||||
};
|
||||
|
BIN
addons/hearing/sounds/deafness_noring.ogg
Normal file
BIN
addons/hearing/sounds/deafness_noring.ogg
Normal file
Binary file not shown.
@ -97,7 +97,7 @@
|
||||
<Hungarian>Nincs több hely</Hungarian>
|
||||
<Russian>Нет места в инвентаре</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_DisableEarRinging">
|
||||
<Key ID="STR_ACE_Hearing_DisableEarRinging_DisplayName">
|
||||
<English>Disable ear ringing</English>
|
||||
<French>Désactiver le bourdonnement</French>
|
||||
<Spanish>Desactivar zumbido de oídos</Spanish>
|
||||
@ -108,6 +108,8 @@
|
||||
<Hungarian>Fülcsengés letiltása</Hungarian>
|
||||
<Italian>Disabilita i fischi nelle orecchie</Italian>
|
||||
<Portuguese>Desabilitar zumbido de ouvidos</Portuguese>
|
||||
<Key ID="STR_ACE_Hearing_DisableEarRinging_Description">
|
||||
<English>Remove tinnitus effect when the player takes hearing damage</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_Module_DisplayName">
|
||||
<English>Hearing</English>
|
||||
@ -120,10 +122,10 @@
|
||||
<Hungarian>Hallás</Hungarian>
|
||||
<Russian>Слух</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_CombatDeafness_DisplayName">
|
||||
<English>Combat Deafness</English>
|
||||
<Key ID="STR_ACE_Hearing_EnableCombatDeafness_DisplayName">
|
||||
<English>Enable Combat Deafness</English>
|
||||
<Polish>Wł. głuchotę bojową</Polish>
|
||||
<Spanish>¿Habilitar sordera de combate?</Spanish>
|
||||
<Spanish>Habilitar sordera de combate</Spanish>
|
||||
<German>Aktiviere Taubheit im Gefecht?</German>
|
||||
<Czech>Povolit ztrátu sluchu?</Czech>
|
||||
<Portuguese>Ativar surdez em combate?</Portuguese>
|
||||
@ -131,7 +133,7 @@
|
||||
<Hungarian>Harci süketség engedélyezése?</Hungarian>
|
||||
<Russian>Оглушение</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_CombatDeafness_Description">
|
||||
<Key ID="STR_ACE_Hearing_EnableCombatDeafness_Description">
|
||||
<English>Reduces the hearing ability as the player takes hearing damage</English>
|
||||
<Polish>Możliwość chwilowej utraty słuchu przy głośnych wystrzałach i jednoczesnym braku włożonych stoperów</Polish>
|
||||
<Spanish>Habilita la sordera de combate</Spanish>
|
||||
|
Loading…
Reference in New Issue
Block a user