diff --git a/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.lua b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.lua new file mode 100644 index 0000000000..ae3c86f94a --- /dev/null +++ b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.lua @@ -0,0 +1,66 @@ +------------------------------------------------------------------------- +-- MTS-410 - MANTIS - Automode and Zones +------------------------------------------------------------------------- +-- Documentation +-- +-- MANTIS: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Functional.Mantis.html +-- +------------------------------------------------------------------------- +-- Observe a set of SAM sites being attacked by F16 SEAD. Red SAMs will +-- go active once the F16s have passed the red border and the DMZ. +-- The SAM network and the SHORAD are managed by MANTIS. +------------------------------------------------------------------------- +-- Date: 13 Nov 2021 + +-- Borders +local blueborder = ZONE_POLYGON:New("BlueBorder",GROUP:FindByName("Blue Border")) +local redborder = ZONE_POLYGON:New("RedBorder",GROUP:FindByName("Red Border")) +local dmz = ZONE:New("DMZ") + +-- MANTIS +local RedMantis = MANTIS:New("RedMantis","Red SAM","Red EWR",nil,"red",nil,nil,true) +RedMantis:SetDetectInterval(30) +RedMantis:AddZones({redborder},{blueborder,dmz}) --accept and reject zones +RedMantis:SetSAMRange(90) +RedMantis.verbose = false +RedMantis:Debug(false) +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() +env.info("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() +env.info("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() + env.info("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() + env.info("SAM "..Name.. " switched to GREEN" ) +end + +function RedMantis:OnAfterShoradActivated(From,Event,To,Name,Radius,Ontime) + MESSAGE:New("SHORAD for "..Name.. " going online!",10):ToAll() + env.info("SHORAD for "..Name.. " going online!" ) +end + +-- get some blue attackers +function GetBlueSEAD() + local BlueCAS = SPAWN:New("F16 Flight") + :InitCleanUp(30) + :InitLimit(3,0) + :InitDelayOff() + :SpawnScheduled(30,0.5) +end + +local bluetimer = TIMER:New(GetBlueSEAD) +bluetimer:Start(20) \ No newline at end of file diff --git a/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.miz b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.miz new file mode 100644 index 0000000000..94273d9a0f Binary files /dev/null and b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/MTS-410 - MANTIS - Automode Zones.miz differ diff --git a/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/pack.ps1 b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/pack.ps1 new file mode 100644 index 0000000000..bbac66e7c1 --- /dev/null +++ b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/pack.ps1 @@ -0,0 +1,10 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf + +$dir +$file + +cd "_unpacked" +. 7z a -r -y -tzip "..\$file.miz" * +cd .. diff --git a/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/unpack.ps1 b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/unpack.ps1 new file mode 100644 index 0000000000..c208a31858 --- /dev/null +++ b/MTS - Mantis/MTS-410 - MANTIS - Automode Zones/unpack.ps1 @@ -0,0 +1,7 @@ +$dir = split-path -parent $MyInvocation.MyCommand.Definition +cd $dir +$file = Split-Path $dir -leaf +Remove-Item .\_unpacked -Force -Recurse +md "_unpacked" +cd "_unpacked" +. 7z x -r -y "..\$file.miz" *