Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overpressure - Add to vehicle/static Missile Launchers and Recoilless Guns #10270

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
79115a8
Add overpressure to vehicle missile/rocket launchers
mrschick Aug 28, 2024
b26e097
Tweak M47 Dragon Overpressure
mrschick Aug 28, 2024
f58d514
Isolate Compat RHS_AFRF Overpressure
mrschick Aug 28, 2024
4a9acf8
Soft-Launch for RHS_AFRF 9K38 Igla Turret
mrschick Aug 28, 2024
b75a3da
Correct RHS_AFRF SPG-9 Offset
mrschick Aug 28, 2024
318c5c1
Isolate Compat RHS_USAF Overpressure
mrschick Aug 28, 2024
801bd44
Soft-Launch for RHS_USAF Stinger Turret
mrschick Aug 28, 2024
3f571a4
Soft-Launch for RHS_USAF TOW
mrschick Aug 28, 2024
75e4f6b
Correct Vanilla AT Gun Offset
mrschick Aug 28, 2024
dfe8fa7
Fix duplicate class definition
mrschick Aug 28, 2024
dea6edf
Update Documentation
mrschick Aug 29, 2024
fad2c5a
Merge 'master' for recent Overpressure changes
mrschick Aug 31, 2024
0acf423
Fix inheritance
mrschick Aug 31, 2024
8da11c4
Move Javelin overpressure to own component
mrschick Aug 31, 2024
0e944ce
Rough working version of firedEHBB for Vehicles
mrschick Aug 31, 2024
8ce4e47
Use _unit in case _shooter would be undefined
mrschick Aug 31, 2024
b668682
Fix undefined _gunner for FFV shots
mrschick Aug 31, 2024
d6e4bc8
Prevent bb reflection damage when within heavy vehicles
mrschick Aug 31, 2024
6662938
Prevent bb reflection by own vehicle
mrschick Aug 31, 2024
e0b63bb
Fix comment typo
mrschick Aug 31, 2024
dc01de9
Revert negative offset
mrschick Aug 31, 2024
eadb5b9
Call overpressure "backblast" when it's rear-facing
mrschick Aug 31, 2024
70c64d2
Update Documentation
mrschick Aug 31, 2024
296a5a3
Optimize as advised by HEMTT
mrschick Aug 31, 2024
6f41328
Enable Offset for Cannon Overpressure
mrschick Sep 5, 2024
9119a29
Mortar Overpressure
mrschick Sep 5, 2024
cf1d32c
Allow negative Backblast Offset
mrschick Sep 5, 2024
0b9b97a
Correct Offset for MLRSs
mrschick Sep 5, 2024
e262208
Prevent Backblast being blocked by Firing Vehicle
mrschick Sep 6, 2024
a9ce879
Increase MLRS Backblast Damage
mrschick Sep 6, 2024
34c3ae9
Flag "noReflection" to prevent bb reflection inside closed vehicle
mrschick Sep 6, 2024
7e1d864
Set "noReflection" on BRDM2, BM21 and Vanilla MLRS Truck
mrschick Sep 6, 2024
9586765
Merge branch 'master' into feature/spg9-backblast
mrschick Sep 25, 2024
a2d3786
Requested Changes
mrschick Sep 25, 2024
3e86ccd
Mitigate dependency from addon/hearing
mrschick Sep 25, 2024
d6b002d
Moved playerVehAttenuation logic to common
mrschick Sep 26, 2024
83484d3
Revert overpressure subconfigs
mrschick Sep 26, 2024
5da1929
Merge branch 'master' into feature/spg9-backblast
mrschick Oct 15, 2024
370f1bf
Merge branch 'master' into feature/spg9-backblast
mrschick Nov 7, 2024
2bb02d7
Rephrase comments
mrschick Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions addons/overpressure/functions/fnc_firedEHBB.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"];
TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunner);

private _shooter = if (vehicle _unit != _unit) then {_gunner} else {_unit};

Check notice on line 21 in addons/overpressure/functions/fnc_firedEHBB.sqf

View workflow job for this annotation

GitHub Actions / windows

assignment to if can be replaced with select

use select

Check notice on line 21 in addons/overpressure/functions/fnc_firedEHBB.sqf

View workflow job for this annotation

GitHub Actions / build

assignment to if can be replaced with select

use select
mrschick marked this conversation as resolved.
Show resolved Hide resolved

// Retrieve backblast values
private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues);

Expand All @@ -35,18 +37,18 @@
private _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange];

// Let each client handle their own affected units
["ace_overpressure", [_gunner, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent;
["ace_overpressure", [_shooter, _position, _direction, _weapon, _magazine, _ammo], _affected] call CBA_fnc_targetEvent;

// Damage to the firer
private _distance = 2 * ([_position, _direction, _backblastRange, _gunner] call FUNC(getDistance));
private _distance = 2 * ([_position, _direction, _backblastRange, _shooter] call FUNC(getDistance));

TRACE_1("Distance",_distance);

if (_distance < _backblastRange) then {
TRACE_2("",isDamageAllowed _gunner,_gunner getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]);
TRACE_2("",isDamageAllowed _shooter,_shooter getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]);

// Skip damage if not allowed
if (isDamageAllowed _gunner && {_gunner getVariable [QEGVAR(medical,allowDamage), true]}) then {
if (isDamageAllowed _shooter && {_shooter getVariable [QEGVAR(medical,allowDamage), true]}) then {
private _alpha = sqrt (1 - _distance / _backblastRange);
private _beta = sqrt 0.5;

Expand All @@ -56,9 +58,9 @@
[_damage * 100] call BIS_fnc_bloodEffect;

if (GETEGVAR(medical,enabled,false)) then {
[_gunner, _damage, "body", "backblast", _gunner] call EFUNC(medical,addDamageToUnit);
[_shooter, _damage, "body", "backblast", _shooter] call EFUNC(medical,addDamageToUnit);
} else {
_gunner setDamage (damage _gunner + _damage);
_shooter setDamage (damage _shooter + _damage);
};
};
};
Expand Down