2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-05-10 16:32:01 +00:00
|
|
|
/*
|
|
|
|
* Author: Bohemia Interactive
|
|
|
|
* Module function for spawning mines
|
|
|
|
* Edited to remove forced map markers and mines being revealed to players
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-05-18 11:56:31 +00:00
|
|
|
* 0: The module logic <LOGIC>
|
|
|
|
* 1: units <ARRAY>
|
|
|
|
* 2: activated <BOOL>
|
2015-05-10 16:32:01 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2016-11-15 12:07:48 +00:00
|
|
|
* None
|
2015-05-10 16:32:01 +00:00
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_bi_moduleMine
|
|
|
|
*
|
2015-05-10 16:32:01 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
2015-05-11 16:08:25 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
params ["_logic", "_units", "_activated"];
|
2015-05-10 16:17:17 +00:00
|
|
|
|
|
|
|
if (_activated) then {
|
2021-02-18 18:58:08 +00:00
|
|
|
_explosive = gettext (configOf _logic >> "explosive");
|
2015-05-10 16:26:24 +00:00
|
|
|
if (_explosive != "") then {
|
|
|
|
_explosive = createvehicle [_explosive,position _logic,[],0,"none"];
|
|
|
|
_explosive attachto [_logic];
|
2015-05-10 16:17:17 +00:00
|
|
|
|
2015-06-08 17:18:40 +00:00
|
|
|
// Added by ace_zeus to control if mines are revealed
|
2021-08-16 11:01:50 +00:00
|
|
|
if (GVAR(revealMines) > MINE_REVEAL_NONE) then {
|
2015-05-11 15:23:46 +00:00
|
|
|
//--- Reveal the mine to curator's side
|
|
|
|
{
|
|
|
|
_side = (getassignedcuratorunit _x) call bis_fnc_objectSide;
|
|
|
|
_side revealmine _explosive;
|
2015-11-30 16:23:48 +00:00
|
|
|
} forEach (objectcurators _logic);
|
2015-05-10 16:17:17 +00:00
|
|
|
|
2021-08-16 11:01:50 +00:00
|
|
|
if (GVAR(revealMines) == MINE_REVEAL_FULL) then {
|
2015-05-11 15:23:46 +00:00
|
|
|
//--- Mark minefields in the map
|
|
|
|
[] spawn bis_fnc_drawMinefields;
|
|
|
|
};
|
|
|
|
};
|
2015-05-10 16:26:24 +00:00
|
|
|
|
|
|
|
//--- Show hint to curator who placed the object
|
|
|
|
[[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp;
|
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic};
|
2015-05-10 16:26:24 +00:00
|
|
|
if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;};
|
|
|
|
deletevehicle _logic;
|
|
|
|
};
|
2015-05-11 17:06:01 +00:00
|
|
|
};
|