diff --git a/addons/backblast/$PBOPREFIX$ b/addons/backblast/$PBOPREFIX$ deleted file mode 100644 index c5ed230994..0000000000 --- a/addons/backblast/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\backblast \ No newline at end of file diff --git a/addons/backblast/XEH_postInit.sqf b/addons/backblast/XEH_postInit.sqf deleted file mode 100644 index 6f9a6f4cf8..0000000000 --- a/addons/backblast/XEH_postInit.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -["backblast", FUNC(backblastDamage)] call EFUNC(common,addEventHandler); diff --git a/addons/backblast/functions/script_component.hpp b/addons/backblast/functions/script_component.hpp deleted file mode 100644 index 817131570f..0000000000 --- a/addons/backblast/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\backblast\script_component.hpp" \ No newline at end of file diff --git a/addons/backblast/script_component.hpp b/addons/backblast/script_component.hpp deleted file mode 100644 index 9f2a71f2d5..0000000000 --- a/addons/backblast/script_component.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#define COMPONENT backblast -#include "\z\ace\Addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_BACKBLAST - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_BACKBLAST - #define DEBUG_SETTINGS DEBUG_SETTINGS_BACKBLAST -#endif - -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/overpressure/$PBOPREFIX$ b/addons/overpressure/$PBOPREFIX$ new file mode 100644 index 0000000000..fc5a82e0f7 --- /dev/null +++ b/addons/overpressure/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\overpressure \ No newline at end of file diff --git a/addons/backblast/CfgEventHandlers.hpp b/addons/overpressure/CfgEventHandlers.hpp similarity index 100% rename from addons/backblast/CfgEventHandlers.hpp rename to addons/overpressure/CfgEventHandlers.hpp diff --git a/addons/backblast/CfgWeapons.hpp b/addons/overpressure/CfgWeapons.hpp similarity index 100% rename from addons/backblast/CfgWeapons.hpp rename to addons/overpressure/CfgWeapons.hpp diff --git a/addons/backblast/README.md b/addons/overpressure/README.md similarity index 100% rename from addons/backblast/README.md rename to addons/overpressure/README.md diff --git a/addons/overpressure/XEH_postInit.sqf b/addons/overpressure/XEH_postInit.sqf new file mode 100644 index 0000000000..33c2e679c9 --- /dev/null +++ b/addons/overpressure/XEH_postInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +["overpressure", FUNC(overpressureDamage)] call EFUNC(common,addEventHandler); diff --git a/addons/backblast/XEH_preInit.sqf b/addons/overpressure/XEH_preInit.sqf similarity index 84% rename from addons/backblast/XEH_preInit.sqf rename to addons/overpressure/XEH_preInit.sqf index dde5f3affe..5eefc5eae4 100644 --- a/addons/backblast/XEH_preInit.sqf +++ b/addons/overpressure/XEH_preInit.sqf @@ -2,9 +2,9 @@ ADDON = false; -PREP(backblastDamage); PREP(fireLauncherBackblast); PREP(fireOverpressureZone); PREP(getDistance); +PREP(overpressureDamage); ADDON = true; diff --git a/addons/backblast/config.cpp b/addons/overpressure/config.cpp similarity index 100% rename from addons/backblast/config.cpp rename to addons/overpressure/config.cpp diff --git a/addons/backblast/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf similarity index 97% rename from addons/backblast/functions/fnc_fireLauncherBackblast.sqf rename to addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index 515135d56f..f42ffd23ed 100644 --- a/addons/backblast/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -39,7 +39,7 @@ private "_affected"; _affected = getPos _projectile nearEntities ["CAManBase", _backblastRange]; // Let each client handle their own affected units -["backblast", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); +["overpressure", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); // Damage to the firer private "_distance"; diff --git a/addons/backblast/functions/fnc_fireOverpressureZone.sqf b/addons/overpressure/functions/fnc_fireOverpressureZone.sqf similarity index 92% rename from addons/backblast/functions/fnc_fireOverpressureZone.sqf rename to addons/overpressure/functions/fnc_fireOverpressureZone.sqf index 178b519fc0..cc4918275d 100644 --- a/addons/backblast/functions/fnc_fireOverpressureZone.sqf +++ b/addons/overpressure/functions/fnc_fireOverpressureZone.sqf @@ -1,5 +1,5 @@ /* - * Author: Commy2 and CAA-Picard + * Author: commy2 and CAA-Picard * * Handle fire of local vehicle weapons creating overpressure zones * @@ -20,7 +20,7 @@ EXPLODE_7_PVT(_this,_firer,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -// Prevent AI from causing backblast damage +// Prevent AI from causing overpressure damage if !([gunner _firer] call EFUNC(common,isPlayer)) exitWith {}; //@todo non-maingun turrets? private ["_position", "_direction"]; @@ -39,7 +39,7 @@ private "_affected"; _affected = getPos _projectile nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units -["backblast", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); +["overpressure", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); // Draw debug lines #ifdef DEBUG_MODE_FULL diff --git a/addons/backblast/functions/fnc_getDistance.sqf b/addons/overpressure/functions/fnc_getDistance.sqf similarity index 100% rename from addons/backblast/functions/fnc_getDistance.sqf rename to addons/overpressure/functions/fnc_getDistance.sqf diff --git a/addons/backblast/functions/fnc_backblastDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf similarity index 69% rename from addons/backblast/functions/fnc_backblastDamage.sqf rename to addons/overpressure/functions/fnc_overpressureDamage.sqf index 651dc58830..c19fed1c04 100644 --- a/addons/backblast/functions/fnc_backblastDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -16,13 +16,13 @@ EXPLODE_4_PVT(_this,_firer,_posASL,_direction,_weapon); -private ["_backblastAngle", "_backblastRange", "_backblastDamage"]; +private ["_overpressureAngle", "_overpressureRange", "_overpressureDamage"]; -_backblastAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(angle)) / 2; -_backblastRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(range)); -_backblastDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(damage)); +_overpressureAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(angle)) / 2; +_overpressureRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(range)); +_overpressureDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(damage)); -TRACE_4("Parameters:",_backblastAngle,_backblastRange,_backblastDamage,_weapon); +TRACE_4("Parameters:",_overpressureAngle,_overpressureRange,_overpressureDamage,_weapon); private "_pos"; _pos = _posASL; @@ -44,13 +44,13 @@ if (!surfaceIsWater _pos) then { _line2 = [_posASL, _targetPositionASL]; TRACE_4("Affected:",_x,_axisDistance,_distance,_angle); - if (_angle < _backblastAngle && {_distance < _backblastRange} && {!lineIntersects _line} && {!terrainIntersectASL _line2}) then { + if (_angle < _overpressureAngle && {_distance < _overpressureRange} && {!lineIntersects _line} && {!terrainIntersectASL _line2}) then { private ["_alpha", "_beta", "_damage"]; - _alpha = sqrt (1 - _distance / _backblastRange); - _beta = sqrt (1 - _angle / _backblastAngle); + _alpha = sqrt (1 - _distance / _overpressureRange); + _beta = sqrt (1 - _angle / _overpressureAngle); - _damage = 2 * _alpha * _beta * _backblastDamage; + _damage = 2 * _alpha * _beta * _overpressureDamage; // If the target is the ACE_player if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; @@ -67,4 +67,4 @@ if (!surfaceIsWater _pos) then { }; }; }; -} forEach (_pos nearEntities ["CAManBase", _backblastRange]); +} forEach (_pos nearEntities ["CAManBase", _overpressureRange]); diff --git a/addons/overpressure/functions/script_component.hpp b/addons/overpressure/functions/script_component.hpp new file mode 100644 index 0000000000..d66ac7aec3 --- /dev/null +++ b/addons/overpressure/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\overpressure\script_component.hpp" \ No newline at end of file diff --git a/addons/overpressure/script_component.hpp b/addons/overpressure/script_component.hpp new file mode 100644 index 0000000000..8dac72cbbf --- /dev/null +++ b/addons/overpressure/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT overpressure +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_OVERPRESSURE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_OVERPRESSURE + #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file