New loudness calculation for different ammo types

This commit is contained in:
ulteq 2015-06-13 18:19:35 +02:00
parent db68b6c155
commit 38dca2bb9e
2 changed files with 12 additions and 6 deletions

View File

@ -12,7 +12,7 @@ class CfgSounds {
titles[] = {};
};
class ACE_Combat_Deafness {
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),1,1};
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),2,1};
titles[] = {};
};
class ACE_Ring_Backblast {

View File

@ -50,16 +50,22 @@ if (_silencer != "") then {
_magazine = (getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0;
_initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
_ammoConfig = (configFile >> "CfgAmmo" >> _ammo);
_caliber = getNumber(_ammoConfig >> "ACE_caliber");
_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents;
if ("RocketBase" in _parentClasses || "MissileBase" in _parentClasses) then {
_caliber = 200;
} else {
if (_caliber <= 0) then { _caliber = 6.5; };
_caliber = getNumber(_ammoConfig >> "ACE_caliber");
_caliber = switch (true) do {
case ("ShellBase" in _parentClasses): { 80 };
case ("RocketBase" in _parentClasses): { 200 };
case ("MissileBase" in _parentClasses): { 600 };
case ("SubmunitionBase" in _parentClasses): { 80 };
default {
if (_caliber <= 0) then { 6.5 } else { _caliber };
};
};
_loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5;
_strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off
//systemChat format["%1 : %2 : %3", _strength, _initSpeed, _parentClasses];
if (_strength < 0.01) exitWith {};
[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);