2021-10-14 15:49:10 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2024-03-28 18:57:23 +00:00
|
|
|
[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler;
|
2021-10-14 15:49:10 +00:00
|
|
|
[QGVAR(playScream), {
|
|
|
|
params ["_scream", "_source"];
|
2024-03-21 19:20:23 +00:00
|
|
|
// only play sound if enabled in settings and enabled for the unit
|
|
|
|
if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then {
|
2021-11-07 23:32:49 +00:00
|
|
|
_source say3D _scream;
|
|
|
|
};
|
2021-10-14 15:49:10 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
["ace_settingsInitialized", {
|
2024-02-05 17:04:24 +00:00
|
|
|
TRACE_1("settingsInit",GVAR(enabled));
|
2021-10-14 15:49:10 +00:00
|
|
|
if (!GVAR(enabled)) exitWith {};
|
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
[QGVAR(addFireSource), {
|
|
|
|
params ["_source", "_radius", "_intensity", "_key", ["_condition", { true }], ["_conditionArgs", []]];
|
|
|
|
private _fireLogic = createVehicle ["ACE_LogicDummy", [0, 0, 0], [], 0, "NONE"];
|
|
|
|
if (_source isEqualType objNull) then {
|
|
|
|
_fireLogic attachTo [_source];
|
|
|
|
} else {
|
|
|
|
_fireLogic setPosASL _source;
|
|
|
|
};
|
|
|
|
|
|
|
|
[GVAR(fireSources), _key, [_fireLogic, _radius, _intensity, _condition, _conditionArgs]] call CBA_fnc_hashSet;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
2021-10-30 21:42:03 +00:00
|
|
|
|
2021-10-14 15:49:10 +00:00
|
|
|
[QGVAR(removeFireSource), {
|
|
|
|
params ["_key"];
|
|
|
|
[GVAR(fireSources), _key] call CBA_fnc_hashRem;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
2024-03-28 18:57:23 +00:00
|
|
|
[LINKFUNC(fireManagerPFH), FIRE_MANAGER_PFH_DELAY, []] call CBA_fnc_addPerFrameHandler;
|
2021-10-14 15:49:10 +00:00
|
|
|
GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate;
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|