/* * Author: Needles * https://steamcommunity.com/profiles/76561198026257137/ */ Mission <- {}; Mission.hatchPos <- Vector(); Mission.botsWin <- null; Mission.capDestroyRelay <- null; Mission.flagDetectionZone <- null; Mission.bomb <- null; Mission.forcedFlagDetectionZoneList <- []; Mission.isForcingBombAlarm <- false; Mission.SetHatchPos <- function(newHatchPos) { hatchPos = newHatchPos; }; Mission.GetHatchPos <- function() { return hatchPos; }; Mission.SetBotsWin <- function(newBotsWin) { botsWin = newBotsWin; }; Mission.GetBotsWin <- function() { return botsWin; }; Mission.SetCapDestroyRelay <- function(newCapDestroyRelay) { capDestroyRelay = newCapDestroyRelay; }; Mission.GetCapDestroyRelay <- function() { return capDestroyRelay; }; Mission.SetFlagDetectionZone <- function(newFlagDetectionZone) { flagDetectionZone = newFlagDetectionZone; }; Mission.GetFlagDetectionZone <- function() { return flagDetectionZone; }; Mission.SetBomb <- function(newBomb) { bomb = newBomb; }; Mission.GetBomb <- function() { return bomb; }; Mission.AddForcedFlagDetectionZone <- function(parentEntity, offset = Vector()) { local flagDetectionZone = SpawnEntityFromTable("func_flagdetectionzone", { origin = parentEntity.GetOrigin() + offset, TeamNum = Constants.ETFTeam.TF_TEAM_BLUE, StartDisabled = true, alarm = true, }); flagDetectionZone.SetSize(Vector(-1.0, -1.0, -1.0) * 64.0, Vector(1.0, 1.0, 1.0) * 64.0); flagDetectionZone.SetSolid(Constants.ESolidType.SOLID_BBOX); flagDetectionZone.AcceptInput("SetParent", "!activator", parentEntity, parentEntity); forcedFlagDetectionZoneList.append(flagDetectionZone); } Mission.StartForcedBombAlarm <- function() { if (isForcingBombAlarm == true) { return; } isForcingBombAlarm = true; foreach (flagDetectionZone in forcedFlagDetectionZoneList) { flagDetectionZone.AcceptInput("Enable", "", null, null); } } Mission.StopForcedBombAlarm <- function() { if (isForcingBombAlarm == false) { return; } isForcingBombAlarm = false; foreach (flagDetectionZone in forcedFlagDetectionZoneList) { flagDetectionZone.AcceptInput("Disable", "", null, null); } }