mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
New loudness calculation for different ammo types
This commit is contained in:
parent
db68b6c155
commit
38dca2bb9e
@ -12,7 +12,7 @@ class CfgSounds {
|
|||||||
titles[] = {};
|
titles[] = {};
|
||||||
};
|
};
|
||||||
class ACE_Combat_Deafness {
|
class ACE_Combat_Deafness {
|
||||||
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),1,1};
|
sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),2,1};
|
||||||
titles[] = {};
|
titles[] = {};
|
||||||
};
|
};
|
||||||
class ACE_Ring_Backblast {
|
class ACE_Ring_Backblast {
|
||||||
|
@ -50,16 +50,22 @@ if (_silencer != "") then {
|
|||||||
_magazine = (getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0;
|
_magazine = (getArray(configFile >> "CfgWeapons" >> _weapon >> "magazines")) select 0;
|
||||||
_initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
|
_initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
|
||||||
_ammoConfig = (configFile >> "CfgAmmo" >> _ammo);
|
_ammoConfig = (configFile >> "CfgAmmo" >> _ammo);
|
||||||
_caliber = getNumber(_ammoConfig >> "ACE_caliber");
|
|
||||||
_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents;
|
_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents;
|
||||||
if ("RocketBase" in _parentClasses || "MissileBase" in _parentClasses) then {
|
_caliber = getNumber(_ammoConfig >> "ACE_caliber");
|
||||||
_caliber = 200;
|
_caliber = switch (true) do {
|
||||||
} else {
|
case ("ShellBase" in _parentClasses): { 80 };
|
||||||
if (_caliber <= 0) then { _caliber = 6.5; };
|
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;
|
_loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5;
|
||||||
_strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off
|
_strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off
|
||||||
|
|
||||||
|
//systemChat format["%1 : %2 : %3", _strength, _initSpeed, _parentClasses];
|
||||||
|
|
||||||
if (_strength < 0.01) exitWith {};
|
if (_strength < 0.01) exitWith {};
|
||||||
|
|
||||||
[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);
|
[{_this call FUNC(earRinging)}, [ACE_player, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);
|
||||||
|
Loading…
Reference in New Issue
Block a user