|
| 1 | +/* |
| 2 | + * Author: Glowbal |
| 3 | + * |
| 4 | + * Arguments: |
| 5 | + * 0: <BOOL> |
| 6 | + * |
| 7 | + * Return Value: |
| 8 | + * None |
| 9 | + * |
| 10 | + * Public: No |
| 11 | + */ |
| 12 | +#include "script_component.hpp" |
| 13 | + |
| 14 | +params ["_logic", "_units", "_activated"]; |
| 15 | + |
| 16 | +if (!local _logic) exitwith {}; |
| 17 | + |
| 18 | +private _collectObjects = { |
| 19 | + params ["_logic"]; |
| 20 | + |
| 21 | + private _collection = synchronizedObjects _logic; |
| 22 | + { |
| 23 | + if !(_x in _totalCollection) then { |
| 24 | + if (typeOf _x == QGVAR(createIed)) then { |
| 25 | + if !(_x getvariable [QGVAR(masterIED), false]) then { |
| 26 | + _x setvariable [QGVAR(subIED), true]; |
| 27 | + _x setvariable [QGVAR(controlledByIED), _logic]; |
| 28 | + _totalCollection pushback _x; |
| 29 | + [_x] call _collectObjects; |
| 30 | + }; |
| 31 | + } else { |
| 32 | + if (typeOf _x == "cseModule_triggerManLinkIEDS") then { |
| 33 | + _list = _x getvariable ["EnableList",""]; |
| 34 | + _list = "[" + _list + "]"; |
| 35 | + _parsedList = [] call compile _list; |
| 36 | + _triggerManList = (_logic getvariable [QGVAR(triggerManUnits), []]) + _parsedList; |
| 37 | + _logic setvariable [QGVAR(triggerManUnits), _triggerManList]; |
| 38 | + }; |
| 39 | + }; |
| 40 | + }; |
| 41 | + }foreach _collection; |
| 42 | +}; |
| 43 | + |
| 44 | +if !(_logic getvariable [QGVAR(subIED),false]) then { |
| 45 | + _logic setvariable [QGVAR(masterIED), true]; |
| 46 | + private _totalCollection = [_logic]; |
| 47 | + [_logic] call _collectObjects; |
| 48 | + _logic setvariable [QGVAR(collection), _totalCollection]; |
| 49 | +}; |
| 50 | + |
| 51 | +[_logic] call FUNC(createIEDObject); |
| 52 | + |
| 53 | +private _activatedTargets = switch (_logic getvariable ["activatedForTargets", -1]) do { |
| 54 | + case 0: {["CaManBase", "Air", "Car", "Motorcycle", "Tank"]}; |
| 55 | + case 1: {["Air", "Car", "Motorcycle", "Tank"]}; |
| 56 | + case 2: {["Car", "Motorcycle", "Tank"]}; |
| 57 | + case 3: {["Air"]}; |
| 58 | + case 4: {["CaManBase"]}; |
| 59 | + default {[]}; |
| 60 | +}; |
| 61 | +_logic setvariable ["activatedForTargets", _activatedTargets]; |
| 62 | + |
| 63 | +private _activatedSides = switch (_logic getvariable ["activatedForSides", -1]) do { |
| 64 | + case 0: {[west, east, independent, civilian, sideEnemy, sideFriendly]}; |
| 65 | + case 1: {[west, sideEnemy]}; |
| 66 | + case 2: {[east, sideEnemy]}; |
| 67 | + case 3: {[independent, sideEnemy]}; |
| 68 | + case 4: {[civilian, sideEnemy]}; |
| 69 | + default {[]}; |
| 70 | +}; |
| 71 | + |
| 72 | +_logic setvariable ["activatedForSides", _activatedSides, true]; |
| 73 | +_logic setvariable ["iedActivationType", _logic getvariable ["iedActivationType", 0], true]; |
0 commit comments