mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cookoff - Randomized the delay from start of cookoff and ammunition detonation (#9002)
* Cookoff - Added a random delay between a vehicle being killed and when the ammo starts to cookoff * Cookoff - Tweaked min ammo start delay to 1 second * minor syntax and macro cleanup
This commit is contained in:
parent
2a4355dfb9
commit
f846b9ab82
@ -53,6 +53,8 @@
|
|||||||
) then {
|
) then {
|
||||||
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
if (GVAR(ammoCookoffDuration) == 0) exitWith {};
|
||||||
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"];
|
||||||
[_vehicle, _mags, _total] call FUNC(detonateAmmunition);
|
|
||||||
|
private _delay = (random MAX_AMMO_DETONATION_START_DELAY) max MIN_AMMO_DETONATION_START_DELAY;
|
||||||
|
[FUNC(detonateAmmunition), [_vehicle, _mags, _total], _delay] call CBA_fnc_waitAndExecute;
|
||||||
};
|
};
|
||||||
}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler;
|
}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler;
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
#define MAX_TIME_BETWEEN_AMMO_DET 25
|
#define MAX_TIME_BETWEEN_AMMO_DET 25
|
||||||
#define MAX_COOKOFF_INTENSITY 10
|
#define MAX_COOKOFF_INTENSITY 10
|
||||||
|
|
||||||
|
#define MIN_AMMO_DETONATION_START_DELAY 1 // Min time to wait before a vehicle's ammo starts to cookoff
|
||||||
|
#define MAX_AMMO_DETONATION_START_DELAY 6 // Max time to wait before a vehicle's ammo starts to cookoff
|
||||||
|
|
||||||
// Delay between flame effect for players in a cooking off vehicle
|
// Delay between flame effect for players in a cooking off vehicle
|
||||||
#define FLAME_EFFECT_DELAY 0.4
|
#define FLAME_EFFECT_DELAY 0.4
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user