//==========================================================================================
//
//	eichsfeld.gm
//
//	Who                    	When		What
//------------------------------------------------------------------------------------------
//	^1{WeB}^7*^4GA^1NG$^4TA^7*	26 June 2015	Initial Script
//
//==========================================================================================
//

global Map =
{
	Debug = 0, // please set to zero before distributing your script

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

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

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

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

	Courtyard_Wall_Destroyed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"DEFEND_maingate_1",
			"DEFEND_maingate_2",
			"DEFEND_maingate_3",
			"DEFEND_maingate_4",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_maingate_5",
			"DEFEND_maingate_6",
			"DEFEND_maingate_7",
		});

		Util.MapDebugPrint( "Courtyard_Wall_Destroyed" );
	},

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

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

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

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

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

	Main_Blast_Door_Open = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_main_entrance_1" );
		SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_main_entrance_2" );

		Util.MapDebugPrint( "Main_Blast_Door_Open" );
	},

	Main_Blast_Door_Closed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_main_entrance_2" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_main_entrance_1" );

		Util.MapDebugPrint( "Main_Blast_Door_Closed" );
	},

	Control_Door_Open = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Ladebucht_1" );
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_Ladebucht_1" );

		Util.MapDebugPrint( "Control_Door_Open" );
	},

	Control_Door_Closed = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_Ladebucht_1" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Ladebucht_1" );

		Util.MapDebugPrint( "Control_Door_Closed" );
	},
};

global OnMapLoad = function()
{
	//OnTrigger( "MISSING_STRING", Map.Command_Post_Built );
	OnTrigger( "The side gate has been built!", Map.side_gate_Built );
	OnTrigger( "^7Control Door opening!", Map.Control_Door_Open );
	OnTrigger( "^7Control Door closing!", Map.Control_Door_Closed );
	OnTrigger( "^7Main blast door opening!", Map.Main_Blast_Door_Open );
	OnTrigger( "^7Main blast door closing!", Map.Main_Blast_Door_Closed );
	//OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed );
	OnTrigger( "Allies have destroyed the Controls!", Map.Controls_Destroyed );
	OnTrigger( "The Courtyard Wall has been breached!", Map.Courtyard_Wall_Destroyed );
	OnTrigger( "Allies have breached the Main Entrance and secured the Entrance Area!", Map.Main_Entrance_Destroyed );
	OnTrigger( "Allies have destroyed the Side Door!", Map.side_door_Destroyed );
	OnTrigger( "The side gate has been destroyed!", Map.side_gate_Destroyed );
	OnTrigger( "Axis recapture the Entrance Area!", Map.forward_spawn_Axis_Captured );
	OnTrigger( "Allies capture the Entrance Area!", Map.forward_spawn_Allies_Captured );

	SetGoalPriority("PLANT_Main_Entrance", 0.91);
	SetGoalPriority("PLANT_side_door", 0.91);
	SetGoalPriority("PLANT_Courtyard_Wall", 0.91);
	SetGoalPriority("PLANT_side_gate", 0.91);
	SetGoalPriority("PLANT_Controls", 0.91);

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