2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-10-06 20:37:38 +00:00
|
|
|
/*
|
2024-01-27 08:14:10 +00:00
|
|
|
* Author: KoffeinFlummi, commy2, kymckay, johnb43
|
2016-10-06 20:37:38 +00:00
|
|
|
* Start a cook-off in the given ammo box.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Ammo box <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2024-01-27 08:14:10 +00:00
|
|
|
* cursorObject call ace_cookoff_fnc_cookOffBox
|
2016-10-06 20:37:38 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
if (!isServer) exitWith {};
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
params ["_box", "_killer", "_instigator"];
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
if (_box getVariable [QGVAR(isCookingOff), false]) exitWith {};
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
_box setVariable [QGVAR(isCookingOff), true, true];
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
// Spawn cook-off effects on all connected machines
|
|
|
|
private _jipID = [QGVAR(cookOffBoxLocal), [
|
|
|
|
_box,
|
|
|
|
_killer,
|
|
|
|
_instigator,
|
|
|
|
CBA_missionTime,
|
|
|
|
random [IGNITE_TIME / 2, IGNITE_TIME, IGNITE_TIME / 2 * 3], // generate random timers that are global
|
|
|
|
random [SMOKE_TIME / 2, SMOKE_TIME, SMOKE_TIME / 2 * 3]
|
|
|
|
]] call CBA_fnc_globalEventJIP;
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
[_jipID, _box] call CBA_fnc_removeGlobalEventJIP;
|
2016-10-06 20:37:38 +00:00
|
|
|
|
2024-01-27 08:14:10 +00:00
|
|
|
_box setVariable [QGVAR(jipID), _jipID];
|