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:
bluefield 2024-06-20 22:30:33 +02:00 committed by GitHub
parent c4fb858c1d
commit 1439680795
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 50 additions and 29 deletions

View File

@ -1,5 +0,0 @@
class ACE_Settings {
class GVAR(distanceCoefficient) {
movedToSQF = 1;
};
};

View File

@ -1,14 +1,17 @@
#include "script_component.hpp"
["CBA_settingsInitialized", {
TRACE_1("settingsInit eh",GVAR(distanceCoefficient));
if (GVAR(distanceCoefficient) <= 0) exitWith {};
TRACE_2("settingsInit eh",GVAR(backblastDistanceCoefficient),GVAR(overpressureDistanceCoefficient));
["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler;
// Register fire event handler
["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
// Register fire event handlers
if (GVAR(backblastDistanceCoefficient) > 0) then {
["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler;
};
if (GVAR(overpressureDistanceCoefficient) > 0) then {
["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler;
};
GVAR(cacheHash) = createHashMap;
}] call CBA_fnc_addEventHandler;

View File

@ -14,7 +14,6 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"

View File

@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
_bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"];
_backblastRange = _backblastRange * GVAR(backblastDistanceCoefficient);
TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset);
if (_backblastDamage <= 0) exitWith {};

View File

@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh
private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);
_opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"];
_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient);
TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage);
if (_dangerZoneDamage <= 0) exitWith {};

View File

@ -54,7 +54,7 @@ TRACE_1("ConfigPath",_config);
// get the Variables out of the Configs and populate return array with them
_return = [
(getNumber (_config >> QGVAR(angle))),
(getNumber (_config >> QGVAR(range))) * GVAR(distanceCoefficient),
(getNumber (_config >> QGVAR(range))),
(getNumber (_config >> QGVAR(damage))),
(getNumber (_config >> QGVAR(offset)))
];

View File

@ -1,9 +1,23 @@
private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(DisplayName)];
[
QGVAR(distanceCoefficient), "SLIDER",
QGVAR(overpressureDistanceCoefficient),
"SLIDER",
[LSTRING(distanceCoefficient_displayName), LSTRING(distanceCoefficient_toolTip)],
_category,
[-1, 10, 1, 1],
1
[0, 10, 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;

View File

@ -30,20 +30,26 @@
<Spanish>Coeficiente de distancia de sobrepresión</Spanish>
</Key>
<Key ID="STR_ACE_Overpressure_distanceCoefficient_toolTip">
<English>Scales the overpressure effect [Default: 1]</English>
<German>Stellt den Koeffizient für die Überdruckentfernung ein [Standard: 1]</German>
<Japanese>過圧効果の範囲 [デフォルト: 1]</Japanese>
<Korean>과중압력의 효과 크기 [기본설정: 1]</Korean>
<Polish>Skaluje efekt nadciśnienia [Domyślne: 1]</Polish>
<French>Ajuste l'effet de surpression. Valeur par défaut : 1.</French>
<Italian>Scala l'effetto di sovrapressione [Predefinito: 1]</Italian>
<Chinesesimp>超压影响的范围 [预设1]</Chinesesimp>
<Chinese>高壓影響的範圍 [預設: 1]</Chinese>
<Russian>Степень зависимости избыточного давления от расстояния [По умолчанию: 1]</Russian>
<Portuguese>Escala o efeito de sobrepressão [Padrão: 1]</Portuguese>
<Hungarian>Állítja a túlnyomás hatását [Alapértelmezett: 1]</Hungarian>
<Czech>Nastavuje jak velký je efekt přetlaku [Standard: 1]</Czech>
<Spanish>Escala el efecto de sobrepresión [Predeterminado: 1]</Spanish>
<English>Scales the overpressure effect</English>
<German>Stellt den Koeffizient für die Überdruckentfernung ein</German>
<Japanese>過圧効果の範囲</Japanese>
<Korean>과중압력의 효과 크기</Korean>
<Polish>Skaluje efekt nadciśnienia</Polish>
<French>Ajuste l'effet de surpression</French>
<Italian>Scala l'effetto di sovrapressione</Italian>
<Chinesesimp>超压影响的范围</Chinesesimp>
<Chinese>高壓影響的範圍</Chinese>
<Russian>Степень зависимости избыточного давления от расстояния</Russian>
<Portuguese>Escala o efeito de sobrepressão</Portuguese>
<Hungarian>Állítja a túlnyomás hatását</Hungarian>
<Czech>Nastavuje jak velký je efekt přetlaku</Czech>
<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 ID="STR_ACE_Overpressure_statBackblastRange">
<English>Backblast range</English>