//==========================================================================================================
//
//	uje_the_beast.gm
//
//	Who       	            When		           What
//----------------------------------------------------------------------------------------------------------
//	[UJE]Niek	      17 November 2012	      Initial Script
//	[UJE]Captain	24 May 2018	            Add Attack/Defence/Routes/Rôles And more...
//	[UJE]Captain	24 June 2019	      Add Defuse Dyno at Bridge if Engi inside Lab2 clean & fix
//
//==========================================================================================================
//

global Map =
{
	Debug = 0, // please set to zero before distributing your script
	BeastAtCage = false,
	BeastBuilt = false,
	BridgeBuild = false,
	DoorClosed = true,
	BeastAtSpawn = true,
	EngInside = 0,

	// Rôles
	Roles =
	{
		AXIS =
		{
		      AllBots = true, // each bot is considered for a role
			ATTACKER = // Attack Lab1
			{
				numbots = 3,
			},

			ESCORT = // Escort
			{
				numbots = 1,
				crucialClass = CLASS.ENGINEER,
			},

			INFILTRATOR = // Plant CP
			{
				numbots = 1,
				crucialClass = CLASS.COVERTOPS,
			},
		},
		ALLIES =
		{
			AllBots = true, // default: every other bot
			DEFENDER = // Defend Lab1
			{
				numbots = 3,
			},

			INFILTRATOR = // Plant CP
			{
				numbots = 1,
				crucialClass = CLASS.COVERTOPS,
			},
		},
	},
     //Cage switch control
	Cage_Switch = function(trigger)
	{
	if (Map.Debug) { print("tbdoor1_lever1_Moving"); }
		Map.Cage_pos = "Moving"; //elevator one is moving now
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_cage" );
		sleep(3.0); //wait is 6.5 in map script
		vel = ToVector(trigger.Action);
		if(vel.z < 0) //Cage Door Closed
		{
		Map.DoorClosed = true;
		if ( Map.BeastAtSpawn )
	      {
		SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_cage" );
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Beast" );
            }
		Util.MapDebugPrint("Cage door is closed");
		}
		else if(vel.z > 0)//Cage Door Opened
		{
            Map.DoorClosed = true;
            SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_cage" );
		if ( Map.BeastAtSpawn  )
	      {
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Beast" );
		}
		Util.MapDebugPrint("Cage door is opened");
		}
      },

	Beast_Built = function( trigger )
	{
		Map.BeastBuilt = true;
		if ( !Map.BeastAtCage )
	      {
		SetAvailableMapGoals( TEAM.AXIS, true, "ESCORT_beast" );
		}
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Beast" );

		Util.MapDebugPrint( "Beast_Built" );
	},

	Beast_Damaged = function( trigger )
	{
	Map.BeastBuilt = false;
		if ( Map.BeastAtCage or Map.DoorClosed && Map.BeastAtSpawn )
	      {
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Beast" );
		}
		else
		{
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Beast" );
		}
		Util.MapDebugPrint( "Beast_Damaged" );
	},

	Allied_Command_Post_Built = function( trigger )
	{
	      SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Command_Post" );
	      SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Command_Post" );

	      SetAvailableMapGoals( TEAM.ALLIES, false, {"BUILD_Command_Post","PLANT_Command_Post"} );

		Util.MapDebugPrint( "Allied_Command_Post_Built" );
	},

      Axis_Command_Post_Built = function( trigger )
	{
	      SetAvailableMapGoals( TEAM.AXIS, false, {"BUILD_Command_Post","PLANT_Command_Post"} );

            SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Command_Post" );
            SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Command_Post" );

	      Util.MapDebugPrint( "Axis_Command_Post_Built" );
	},

	Axis_Command_Post_Destroyed = function( trigger )
	{
	      SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );
	      SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );

	      SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
	      SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );

	      Util.MapDebugPrint( "Axis_Command_Post_Destroyed" );
	},

	Allied_Command_Post_Destroyed = function( trigger )
	{
	      SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Command_Post" );
	      SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Command_Post" );

	      SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Command_Post" );
	      SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Command_Post" );

	      Util.MapDebugPrint( "Allied_Command_Post_Destroyed" );
	},

	Sideway_Up_Built = function( trigger )
	{
	      SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Sideway_Up" );

	      SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Sideway_Up" );

	      Util.MapDebugPrint( "Sideway_Up_Built" );
	},

	Sideway_Up_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Sideway_Up" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Sideway_Up" );
		ClearGoalRole({ "ATTACK_Lab1.*","DEFEND_Lab1.*" }, ROLE.DEFENDER,ROLE.ATTACKER);

		Util.MapDebugPrint( "Sideway_Up_Destroyed" );
	},

	Allied_ForceField_Control_1_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {"PLANT_Allied_ForceField_Control_1","ATTACK_Lab1.*"} );

		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Lab1.*" );

		ClearGoalRole("DEFEND_Lab1.*", ROLE.DEFENDER );
		ClearGoalRole("ATTACK_Lab1.*", ROLE.ATTACKER );

		Util.MapDebugPrint( "Allied_ForceField_Control_1_Destroyed" );
	},

	Allied_ForceField_Control_2_Destroyed = function( trigger )
	{
	if ( Map.BridgeBuild )
      {
		SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Bridge" );
	}
		SetAvailableMapGoals( TEAM.ALLIES, false, {"DEFEND_Lab2.*","DEFEND_Inside.*"} );

		ClearGoalRole("DEFEND_Lab1.*", ROLE.DEFENDER );
		ClearGoalRole("ATTACK_Lab1.*", ROLE.ATTACKER );

		Util.MapDebugPrint( "Allied_ForceField_Control_2_Destroyed" );
	},

	Bridge_Built = function( trigger )
	{
      Map.BridgeBuild = true;
	if ( Map.Allied_ForceField_Control_2_Destroyed )
	{
	      SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Inside.*" );
		SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Lab2.*" );

	      SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Inside.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Lab2.*" );
	}
	if ( Map.EngInside == 0 )
	{
	      SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Bridge" );
	}
		Util.MapDebugPrint( "Bridge_Built" );
	},

	Planted_Bridge = function( trigger )
	{
	if ( Map.EngInside > 0 )
	{
	      SetAvailableMapGoals( TEAM.ALLIES, true, "DEFUSE_Bridge.*" );
	}
      if ( Map.Allied_ForceField_Control_2_Destroyed )
	{
      SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Allied_ForceField_Control_2" );
	}
	if ( !Map.Allied_ForceField_Control_2_Destroyed )
	{
	      SetAvailableMapGoals( TEAM.AXIS, false, "DEFUSE_Bridge.*" );
	}
		Util.MapDebugPrint( "Planted at The Bridge" );
	},

	Bridge_Destroyed = function( trigger )
	{
	Map.BridgeBuild = false;
	if ( Map.Allied_ForceField_Control_2_Destroyed )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, {"BUILD_Bridge","ATTACK_Lab2.*"} );
		SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Inside.*" );

		SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Lab2.*" );
	      SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Inside.*" );
	}
	      SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Bridge" );

		Util.MapDebugPrint( "Bridge_Destroyed" );
	},

	oldcityflag_Axis_Captured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_oldcityflag" );
		SetAvailableMapGoals( TEAM.AXIS, true, ".*CAB_uje7.*" );

		SetAvailableMapGoals( TEAM.ALLIES, false, ".*CAB_uje7.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "CHECKPOINT_oldcityflag" );

		Util.MapDebugPrint( "oldcityflag_Axis_Captured" );
	},

	oldcityflag_Allies_Captured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, ".*CAB_uje7.*" );
		SetAvailableMapGoals( TEAM.AXIS, true, "CHECKPOINT_oldcityflag" );

		SetAvailableMapGoals( TEAM.ALLIES, true, ".*CAB_uje7.*" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_oldcityflag" );

		Util.MapDebugPrint( "oldcityflag_Allies_Captured" );
	},

	Axis_Hold_Flag = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "CHECKPOINT_oldcityflag" );

		SetAvailableMapGoals( TEAM.ALLIES, false, "CHECKPOINT_oldcityflag" );

		Util.MapDebugPrint( "Axis_Hold_Flag" );
	},

	Beast_broken_doors = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Phase3.*" );
		SetAvailableMapGoals( TEAM.ALLIES, true, {"DEFEND_Lab1.*","DEFEND_Lab2.*"} );

		SetAvailableMapGoals( TEAM.AXIS, true, {"PLANT_Allied_ForceField_Control_1","BUILD_Bridge","BUILD_Sideway_Up","ATTACK_Lab1.*","ATTACK_Lab2.*"} );
		SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Phase3.*" );

		if ( Map.Allied_ForceField_Control_1_Destroyed )
	      {
		SetAvailableMapGoals( TEAM.AXIS, true, {"PLANT_Allied_ForceField_Control_1","ATTACK_Lab1.*"} );
		}
		if ( Map.Allied_ForceField_Control_2_Destroyed )
	      {
		SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Lab2.*" );
		}
		if ( Map.Allied_ForceField_Control_2_Destroyed && Map.Allied_ForceField_Control_1_Destroyed )
	      {
		SetGoalRole("ATTACK_Lab1.*", ROLE.ATTACKER );
		SetGoalRole("DEFEND_Lab1.*", ROLE.DEFENDER );
		}
		if ( Map.Allied_ForceField_Control_2_Destroyed )
	      {
            SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Bridge" );
		}
		Util.EnableGoal({".*CAB_uje1.*",".*CAB_uje3.*"});
		Util.MapDebugPrint( "Beast_broken_doors" );
	},

	beast_at_spawn =
      {
 	Name="beast_at_spawn",
 	TriggerOnClass = { CLASS.VEHICLE_HVY },
 	OnEnter = function(ent)
 	{
	Map.BeastAtSpawn = true;

	SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_cage" );

 		Util.MapDebugPrint ( "beast_at_spawn" );
 	},
 	      OnExit = function(ent)
 	      {
		Map.BeastAtSpawn = false;

 		Util.MapDebugPrint ( "beast_leave_spawn" );
 	      },
      },
	beast_at_bridge =
      {
 	Name="beast_at_bridge",
 	TriggerOnClass = { CLASS.VEHICLE_HVY },
 	OnEnter = function(ent)
 	{
 		Util.MapDebugPrint ( "beast_at_bridge" );
 	},
 	     OnExit = function(ent)
 	     {
	     SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Phase1.*" );
	     SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Phase2.*" );

           SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Phase1.*" );
	     SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Phase2.*" );

 		Util.MapDebugPrint ( "beast_goto_town" );
 	     },
      },
	beast_entered_town =
      {
 	Name="beast_entered_town",
 	TriggerOnClass = { CLASS.VEHICLE_HVY },
 	OnEnter = function(ent)
 	{
 		Util.MapDebugPrint ( "beast_at_bridge" );
 	},
 	     OnExit = function(ent)
 	     {
	     SetAvailableMapGoals( TEAM.ALLIES, false, "DEFEND_Phase2.*" );
	     SetAvailableMapGoals( TEAM.ALLIES, true, "DEFEND_Phase3.*" );

           SetAvailableMapGoals( TEAM.AXIS, false, "ATTACK_Phase2.*" );
	     SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_Phase3.*" );

 		Util.MapDebugPrint ( "beast_exit_town" );
 	     },
      },
	beast_near_doors =
      {
 	Name="beast_near_doors",
 	TriggerOnClass = { CLASS.VEHICLE_HVY },
 	OnEnter = function(ent)
 	{
	SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_beast" );
	ETUtil.SetExcludeIndexes( "ESCORT_beast", {1} );
 		Util.MapDebugPrint ( "beast_at_doors" );
 	},
 	     OnExit = function(ent)
 	    {
            ETUtil.SetExcludeIndexes( "ESCORT_beast", {} );
 		Util.MapDebugPrint ( "beast_pass_doors" );
 	    },
      },
	beast_into_cage =
      {
 	Name="beast_into_cage",
 	TriggerOnClass = { CLASS.VEHICLE_HVY },
 	OnEnter = function(ent)
 	{
	Map.BeastAtCage = true;
	SetAvailableMapGoals( TEAM.AXIS, false, "ESCORT_beast" );

 		Util.MapDebugPrint ( "beast_into_cage" );
 	   },
 	      OnExit = function(ent)
 	      {

 		Util.MapDebugPrint ( "beast_into_yard" );
 	      },
      },
	axis_engi_inside_lab2 =
	{
		Name = "axis_engi_inside_lab2",
		TriggerOnClass = CLASS.ANYPLAYER,
		OnEnter = function(ent)
		{
			if ( GetEntTeam(ent) == TEAM.AXIS )
			{
			      if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
				Map.EngInside += 1;
				SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Bridge" );

				Util.MapDebugPrint( "Trigger region - Axis Engi Inside Lab2" );
			}
	      }
	},
		OnExit = function(ent)
		{
			if ( GetEntTeam(ent) == TEAM.AXIS )
			{
			      if ( GetEntClass(ent) == CLASS.ENGINEER )
				{
				Map.EngInside -= 1;

				Util.MapDebugPrint( "Trigger region - Lab2 is safe" );
			      }
		      if ( Map.Allied_ForceField_Control_2_Destroyed && Map.BridgeBuild && Map.EngInside == 0 )
	            {
			SetAvailableMapGoals( TEAM.AXIS, false, "PLANT_Allied_ForceField_Control_2" );

		      SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Bridge" );
	            }
		   }
		},
	},
};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "^5The Beast has revived", Map.Beast_Built );
	OnTrigger( "^4Allied Command Post constructed", Map.Allied_Command_Post_Built );
	OnTrigger( "^1Axis Command Post constructed", Map.Axis_Command_Post_Built );
	OnTrigger( "^1The Sideway has been build.", Map.Sideway_Up_Built );
	OnTrigger( "^1Axis have destroyed Forcefield Control 1", Map.Allied_ForceField_Control_1_Destroyed );
	OnTrigger( "^1Axis have destroyed Forcefield Control 2", Map.Allied_ForceField_Control_2_Destroyed );
	OnTrigger( "^1The Bridge has been build.", Map.Bridge_Built );
	OnTrigger( "Planted at The Bridge.", Map.Planted_Bridge );
	OnTrigger( "^3The Bridge has been destroyed.", Map.Bridge_Destroyed );
	OnTrigger( "^1Axis team has destroyed the Allied Command Post", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "^4Allied team has destroyed the Axis Command Post", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "^3The Sideway has been destroyed.", Map.Sideway_Up_Destroyed );
	OnTrigger( "Axis reclaim the Town!", Map.oldcityflag_Axis_Captured );
	OnTrigger( "Allies capture the Town!", Map.oldcityflag_Allies_Captured );
	OnTrigger( "^1Axis hold the flag now", Map.Axis_Hold_Flag );
	OnTrigger( "^1The beast has been damaged", Map.Beast_Damaged );
	OnTrigger( "^3The Beast has broken into the Yard", Map.Beast_broken_doors );

	// Beast TriggerRegion
	beast_at_spawn = OnTriggerRegion(AABB(-2809.870,-2643.800,0.226,-2575.158,-2446.098,84.971), Map.beast_at_spawn);
      beast_at_bridge = OnTriggerRegion(AABB(-1735.422,1080.708,41.394,-1425.571,1361.092,148.241), Map.beast_at_bridge);
	beast_entered_town = OnTriggerRegion(AABB(-1066.965,2410.226,65.125,923.097,2621.061,192.136), Map.beast_entered_town);
	beast_near_doors = OnTriggerRegion(AABB(2415.182,-382.553,323.651,2591.652,206.627,427.125), Map.beast_near_doors);
	beast_into_cage = OnTriggerRegion(AABB(2177.068,-2029.933,286.311,2245.204,-1991.173,360.703), Map.beast_into_cage);
	axis_engi_inside_lab2 = OnTriggerRegion(AABB(-1270.556,-2161.895,25.877,-624.491,-683.075,565.844), Map.axis_engi_inside_lab2);

	// Disable Push/Combat Movement triggers
	Exit_Spawn_Switch =  OnTriggerRegion(AABB(-2788.331,-3052.846,2.916,-2097.891,-2224.459,365.454), RegionTrigger.DisableCombatMovement );
	Exit_Spawn_Switch =  OnTriggerRegion(AABB(-2788.331,-3052.846,2.916,-2097.891,-2224.459,365.454), RegionTrigger.DisableBotPush  );

	// Cage Switch
      OnTrigger("tbdoor1_lever1_goto", Map.Cage_Switch);

	Util.DisableGoal( ".*", true ); // all but routes

	// activation ALLIES
	SetAvailableMapGoals( TEAM.ALLIES, true, {
	"DEFEND_Phase1.*",
	".*CAB_uje7.*",
	"BUILD_Command_Post",
	"CHECKPOINT.*",
	});

	// activation AXIS
	SetAvailableMapGoals( TEAM.AXIS, true, {
	".*CAB_uje5.*",
	"ATTACK_Phase1.*",
	"CHECKPOINT.*"
	});

	// Priorities
	SetGoalPriority( "SWITCH_cage", 0.92, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Beast", 0.96, TEAM.AXIS, CLASS.ENGINEER );
	SetGoalPriority( "BUILD_Command_Post", 0.90 );
	SetGoalPriority( "PLANT_Command_Post", 0.92 );
	SetGoalPriority( "PLANT_Bridge", 0.98 );
	SetGoalPriority( "PLANT_Allied_ForceField_Control.*", 0.94 );
	SetGoalPriority( "ESCORT.*", 0.98 );
	SetGoalPriority( "CHECKPOINT.*", 0.92 );
	SetGoalPriority( "DEFUSE_Bridge.*", 0.98 );

	// Max users per goal
	Util.SetMaxUsers( 1, "ATTACK.*" );
	Util.SetMaxUsers( 1, "DEFEND.*" );
	Util.SetMaxUsers( 1, "BUILD.*" );
	Util.SetMaxUsers( 1, "PLANT.*" );
	Util.SetMaxUsers( 1, "CHECKPOINT.*" );
	Util.SetMaxUsers( 1, "SWITCH.*" );
	Util.SetMaxUsers( 1, "ESCORT.*" );
	Util.SetMaxUsers( 2, "DEFUSE_Bridge.*" );

	// Camp times
	SetMapGoalProperties( "ATTACK.*", {MinCampTime=50, MaxCampTime=80} );
	SetMapGoalProperties( "DEFEND.*", {MinCampTime=60, MaxCampTime=90} );

	Util.AddUseWp( "PLANT_Allied_ForceField_Control_2", "plant_ff2" );
      Util.AddUseWp( "PLANT_Allied_ForceField_Control_1", "plant_ff1_01" );
	Util.AddUseWp( "PLANT_Allied_ForceField_Control_1", "plant_ff1_02" );
	Util.AddUseWp( "PLANT_Sideway_Up", "plant_sideway" );

	// Clear Roles on Start Map
	ClearGoalRole( "ATTACK_Lab1.*", ROLE.ATTACKER );
	ClearGoalRole( "DEFEND_Lab1.*", ROLE.DEFENDER );

	Util.MapDebugPrint( "Omni-bot map script for " + GetMapName() + " executed." );
};

global OnBotJoin = function( bot )
{
	bot.TargetBreakableDist = 90.0;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		PLANT_Allied_ForceField_Control_1 =
		{
			ROUTE_Flag_Spawn  =
			{
				ROUTE_Water_Wheel  =
				{
					ROUTE_Sideway  =
					{
						ROUTE_Right_Stream  =
						{
						},
					},
					ROUTE_House_Cab3  =
					{
						ROUTE_Stair_Cab3  =
						{
							ROUTE_Door_Top_Lab1  =
							{
							},
						},
					},
				},
				ROUTE_Bridge3  =
				{
					ROUTE_CP  =
					{
						ROUTE_Doors  =
						{
							ROUTE_Left_Stream  =
							{     Weight = 4,
								ROUTE_UJE_Cab1  =
								{
								},
								ROUTE_Doors_Lab1  =
								{
								},
							},
							ROUTE_Stair_Cab3  =
							{
								ROUTE_Door_Top_Lab1  =
								{
								},
							},
							ROUTE_House_Cab3  =
							{
								ROUTE_Stair_Cab3  =
								{
									ROUTE_Door_Top_Lab1  =
									{
									},
								},
							},
						},
						ROUTE_Broken_Wall  =
						{
							ROUTE_Left_Stream  =
							{
								ROUTE_UJE_Cab1  =
								{
								},
								ROUTE_Doors_Lab1  =
								{
								},
								ROUTE_Stair_Cab3  =
								{
									ROUTE_Door_Top_Lab1  =
									{
									},
								},
							},
							ROUTE_House_Cab3  =
							{
								ROUTE_Stair_Cab3  =
								{
									ROUTE_Door_Top_Lab1  =
									{
									},
								},
							},
						},
					},
				},
			},
		},
		PLANT_Allied_ForceField_Control_2 =
		{
			ROUTE_Flag_Spawn  =
			{
				ROUTE_Water_Wheel  =
				{
					ROUTE_Sideway_Up  =
					{
					},
					ROUTE_Sideway  =
					{
						ROUTE_House_Cab3  =
						{
							ROUTE_Lab2_Bridge  =
							{
							},
						},
					},
				},
				ROUTE_Bridge3  =
				{
					ROUTE_CP  =
					{
						ROUTE_Broken_Wall  =
						{
							ROUTE_Sideway_Up  =
							{
								ROUTE_Lab2_Bridge  =
								{
								},
							},
							ROUTE_House_Cab3  =
							{
								ROUTE_Lab2_Bridge  =
								{
								},
							},
						},
						ROUTE_Doors  =
						{
							ROUTE_Sideway_Up  =
							{
								ROUTE_Lab2_Bridge  =
								{
								},
							},
							ROUTE_House_Cab3  =
							{
								ROUTE_Lab2_Bridge  =
								{
								},
							},
						},
					},
				},
			},
		},
		CHECKPOINT_oldcityflag =
		{
			ROUTE_First_Axis_S  =
			{
				ROUTE_Roof_Beast  =
				{
					ROUTE_UJE_Cab5  =
					{
						ROUTE_Arcade  =
						{
							ROUTE_Arcade_Stairs  =
							{
							},
							ROUTE_Bridge1  =
							{
							},
							ROUTE_Town  =
							{
								ROUTE_Bridge2  =
								{
								},
								ROUTE_Town_Exit  =
								{
									ROUTE_Bridge3  =
									{
									},
								},
							},
						},
					},
				},
				ROUTE_Right_River  =
				{
					ROUTE_River_Bridge1  =
					{
						ROUTE_River_Bridge2  =
						{
						},
					},
					ROUTE_Bridge1  =
					{
					},
				},
			},
		},
	};
	MapRoutes["ATTACK_Phase1.*"] =
		{
			ROUTE_First_Axis_S  =
			{Weight = 4,
				ROUTE_Right_River  =
				{
				},
			},
	};
	MapRoutes["ATTACK_Phase3.*"] =
		{
			ROUTE_Flag_Spawn  =
			{
				ROUTE_Bridge3  =
				{
					ROUTE_House_Cab7  =
					{
						ROUTE_House_Cab7_Exit  =
						{
						},
					},
					ROUTE_CP  =
					{
					},
				},
				ROUTE_Bridge2  =
				{
					ROUTE_Town_Exit  =
					{
						ROUTE_CP  =
						{
						},
					},
				},
			},
		};
	MapRoutes["ATTACK_Phase2.*"] = MapRoutes.CHECKPOINT_oldcityflag;
	MapRoutes["ATTACK_Lab1.*"] = MapRoutes.PLANT_Allied_ForceField_Control_1;
	MapRoutes["ATTACK_Lab2.*"] = MapRoutes.PLANT_Allied_ForceField_Control_2;
	MapRoutes["ATTACK_Inside.*"] = MapRoutes.PLANT_Allied_ForceField_Control_2;
	Util.Routes(MapRoutes);
};
