mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
DisableEarRinging / Cleanup
This commit is contained in:
parent
d11fa939e1
commit
c27afca485
@ -30,7 +30,7 @@ GVAR(time4) = 0;
|
||||
GVAR(deafnessDV) = 0;
|
||||
GVAR(deafnessPrior) = 0;
|
||||
ACE_player setvariable [QGVAR(deaf), false];
|
||||
|
||||
|
||||
GVAR(beep) = false;
|
||||
GVAR(beep2) = false;
|
||||
GVAR(time2) = 0;
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (GVAR(DisableEarRinging)) exitWith {};
|
||||
if (!GVAR(enableCombatDeafness)) exitWith {};
|
||||
|
||||
PARAMS_2(_unit,_strength);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: esteldunedain
|
||||
* Initializes the Map module.
|
||||
* Initializes the Hearing module.
|
||||
*
|
||||
* Arguments:
|
||||
* Whatever the module provides. (I dunno.)
|
||||
@ -16,4 +16,4 @@ if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
diag_log text "[ACE]: Interaction Module Initialized.";
|
||||
diag_log text "[ACE]: Hearing Module Initialized.";
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private["_Volume"];
|
||||
|
||||
GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0;
|
||||
|
||||
//If we got a big increase in the last second:
|
||||
@ -22,7 +24,7 @@ if ((GVAR(deafnessDV) - GVAR(deafnessPrior)) > 2) then {
|
||||
if (ACE_time > GVAR(time3)) then {
|
||||
GVAR(beep2) = false;
|
||||
};
|
||||
if (!GVAR(beep2)) then {
|
||||
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep2)}) then {
|
||||
playSound "ACE_Combat_Deafness";
|
||||
GVAR(beep2) = true;
|
||||
GVAR(time3) = ACE_time + 5;
|
||||
@ -34,7 +36,7 @@ GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0;
|
||||
|
||||
if (GVAR(deafnessDV) > 19.75) then {
|
||||
ACE_player setvariable [QGVAR(deaf), true];
|
||||
if (ACE_time > GVAR(time4)) then {
|
||||
if ((!GVAR(DisableEarRinging)) && {ACE_time > GVAR(time4)}) then {
|
||||
playSound "ACE_Combat_Deafness";
|
||||
GVAR(beep2) = true;
|
||||
GVAR(time3) = ACE_time + 10;
|
||||
@ -49,7 +51,7 @@ if (GVAR(deafnessDV) > 10) then {
|
||||
if (ACE_time > GVAR(time2)) then {
|
||||
GVAR(beep) = false;
|
||||
};
|
||||
if (!GVAR(beep)) then {
|
||||
if ((!GVAR(DisableEarRinging)) && {!GVAR(beep)}) then {
|
||||
playSound "ACE_Ring_Backblast";
|
||||
GVAR(time2) = ACE_time + 22;
|
||||
GVAR(beep) = true;
|
||||
@ -59,7 +61,7 @@ if (GVAR(deafnessDV) > 10) then {
|
||||
// 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;
|
||||
|
||||
systemChat format ["%1 - %2/%3", time, GVAR(deafnessDV), GVAR(volume)];
|
||||
TRACE_3("tick", GVAR(deafnessPrior), GVAR(deafnessDV), GVAR(volume));
|
||||
|
||||
_volume = GVAR(volume);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user