Added incendiary rounds as source of box cookoff

This commit is contained in:
johnb432 2024-02-11 11:20:01 +01:00
parent e541b337c5
commit 0663bd16c9
2 changed files with 5 additions and 5 deletions

View File

@ -29,8 +29,10 @@ if !(_box getVariable [QGVAR(enableAmmoCookoff), true]) exitWith {};
if !(_hitPoint == "" && {_damage > 0.5}) exitWith {}; // "" means structural damage
// Catch fire when hit by an explosive round
if (IS_EXPLOSIVE_AMMO(_ammo)) then {
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 {
[QGVAR(cookOffBox), [_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

View File

@ -16,10 +16,8 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5)
// Stages of cookoff in order (in seconds)
// Should be no un-synced randomness in these as the effects must be ran on each client
// Should be no un-synced randomness in these as the effects must be run on each client
#define SMOKE_DELAY 10.5
#define DETONATION_DELAY 3
#define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files