diff --git a/addons/backblast/CfgWeapons.hpp b/addons/backblast/CfgWeapons.hpp index f4f7c07153..5880795ee2 100644 --- a/addons/backblast/CfgWeapons.hpp +++ b/addons/backblast/CfgWeapons.hpp @@ -36,14 +36,14 @@ class CfgWeapons { class CannonCore; class cannon_120mm: CannonCore { - ACE_DangerZone_Angle = 90; - ACE_DangerZone_Range = 50; - ACE_DangerZone_Damage = 0.85; + GVAR(angle) = 90; + GVAR(range) = 50; + GVAR(damage) = 0.85; }; class mortar_155mm_AMOS: CannonCore { - ACE_DangerZone_Angle = 90; - ACE_DangerZone_Range = 60; - ACE_DangerZone_Damage = 1; + GVAR(angle) = 90; + GVAR(range) = 60; + GVAR(damage) = 1; }; }; diff --git a/addons/backblast/XEH_postInit.sqf b/addons/backblast/XEH_postInit.sqf index 72ca42a012..6f9a6f4cf8 100644 --- a/addons/backblast/XEH_postInit.sqf +++ b/addons/backblast/XEH_postInit.sqf @@ -1,4 +1,3 @@ #include "script_component.hpp" ["backblast", FUNC(backblastDamage)] call EFUNC(common,addEventHandler); -["overpressure", FUNC(overpressureDamage)] call EFUNC(common,addEventHandler); diff --git a/addons/backblast/XEH_preInit.sqf b/addons/backblast/XEH_preInit.sqf index 11193c3bf4..dde5f3affe 100644 --- a/addons/backblast/XEH_preInit.sqf +++ b/addons/backblast/XEH_preInit.sqf @@ -6,6 +6,5 @@ PREP(backblastDamage); PREP(fireLauncherBackblast); PREP(fireOverpressureZone); PREP(getDistance); -PREP(overpressureDamage); ADDON = true; diff --git a/addons/backblast/functions/fnc_fireOverpressureZone.sqf b/addons/backblast/functions/fnc_fireOverpressureZone.sqf index 0ded8f974b..178b519fc0 100644 --- a/addons/backblast/functions/fnc_fireOverpressureZone.sqf +++ b/addons/backblast/functions/fnc_fireOverpressureZone.sqf @@ -39,7 +39,7 @@ private "_affected"; _affected = getPos _projectile nearEntities ["CAManBase", _dangerZoneRange]; // Let each client handle their own affected units -["overpressure", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); +["backblast", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent); // Draw debug lines #ifdef DEBUG_MODE_FULL diff --git a/addons/backblast/functions/fnc_overpressureDamage.sqf b/addons/backblast/functions/fnc_overpressureDamage.sqf deleted file mode 100644 index 995c5db9e4..0000000000 --- a/addons/backblast/functions/fnc_overpressureDamage.sqf +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Author: commy2 and CAA-Picard - * - * Calculate and apply overpressure damage to potentially affected local units - * - * Argument: - * 0: Unit that fired (Object) - * 1: Pos ASL of the projectile (Array) - * 2: Direction of the projectile (Array) - * 3: Weapon fired (String) - * - * Return value: - * None - */ -#include "script_component.hpp" - -EXPLODE_4_PVT(_this,_firer,_posASL,_direction,_weapon); - -private ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; - -_dangerZoneAngle = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(angle)) / 2; -_dangerZoneRange = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(range)); -_dangerZoneDamage = getNumber (configFile >> "CfgWeapons" >> _weapon >> QGVAR(damage)); - -TRACE_4("Parameters:",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage,_weapon); - -private "_pos"; -_pos = _posASL; -if (!surfaceIsWater _pos) then { - _pos = ASLtoATL _pos; -}; - -{ - if (local _x && {_x != _firer} && {vehicle _x == _x}) then { - private ["_targetPositionASL", "_relativePosition", "_axisDistance", "_distance", "_angle", "_line", "_line2"]; - - _targetPositionASL = eyePos _x; - _relativePosition = _targetPositionASL vectorDiff _posASL; - _axisDistance = _relativePosition vectorDotProduct _direction; - _distance = vectorMagnitude _relativePosition; - _angle = acos (_axisDistance / _distance); - - _line = [_posASL, _targetPositionASL, _firer, _x]; - _line2 = [_posASL, _targetPositionASL]; - TRACE_4("Affected:",_x,_axisDistance,_distance,_angle); - - if (_angle < _dangerZoneAngle && {_distance < _dangerZoneRange} && {!lineIntersects _line} && {!terrainIntersectASL _line2}) then { - private ["_alpha", "_beta", "_damage"]; - - _alpha = sqrt (1 - _distance / _dangerZoneRange); - _beta = sqrt (1 - _angle / _dangerZoneAngle); - - _damage = 2 * _alpha * _beta * _dangerZoneDamage; - - // If the target is the ACE_player - if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; - - // @todo: Sort this interaction with medical - if (isClass (configFile >> "CfgPatches" >> "ACE_Medical")) then { - [_x, "HitBody", ([_x, "", ((_x getHitPointDamage "HitBody") + _damage), objNull, objNull] call EFUNC(medical,handleDamage))] call EFUNC(medical,setHitPointDamage); - _x spawn { - sleep 0.5; - [_this, "", 0, objNull, objNull] call EFUNC(medical,handleDamage); - }; - } else { - _x setDamage (damage _x + _damage); - }; - }; - }; -} forEach (_pos nearEntities ["CAManBase", _dangerZoneRange]);