mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
rename backblast to overpressure
This commit is contained in:
parent
f3aa0e58aa
commit
2252f82de7
@ -1 +0,0 @@
|
||||
z\ace\addons\backblast
|
@ -1,3 +0,0 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["backblast", FUNC(backblastDamage)] call EFUNC(common,addEventHandler);
|
@ -1 +0,0 @@
|
||||
#include "\z\ace\addons\backblast\script_component.hpp"
|
@ -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"
|
1
addons/overpressure/$PBOPREFIX$
Normal file
1
addons/overpressure/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\overpressure
|
3
addons/overpressure/XEH_postInit.sqf
Normal file
3
addons/overpressure/XEH_postInit.sqf
Normal file
@ -0,0 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["overpressure", FUNC(overpressureDamage)] call EFUNC(common,addEventHandler);
|
@ -2,9 +2,9 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(backblastDamage);
|
||||
PREP(fireLauncherBackblast);
|
||||
PREP(fireOverpressureZone);
|
||||
PREP(getDistance);
|
||||
PREP(overpressureDamage);
|
||||
|
||||
ADDON = true;
|
@ -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";
|
@ -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
|
@ -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]);
|
1
addons/overpressure/functions/script_component.hpp
Normal file
1
addons/overpressure/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\overpressure\script_component.hpp"
|
12
addons/overpressure/script_component.hpp
Normal file
12
addons/overpressure/script_component.hpp
Normal file
@ -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"
|
Loading…
Reference in New Issue
Block a user