Files
MOOSE_MISSIONS/Functional/Mantis/MTS-400 - MANTIS - Automode huge setup example/MTS-400 - MANTIS - Automode huge setup example.lua
T
2024-01-01 22:24:29 +00:00

57 lines
2.3 KiB
Lua

-------------------------------------------------------------------------
-- MTS-400 - MANTIS - Auto-mode huge set-up example
-------------------------------------------------------------------------
-- Documentation
--
-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Mantis.html
--
-------------------------------------------------------------------------
-- Observe a set of SAM sites being attacked by F18 SEAD
-------------------------------------------------------------------------
-- Date: 11 Nov 2021
--- Set up SHORAD
local redsamset = SET_GROUP:New():FilterCoalitions("red"):FilterPrefixes({"SAM-SA","EWR"}):FilterStart()
local redshorad = SHORAD:New("SHORAD-RED","SHORAD",redsamset,25000,600,"red",true) -- Functional.Shorad#SHORAD
redshorad:SetDefenseLimits(80,95)
--- Borders
local israelborder = ZONE_POLYGON:New("Israel",GROUP:FindByName("Israel Border"))
local syriaborder = ZONE_POLYGON:New("Syria",GROUP:FindByName("Syria Border"))
--- MANTIS
local RedMantis = MANTIS:New("SyMantis","SAM-SA","EWR",nil,"red")
RedMantis:AddZones({syriaborder},{israelborder}) --accept and reject zones
RedMantis:AddShorad(redshorad,600)
RedMantis:__Start(5)
function RedMantis:OnAfterSeadSuppressionPlanned(From, Event, To, Group, Name, SuppressionStartTime, SuppressionEndTime)
MESSAGE:New("SAM Suppression planned! "..Name.. " is planning to shut down.",10):ToAll()
BASE:I("SAM Suppression planned! "..Name.. " is planning to shut down.")
end
function RedMantis:OnAfterSeadSuppressionStart(From, Event, To, Group, Name)
MESSAGE:New("SAM Suppressed! "..Name.. " is suppressed.",10):ToAll()
BASE:I("SAM Suppressed! "..Name.. "is suppressed!" )
end
function RedMantis:OnAfterRedState(From,Event,To,Group)
local Name = Group:GetName()
MESSAGE:New("SAM "..Name.. " switched to RED",10):ToAll()
BASE:I("SAM "..Name.. " switched to RED" )
end
function RedMantis:OnAfterGreenState(From,Event,To,Group)
local Name = Group:GetName()
MESSAGE:New("SAM "..Name.. " switched to GREEN",10):ToAll()
BASE:I("SAM "..Name.. " switched to GREEN" )
end
--- get some SEAD flights
function GetBlueCAS()
local BlueCAS = SPAWN:New("Aerial-2"):Spawn()
local BlueCAS2 = SPAWN:New("Aerial-3"):Spawn()
end
local bluetimer = TIMER:New(GetBlueCAS)
bluetimer:Start(20)