diff --git a/AUTHORS.txt b/AUTHORS.txt index 401722e05ca..812324c34d2 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE3 CONTRIBUTOR LIST +# ACE3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -84,6 +84,7 @@ Harakhti havena Hawkins Head +Hybrid V Karneck Kavinsky Kllrt diff --git a/addons/cookoff/CfgSFX.hpp b/addons/cookoff/CfgSFX.hpp index 0e106447299..1b2d5408afe 100644 --- a/addons/cookoff/CfgSFX.hpp +++ b/addons/cookoff/CfgSFX.hpp @@ -2,8 +2,12 @@ class CfgSFX { class GVAR(CookOff) { name = QGVAR(cookoff); - sounds[] = {QGVAR(cookoff)}; - GVAR(cookoff)[] = {PATHTOF(sounds\cookoff.wss),6,1.8,400,1,0,0,0}; + // Index 4 is percentage chance to play, in theory high pressure is way more likely + variant0[] = {PATHTOF(sounds\cookoff_low_pressure.ogg),6,1,400,0.1,0,0,0}; + variant1[] = {PATHTOF(sounds\cookoff_mid_pressure.ogg),6,1,400,0.25,0,0,0}; + variant2[] = {PATHTOF(sounds\cookoff_high_pressure.ogg),6,1,400,0.65,0,0,0}; + sounds[] = {"variant0","variant1","variant2"}; + titles[] = {}; empty[] = {"",0,0,0,0,0,0,0}; }; }; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index b75eaf9eb35..99a901649f7 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -91,6 +91,7 @@ if (local _vehicle) then { } forEach _positions; if (isServer) then { + // TODO - Players in the vehicle hear no sound (even after exiting the vehicle) private _sound = createSoundSource [QGVAR(Sound), position _vehicle, [], 0]; _effects pushBack _sound; @@ -107,11 +108,12 @@ if (local _vehicle) then { DEC(_counter); if (_counter > 0) then { - [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], 0.4] call CBA_fnc_waitAndExecute + [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], FLAME_EFFECT_DELAY] call CBA_fnc_waitAndExecute }; }; - [_vehicle, _fnc_FlameEffect, 12] call _fnc_FlameEffect; // recursive function + // Recursive function, occurs for duration of cookoff + [_vehicle, _fnc_FlameEffect, ceil(COOKOFF_TIME/FLAME_EFFECT_DELAY)] call _fnc_FlameEffect; private _randomPosition = _vehicle getPos [100, random 360]; @@ -132,6 +134,6 @@ if (local _vehicle) then { if (local _vehicle) then { _vehicle setDamage 1; }; - }, [_vehicle, _effects], 14] call CBA_fnc_waitAndExecute; - }, [_vehicle, _effects, _positions], 10.5] call CBA_fnc_waitAndExecute; -}, _vehicle, 3] call CBA_fnc_waitAndExecute; + }, [_vehicle, _effects], COOKOFF_TIME] call CBA_fnc_waitAndExecute; // TODO: Randomise cook off time with locality in mind + }, [_vehicle, _effects, _positions], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _vehicle, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf index 6f834a15b64..4e509e31946 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -71,6 +71,6 @@ if (local _box) then { if (local _box) then { _box setDamage 1; }; - }, [_box, _effects], 82.5] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) - }, [_box, _effects], 10.5] call CBA_fnc_waitAndExecute; -}, _box, 3] call CBA_fnc_waitAndExecute; + }, [_box, _effects], COOKOFF_TIME_BOX] call CBA_fnc_waitAndExecute; // TODO: Change so that box is alive until no ammo left, with locality in mind + }, [_box, _effects], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _box, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/script_component.hpp b/addons/cookoff/script_component.hpp index 7a9468c50c9..5daa0e83305 100644 --- a/addons/cookoff/script_component.hpp +++ b/addons/cookoff/script_component.hpp @@ -17,3 +17,13 @@ #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 +#define IGNITE_TIME 3 +#define SMOKE_TIME 10.5 +#define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files +#define COOKOFF_TIME_BOX 82.5 // Cook off time for boxes should be significant to allow time for ammo to burn + +// Delay between flame effect for players in a cooking off vehicle +#define FLAME_EFFECT_DELAY 0.4 diff --git a/addons/cookoff/sounds/cookoff.wss b/addons/cookoff/sounds/cookoff.wss deleted file mode 100644 index 11b9d55194f..00000000000 Binary files a/addons/cookoff/sounds/cookoff.wss and /dev/null differ diff --git a/addons/cookoff/sounds/cookoff_high_pressure.ogg b/addons/cookoff/sounds/cookoff_high_pressure.ogg new file mode 100644 index 00000000000..ebcffaf9cef Binary files /dev/null and b/addons/cookoff/sounds/cookoff_high_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_low_pressure.ogg b/addons/cookoff/sounds/cookoff_low_pressure.ogg new file mode 100644 index 00000000000..89439e21a7c Binary files /dev/null and b/addons/cookoff/sounds/cookoff_low_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_mid_pressure.ogg b/addons/cookoff/sounds/cookoff_mid_pressure.ogg new file mode 100644 index 00000000000..b82cbcf4e1f Binary files /dev/null and b/addons/cookoff/sounds/cookoff_mid_pressure.ogg differ