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

Cookoff - Use getShotInfo for tracer detection #9911

Closed
wants to merge 41 commits into from
Closed
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4f33c32
Cook-off improvements
johnb432 Jan 27, 2024
a999c81
Merge branch 'master' into cookoff-refactor
johnb432 Jan 27, 2024
d7dafa4
More changes
johnb432 Feb 3, 2024
e52990d
Update fnc_getVehicleAmmo.sqf
johnb432 Feb 3, 2024
c0a9514
Better engine fire placement
johnb432 Feb 3, 2024
26f73e1
Update fnc_detonateAmmunition.sqf
johnb432 Feb 3, 2024
c927c0e
Merged main
johnb432 Feb 4, 2024
49ca715
Update XEH_postInit.sqf
johnb432 Feb 4, 2024
16ffa2f
Update fnc_getVehicleAmmo.sqf
johnb432 Feb 4, 2024
0de629e
Update events-framework.md
johnb432 Feb 5, 2024
ed4cea6
Various improvements
johnb432 Feb 5, 2024
0ec391a
Merged main
johnb432 Feb 5, 2024
51aa46c
Separate effect handling
johnb432 Feb 6, 2024
d277fa9
Tweaks
johnb432 Feb 6, 2024
2646cc1
Update XEH_postInit.sqf
johnb432 Feb 6, 2024
db3fc19
Merge branch 'master' into pr/9758
johnb432 Feb 7, 2024
0deada7
Prevent double ammo detonation
johnb432 Feb 7, 2024
370f141
Merge branch 'master' into pr/9758
johnb432 Feb 8, 2024
e541b33
Fixed objects not being able to cook-off again
johnb432 Feb 8, 2024
0663bd1
Added incendiary rounds as source of box cookoff
johnb432 Feb 11, 2024
2cdc40a
Converted enable setting to bool
johnb432 Feb 13, 2024
bdb33d4
Fixed brackets
johnb432 Feb 13, 2024
07b73c9
Update fnc_cookOff.sqf
johnb432 Feb 13, 2024
9a7c293
Update CfgEden.hpp
johnb432 Feb 13, 2024
a2909a9
Merge branch 'master' into pr/9758
johnb432 Feb 13, 2024
cc06b37
Removed GVAR(enable), added GVAR(enableFire) back
johnb432 Feb 14, 2024
39a84be
Merge branch 'master' into pr/9758
johnb432 Mar 9, 2024
33999a0
Merge branch 'master' into pr/9758
johnb432 Apr 1, 2024
cea3f6e
Merge branch 'master' into pr/9758
johnb432 Apr 2, 2024
9cd62fc
Update fnc_handleDamageBox.sqf
johnb432 Apr 2, 2024
24d49d1
Update fnc_handleDamageBox.sqf
johnb432 Apr 2, 2024
ca49d8a
Merge branch 'master' into cookoff-tracer
johnb432 Apr 7, 2024
51c7a0f
Update fnc_handleDamageBox.sqf
johnb432 May 9, 2024
a3aeb92
Merge branch 'master' into cookoff-tracer
johnb432 May 9, 2024
87c876e
Update fnc_handleDamageBox.sqf
johnb432 May 29, 2024
d7d6eb0
Merge branch 'master' into cookoff-tracer
johnb432 Jun 5, 2024
389e1c7
Update fnc_handleDamageBox.sqf
johnb432 Jun 5, 2024
ffd07a7
Update fnc_handleDamageBox.sqf
johnb432 Jun 17, 2024
e4b2499
Merge branch 'master' into cookoff-tracer
johnb432 Aug 11, 2024
aac4675
Update addons/cookoff/functions/fnc_handleDamageBox.sqf
johnb432 Aug 11, 2024
8afffee
Merge branch 'master' into cookoff-tracer
johnb432 Oct 12, 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
28 changes: 5 additions & 23 deletions addons/cookoff/functions/fnc_handleDamageBox.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,12 @@ if !(_hitPoint == "" && {_damage > 0.5}) exitWith {}; // "" means structural dam
private _ammoConfig = _ammo call CBA_fnc_getObjectConfig;

// Catch fire when hit by an explosive or incendiary round
if ((getNumber (_ammoConfig >> "explosive") >= 0.5) || {getNumber (_ammoConfig >> QEGVAR(vehicle_damage,incendiary)) > random 1}) then {
if (
(getNumber (_ammoConfig >> "explosive") >= 0.5) ||
{getNumber (_ammoConfig >> QEGVAR(vehicle_damage,incendiary)) > random 1} ||
{_damage * 0.05 > random 1 && {_ammo getShotInfo 4}} // There is a small chance of cooking a box off if it's shot by tracer ammo
) then {
[QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent;
} else {
// There is a small chance of cooking a box off if it's shot by tracer ammo
if (random 1 >= _damage * 0.05) exitWith {};

// Need magazine to check for tracers
private _magazine = if (_source == _instigator) then {
currentMagazine _source
} else {
_source currentMagazineTurret (_source unitTurret _instigator)
};

private _configMagazine = configFile >> "CfgMagazines" >> _magazine;

// Magazine could have changed during flight time (just ignore if so)
if (getText (_configMagazine >> "ammo") == _ammo) then {
// If magazine's tracer density is high enough then low chance for cook off
private _tracers = getNumber (_configMagazine >> "tracersEvery");

if (_tracers >= 1 && {_tracers <= 4}) then {
[QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent;
};
};
};

// Prevent destruction, let cook-off handle it if necessary
Expand Down
Loading