mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Overpressure - Separate backblast and overpressure range coefficient (#10070)
* feat: separate overpressure and backblast configurations * documentation: remove undefined return * typo: trace macro padding * refactor: add range<number> return * refactor: reuse return values for overpressure coef * refactor: reuse return values for backblast coef * whitespace Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> * headers Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: change backblast limit to 0 Co-authored-by: PabstMirror <pabstmirror@gmail.com> * remove: deleted ACE_Settings.hpp * fix: update postInit.sqf event handler to register new GVARs * fix: remove `ACE_Settings.hpp` * typo: add spacing Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> * typo: fix spacing Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: switch distanceCoef minimun value to 0 Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * typo: update the slider checks with new minimuns temporary solution until i figure out the EH Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: new stringable elements * Update stringtable.xml * Added translations * Switched order of settings to match age of settings * setting require restart, split adding firedEH * Added notifications about mission restart --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: Drofseh <Drofseh@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
parent
c4fb858c1d
commit
1439680795
@ -1,5 +0,0 @@
|
|||||||
class ACE_Settings {
|
|
||||||
class GVAR(distanceCoefficient) {
|
|
||||||
movedToSQF = 1;
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,14 +1,17 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
["CBA_settingsInitialized", {
|
["CBA_settingsInitialized", {
|
||||||
TRACE_1("settingsInit eh",GVAR(distanceCoefficient));
|
TRACE_2("settingsInit eh",GVAR(backblastDistanceCoefficient),GVAR(overpressureDistanceCoefficient));
|
||||||
if (GVAR(distanceCoefficient) <= 0) exitWith {};
|
|
||||||
|
|
||||||
["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler;
|
["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
// Register fire event handler
|
// Register fire event handlers
|
||||||
|
if (GVAR(backblastDistanceCoefficient) > 0) then {
|
||||||
["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
|
["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
|
||||||
|
};
|
||||||
|
if (GVAR(overpressureDistanceCoefficient) > 0) then {
|
||||||
["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
|
["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
|
||||||
|
};
|
||||||
|
|
||||||
GVAR(cacheHash) = createHashMap;
|
GVAR(cacheHash) = createHashMap;
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
@ -14,7 +14,6 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "ACE_Settings.hpp"
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgWeapons.hpp"
|
#include "CfgWeapons.hpp"
|
||||||
#include "ACE_Arsenal_Stats.hpp"
|
#include "ACE_Arsenal_Stats.hpp"
|
||||||
|
@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
|
|||||||
private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
|
private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
|
||||||
|
|
||||||
_bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"];
|
_bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"];
|
||||||
|
_backblastRange = _backblastRange * GVAR(backblastDistanceCoefficient);
|
||||||
|
|
||||||
TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset);
|
TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset);
|
||||||
|
|
||||||
if (_backblastDamage <= 0) exitWith {};
|
if (_backblastDamage <= 0) exitWith {};
|
||||||
|
@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
|
|||||||
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
|
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
|
||||||
|
|
||||||
_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
|
_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
|
||||||
|
_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient);
|
||||||
|
|
||||||
TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
|
TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
|
||||||
|
|
||||||
if (_dangerZoneDamage <= 0) exitWith {};
|
if (_dangerZoneDamage <= 0) exitWith {};
|
||||||
|
@ -54,7 +54,7 @@ TRACE_1("ConfigPath",_config);
|
|||||||
// get the Variables out of the Configs and populate return array with them
|
// get the Variables out of the Configs and populate return array with them
|
||||||
_return = [
|
_return = [
|
||||||
(getNumber (_config >> QGVAR(angle))),
|
(getNumber (_config >> QGVAR(angle))),
|
||||||
(getNumber (_config >> QGVAR(range))) * GVAR(distanceCoefficient),
|
(getNumber (_config >> QGVAR(range))),
|
||||||
(getNumber (_config >> QGVAR(damage))),
|
(getNumber (_config >> QGVAR(damage))),
|
||||||
(getNumber (_config >> QGVAR(offset)))
|
(getNumber (_config >> QGVAR(offset)))
|
||||||
];
|
];
|
||||||
|
@ -1,9 +1,23 @@
|
|||||||
private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(DisplayName)];
|
private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(DisplayName)];
|
||||||
|
|
||||||
[
|
[
|
||||||
QGVAR(distanceCoefficient), "SLIDER",
|
QGVAR(overpressureDistanceCoefficient),
|
||||||
|
"SLIDER",
|
||||||
[LSTRING(distanceCoefficient_displayName), LSTRING(distanceCoefficient_toolTip)],
|
[LSTRING(distanceCoefficient_displayName), LSTRING(distanceCoefficient_toolTip)],
|
||||||
_category,
|
_category,
|
||||||
[-1, 10, 1, 1],
|
[0, 10, 1, 1],
|
||||||
1
|
1,
|
||||||
|
{[QGVAR(overpressureDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||||
|
true // Needs mission restart
|
||||||
|
] call CBA_fnc_addSetting;
|
||||||
|
|
||||||
|
[
|
||||||
|
QGVAR(backblastDistanceCoefficient),
|
||||||
|
"SLIDER",
|
||||||
|
[LSTRING(backblastDistanceCoefficient_displayName), LSTRING(backblastDistanceCoefficient_toolTip)],
|
||||||
|
_category,
|
||||||
|
[0, 10, 1, 1],
|
||||||
|
1,
|
||||||
|
{[QGVAR(backblastDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)},
|
||||||
|
true // Needs mission restart
|
||||||
] call CBA_fnc_addSetting;
|
] call CBA_fnc_addSetting;
|
||||||
|
@ -30,20 +30,26 @@
|
|||||||
<Spanish>Coeficiente de distancia de sobrepresión</Spanish>
|
<Spanish>Coeficiente de distancia de sobrepresión</Spanish>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Overpressure_distanceCoefficient_toolTip">
|
<Key ID="STR_ACE_Overpressure_distanceCoefficient_toolTip">
|
||||||
<English>Scales the overpressure effect [Default: 1]</English>
|
<English>Scales the overpressure effect</English>
|
||||||
<German>Stellt den Koeffizient für die Überdruckentfernung ein [Standard: 1]</German>
|
<German>Stellt den Koeffizient für die Überdruckentfernung ein</German>
|
||||||
<Japanese>過圧効果の範囲 [デフォルト: 1]</Japanese>
|
<Japanese>過圧効果の範囲</Japanese>
|
||||||
<Korean>과중압력의 효과 크기 [기본설정: 1]</Korean>
|
<Korean>과중압력의 효과 크기</Korean>
|
||||||
<Polish>Skaluje efekt nadciśnienia [Domyślne: 1]</Polish>
|
<Polish>Skaluje efekt nadciśnienia</Polish>
|
||||||
<French>Ajuste l'effet de surpression. Valeur par défaut : 1.</French>
|
<French>Ajuste l'effet de surpression</French>
|
||||||
<Italian>Scala l'effetto di sovrapressione [Predefinito: 1]</Italian>
|
<Italian>Scala l'effetto di sovrapressione</Italian>
|
||||||
<Chinesesimp>超压影响的范围 [预设:1]</Chinesesimp>
|
<Chinesesimp>超压影响的范围</Chinesesimp>
|
||||||
<Chinese>高壓影響的範圍 [預設: 1]</Chinese>
|
<Chinese>高壓影響的範圍</Chinese>
|
||||||
<Russian>Степень зависимости избыточного давления от расстояния [По умолчанию: 1]</Russian>
|
<Russian>Степень зависимости избыточного давления от расстояния</Russian>
|
||||||
<Portuguese>Escala o efeito de sobrepressão [Padrão: 1]</Portuguese>
|
<Portuguese>Escala o efeito de sobrepressão</Portuguese>
|
||||||
<Hungarian>Állítja a túlnyomás hatását [Alapértelmezett: 1]</Hungarian>
|
<Hungarian>Állítja a túlnyomás hatását</Hungarian>
|
||||||
<Czech>Nastavuje jak velký je efekt přetlaku [Standard: 1]</Czech>
|
<Czech>Nastavuje jak velký je efekt přetlaku</Czech>
|
||||||
<Spanish>Escala el efecto de sobrepresión [Predeterminado: 1]</Spanish>
|
<Spanish>Escala el efecto de sobrepresión</Spanish>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Overpressure_backblastDistanceCoefficient_displayName">
|
||||||
|
<English>Backblast Distance Coefficient</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Overpressure_backblastDistanceCoefficient_toolTip">
|
||||||
|
<English>Scales the backblast effect</English>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Overpressure_statBackblastRange">
|
<Key ID="STR_ACE_Overpressure_statBackblastRange">
|
||||||
<English>Backblast range</English>
|
<English>Backblast range</English>
|
||||||
|
Loading…
Reference in New Issue
Block a user