Reorder the fireEH function to allow particle effects for nearby remote players. Add a setting for that (default off).

This commit is contained in:
esteldunedain 2016-01-19 17:24:01 -03:00
parent 8b7ed38990
commit 9bcabd081b
3 changed files with 37 additions and 17 deletions

View File

@ -13,6 +13,13 @@ class ACE_Settings {
displayName = CSTRING(showParticleEffects_displayName);
description = CSTRING(showParticleEffects_description);
};
class GVAR(showParticleEffectsForEveryone) {
typeName = "BOOL";
isClientSettable = 1;
value = 0;
displayName = CSTRING(showParticleEffectsForEveryone_displayName);
description = CSTRING(showParticleEffectsForEveryone_description);
};
class GVAR(overheatingDispersion) {
typeName = "BOOL";
value = 1;

View File

@ -88,24 +88,11 @@ if (GVAR(overheatingDispersion)) then {
TRACE_PROJECTILE_INFO(_projectile);
};
// ------ LOCAL PLAYER ONLY ------------
// Only compute jamming and show Visual Effects for the local player
if (_unit != ACE_player) exitWith {END_COUNTER(firedEH);};
_jamChance = _jamChance * ([[0.5, 1.5, 7.5, 37.5], 3 * _scaledTemperature] call EFUNC(common,interpolateFromArray));
// increase jam chance on dusty grounds if prone (and at ground level)
if ((stance _unit == "PRONE") && {((getPosATL _unit) select 2) < 1}) then {
private _surface = configFile >> "CfgSurfaces" >> ((surfaceType getPosASL _unit) select [1]);
if (isClass _surface) then {
TRACE_1("dust",getNumber (_surface >> "dust"));
_jamChance = _jamChance + (getNumber (_surface >> "dust")) * _jamChance;
};
};
TRACE_3("check for random jam",_unit,_weapon,_jamChance);
if ((random 1) < _jamChance) then {
[_unit, _weapon] call FUNC(jamWeapon);
// ------ LOCAL AND NEARBY PLAYERS DEPENDING ON SETTINGS ------------
// Particle effects only apply to the local player and, depending on settings, to other nearby players
if (_unit != ACE_player && (!GVAR(showParticleEffectsForEveryone) || {_unit distance ACE_player > 20})) exitWith {
END_COUNTER(firedEH);
};
//Particle Effects:
@ -134,4 +121,24 @@ if (GVAR(showParticleEffects) && {(ACE_time > ((_unit getVariable [QGVAR(lastDro
};
};
// ------ LOCAL PLAYER ONLY ------------
// Only compute jamming for the local player
if (_unit != ACE_player) exitWith {END_COUNTER(firedEH);};
_jamChance = _jamChance * ([[0.5, 1.5, 7.5, 37.5], 3 * _scaledTemperature] call EFUNC(common,interpolateFromArray));
// increase jam chance on dusty grounds if prone (and at ground level)
if ((stance _unit == "PRONE") && {((getPosATL _unit) select 2) < 1}) then {
private _surface = configFile >> "CfgSurfaces" >> ((surfaceType getPosASL _unit) select [1]);
if (isClass _surface) then {
TRACE_1("dust",getNumber (_surface >> "dust"));
_jamChance = _jamChance + (getNumber (_surface >> "dust")) * _jamChance;
};
};
TRACE_3("check for random jam",_unit,_weapon,_jamChance);
if ((random 1) < _jamChance) then {
[_unit, _weapon] call FUNC(jamWeapon);
};
END_COUNTER(firedEH);

View File

@ -31,6 +31,12 @@
<Key ID="STR_ACE_Overheating_showParticleEffects_description">
<English>Show particle effects when weapon overheats</English>
</Key>
<Key ID="showParticleEffectsForEveryone_displayName">
<English>Overheating Particle Effects for everyone</English>
</Key>
<Key ID="showParticleEffectsForEveryone_description">
<English>Show particle effects when other players weapon overheats</English>
</Key>
<Key ID="STR_ACE_Overheating_overheatingDispersion_displayName">
<English>Overheating Dispersion</English>
</Key>