Epoch/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf

53 lines
1.6 KiB
Plaintext
Raw Normal View History

2016-09-01 02:19:23 +00:00
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
spawn Effects over time based on array
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/functions/EPOCH_fnc_spawnEffects.sqf
Example:
[] spawn EPOCH_fnc_spawnEffects;
Parameter(s):
_this select 0: ARRAY - effects array
*/
//[[[cog import generate_private_arrays ]]]
private ["_firstArray","_fx","_handle","_handles"];
//[[[end]]]
2016-09-05 04:32:38 +00:00
params [["_ppEffects",[],[[]] ] ];
2016-09-01 02:19:23 +00:00
_handles = [];
{
_fx = _x;
if (_fx isEqualType []) then {
if (_fx isEqualTo []) then {
ppEffectDestroy _handles;
} else {
{
if !(_x isEqualTo []) then {
2016-09-05 04:32:38 +00:00
if (count _x == 4) then {
2016-09-01 02:19:23 +00:00
_x params ["_type","_proi","_effect","_speed"];
_handle = [_type,_proi] call epoch_postProcessCreate;
_handles pushBack _handle;
2016-09-05 04:32:38 +00:00
[_handle, _speed, _effect, true] call epoch_postprocessAdjust;
2016-09-01 02:19:23 +00:00
} else {
2016-09-05 04:32:38 +00:00
_x params ["_effect","_speed"];
[_handles select _forEachIndex, _speed, _effect, true] call epoch_postprocessAdjust;
2016-09-01 02:19:23 +00:00
};
};
} forEach _fx;
};
2016-09-05 04:32:38 +00:00
} else {
// sleep
if (_fx isEqualType 0) then {
uiSleep _fx;
};
2016-09-01 02:19:23 +00:00
};
} forEach _ppEffects;