Skip to content

Commit

Permalink
Overpressure - Add editor range attribute for vehicles (acemod#10411)
Browse files Browse the repository at this point in the history
* feat: overpressure settings

note: doesnt work yet

* fix: stuff

* feat: overpressure slider

it works fine now

* style: remove macro padding

* doc: fix typo

* lint: fix tabs

* refactor: switch slider attribute to text attribute & add -1 check.

* fix: change to localized strings

* fix: typo

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* feat: rename CfgEden

* Rename: part 1

* Rename: Part 2

* Update addons/overpressure/CfgEden.hpp

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: Grim <[email protected]>

* Update config.cpp

Signed-off-by: bluefield <[email protected]>

* Update AUTHORS.txt

Signed-off-by: bluefield <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: PabstMirror <[email protected]>

* Update addons/overpressure/CfgEden.hpp

Co-authored-by: PabstMirror <[email protected]>

* Update addons/overpressure/functions/fnc_firedEHOP.sqf

Co-authored-by: PabstMirror <[email protected]>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <[email protected]>

* Update fnc_firedEHOP.sqf

Signed-off-by: bluefield <[email protected]>

---------

Signed-off-by: bluefield <[email protected]>
Co-authored-by: Grim <[email protected]>
Co-authored-by: PabstMirror <[email protected]>
  • Loading branch information
3 people authored Oct 22, 2024
1 parent 3773684 commit c87e2cb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Barman75
Bla1337
BlackPixxel <[email protected]>
BlackQwar
Bluefield <[email protected]>
Brakoviejo
Brisse <[email protected]>
Brostrom.A | Evul <[email protected]>
Expand Down
21 changes: 21 additions & 0 deletions addons/overpressure/CfgEden.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Cfg3DEN {
class Object {
class AttributeCategories {
class ace_attributes {
class Attributes {
class GVAR(overPressureDistanceSetting) {
displayName = CSTRING(distanceCoefficient_displayName);
tooltip = CSTRING(distanceCoefficient_toolTip);
property = QUOTE(overpressureDistanceCoefficient);
control = "Edit";
expression = QUOTE(if (_value >= 0) then { _this setVariable [ARR_3(QQGVAR(distance),_value,true)] });
defaultValue = -1;
validate = "number";
typeName = "NUMBER";
condition = "objectVehicle";
};
};
};
};
};
};
1 change: 1 addition & 0 deletions addons/overpressure/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgWeapons.hpp"
#include "ACE_Arsenal_Stats.hpp"
#include "CfgEden.hpp"
4 changes: 3 additions & 1 deletion addons/overpressure/functions/fnc_firedEHOP.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunn
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 {};

private _unitOverpressureRangeAttribute = _unit getVariable [QGVAR(distance), GVAR(overpressureDistanceCoefficient)];
_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute;

// The weapon produces overpressure, calculate
private _position = getPosASL _projectile;
private _direction = vectorDir _projectile;
Expand Down

0 comments on commit c87e2cb

Please sign in to comment.