//==========================================================================================
//
//	pipeline.gm
//
//	Who                    	When		What
//------------------------------------------------------------------------------------------
//	^1{WeB}^7*^4GA^1NG$^4TA^7*	17 September 2015	Initial Script
//
//==========================================================================================
//

global Map =
{
	Axis_tunnel_MG_Nest_Built = function()
	{
		Util.MapDebugPrint( "Axis_tunnel_MG_Nest_Built" );
	},

	Command_Post_Built = function()
	{
		Util.MapDebugPrint( "Command_Post_Built" );
	},

	Axis_tunnel_MG_Nest_Destroyed = function()
	{
		Util.MapDebugPrint( "Axis_tunnel_MG_Nest_Destroyed" );
	},

	Command_Post_Destroyed = function()
	{
		Util.MapDebugPrint( "Command_Post_Destroyed" );
	},

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

		Util.MapDebugPrint( "Main_Entrance_Destroyed" );
	},

	Side_Entrance_Destroyed = function()
	{
		Util.MapDebugPrint( "Side_Entrance_Destroyed" );
	},

	radarbox1_Taken = function()
	{
		Util.MapDebugPrint( "radarbox1_Taken" );
	},

	radarbox2_Taken = function()
	{
		Util.MapDebugPrint( "radarbox2_Taken" );
	},

	radarbox1_Returned = function()
	{
		Util.MapDebugPrint( "radarbox1_Returned" );
	},

	radarbox2_Returned = function()
	{
		Util.MapDebugPrint( "radarbox2_Returned" );
	},

	radarbox1_Secured = function()
	{
		Util.MapDebugPrint( "radarbox1_Secured" );
	},

	radarbox2_Secured = function()
	{
		Util.MapDebugPrint( "radarbox2_Secured" );
	},

	roadbunker_Axis_Captured = function()
	{
		Util.MapDebugPrint( "roadbunker_Axis_Captured" );
	},

	roadbunker_Allies_Captured = function()
	{
		Util.MapDebugPrint( "roadbunker_Allies_Captured" );
	},

};

global OnMapLoad = function()
{
	OnTrigger( "MISSING_STRING", Map.Axis_tunnel_MG_Nest_Built );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Axis_tunnel_MG_Nest_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed );
	OnTrigger( "Allies have breached the Main Entrance and secured the Forward Bunker!", Map.Main_Entrance_Destroyed );
	OnTrigger( "Allies have breached the Side Entrance!", Map.Side_Entrance_Destroyed );
	OnTrigger( "MISSING_STRING", Map.radarbox1_Taken );
	OnTrigger( "MISSING_STRING", Map.radarbox2_Taken );
	OnTrigger( "MISSING_STRING", Map.radarbox1_Returned );
	OnTrigger( "MISSING_STRING", Map.radarbox2_Returned );
	OnTrigger( "MISSING_STRING", Map.radarbox1_Secured );
	OnTrigger( "MISSING_STRING", Map.radarbox2_Secured );
	OnTrigger( "Axis reclaim the Forward Bunker!", Map.roadbunker_Axis_Captured );
	OnTrigger( "Allies capture the Forward Bunker!", Map.roadbunker_Allies_Captured );

	SetGoalPriority( "PLANT_Main_Entrance", 0.91 );
	SetGoalPriority( "PLANT_Side_Entrance", 0.85 );

	SetAvailableMapGoals( TEAM.AXIS, true, {
		"DEFEND_radar_1",
		"DEFEND_radar_2",
		"DEFEND_truck_1",
		"DEFEND_truck_2",
		"DEFEND_truck_3",
		"DEFEND_truck_4",
	});
	SetAvailableMapGoals( TEAM.ALLIES, false, "PLANT_Axis_tunnel_MG_Nest" );
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"PLANT_Main_Entrance",
		"PLANT_Side_Entrance",
		"CHECKPOINT_roadbunker",
		"FLAG_radarbox1",
		"FLAG_radarbox2",
	});

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