//==========================================================================================
//
//	et_dark_phx_final.gm
//
//	Who                    	When		What
//------------------------------------------------------------------------------------------
//	^1{WeB}^7*^4GA^1NG$^4TA^7*	15 June 2016	Initial Script
//
//==========================================================================================
//

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

	Allied_CP_2_Built = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Call_Air_Raid" );

		Util.MapDebugPrint( "Allied_CP_2_Built" );
	},

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

	Portable_Radar_Built = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Allied_CP_2" );
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Portable_Radar" );

		Util.MapDebugPrint( "Portable_Radar_Built" );
	},

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

	Tank_Barrier_Built = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "PLANT_Assault_Ramp_2" );

		Util.MapDebugPrint( "Tank_Barrier_Built" );
	},

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

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

	Crypt_Floor_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Heinrichs_Tomb" );

		Util.MapDebugPrint( "Crypt_Floor_Destroyed" );
	},

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

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

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

	West_Crypt_Access_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "PLANT_Crypt_Floor" );

		Util.MapDebugPrint( "West_Crypt_Access_Destroyed" );
	},

	Tank_Stolen = function()
	{
		//selfkill for change spawnpoint
		ETUtil.SuicideSpawn( TEAM.AXIS, 0 );

		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"PLANT_Tank_Barrier",
			"BUILD_Allied_Assault_Ramp",
			"DEFEND_Tank_Barrier_5",
			"DEFEND_Tank_Barrier_6",
			"DEFEND_Tank_Barrier_7",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"BUILD_Tank_Barrier",
			"DEFEND_Tank_Barrier_1",
			"DEFEND_Tank_Barrier_2",
			"DEFEND_Tank_Barrier_3",
			"DEFEND_Tank_Barrier_4",
			"PLANT_Assault_Ramp_2",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"DEFEND_tank_7",
			"DEFEND_tank_8",
			"DEFEND_tank_9",
			"DEFEND_tank_10",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_tank_1",
			"DEFEND_tank_2",
			"DEFEND_tank_3",
			"DEFEND_tank_4",
			"DEFEND_tank_5",
			"DEFEND_tank_6",
		});

		Util.MapDebugPrint( "Tank_Stolen" );
	},

	Crypt_Gate_Open = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_Tomb_1",
			"DEFEND_Tomb_2",
			"DEFEND_Tomb_3",
			"DEFEND_Tomb_4",
			"DEFEND_Tomb_5",
			"DEFEND_Tomb_6",
		});
		  SetAvailableMapGoals( TEAM.ALLIES, true, {
			"DEFEND_Tomb_7",
			"DEFEND_Tomb_8",
			"DEFEND_Tomb_9",
			"DEFEND_Tomb_10",
			"PLANT_Main_Crypt_Access",
			"PLANT_West_Crypt_Access",
		  });
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"ESCORT_tank",
			"MOUNT_tank",
			"BUILD_Tank",
			"DEFEND_CP_1",
			"DEFEND_CP_2",
			"DEFEND_CP_3",
			"BUILD_Allied_CP_2",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_CP_4",
			"DEFEND_CP_5",
			"DEFEND_CP_6",
			"DEFEND_CP_7",
			"ESCORT_tank",
			"PLANT_Allied_CP_2",
		});

		Util.MapDebugPrint( "Crypt_Gate_Open" );
	},

	Bridge_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, "BUILD_Axis_Bridge" );
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"SWITCH_Call_Air_Raid",
			"PLANT_Portable_Radar",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, "BUILD_Portable_Radar" );

		Util.MapDebugPrint( "Bridge_Destroyed" );
	},

	Tank_Passed_Old_House = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"BUILD_Portable_Radar",
			"DEFEND_CP_1",
			"DEFEND_CP_2",
			"DEFEND_CP_3",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_CP_4",
			"DEFEND_CP_5",
			"DEFEND_CP_6",
			"DEFEND_CP_7",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"BUILD_Allied_Assault_Ramp",
			"DEFEND_Tank_Barrier_5",
			"DEFEND_Tank_Barrier_6",
			"DEFEND_Tank_Barrier_7",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"BUILD_Axis_Watchtower_MG_Nest",
			"BUILD_Tank_Barrier",
			"DEFEND_Tank_Barrier_1",
			"DEFEND_Tank_Barrier_2",
			"DEFEND_Tank_Barrier_3",
			"DEFEND_Tank_Barrier_4",
			"PLANT_Assault_Ramp_2",
		});

		Util.MapDebugPrint( "Tank_Passed_Old_House" );
	},

	Transmission_Sent = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_Call_Air_Raid" );
		SetAvailableMapGoals( TEAM.AXIS, true, "SWITCH_Call_Air_Raid" );

		Util.MapDebugPrint( "Transmission_Sent" );
	},

	Transmission_Interrupted= function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_Call_Air_Raid" );
		SetAvailableMapGoals( TEAM.ALLIES, true, "SWITCH_Call_Air_Raid" );

		Util.MapDebugPrint( "Transmission_Interrupted" );
	},

	Transmission_Finished = function()
	{
		SetAvailableMapGoals( TEAM.ALLIES, false, "SWITCH_Call_Air_Raid" );

		Util.MapDebugPrint( "Transmission_Finished" );
	},

	Bridge_Ramp_Constructed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "SWITCH_Call_Air_Raid" );

		Util.MapDebugPrint( "Bridge_Ramp_Constructed" );
	},

	Bridge_Ramp_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "BUILD_Axis_Bridge" );

		Util.MapDebugPrint( "Bridge_Ramp_Destroyed" );
	},

};

global OnMapLoad = function()
{
	OnTrigger( "The Allied Assault Ramp has been constructed.", Map.Allied_Assault_Ramp_Built );
	OnTrigger( "The Axis Bridge Ramp has been constructed.", Map.Bridge_Ramp_Constructed );
	OnTrigger( "The Axis Watchtower MG Nest has been constructed.", Map.Axis_Watchtower_MG_Nest_Built );
	OnTrigger( "The Allied has repaired the Portable Radar.", Map.Portable_Radar_Built );
	OnTrigger( "The Tank has been repaired!", Map.Tank_Built );
	OnTrigger( "Allied Command Post constructed. Charge speed increased!", Map.Allied_CP_2_Built );
	OnTrigger( "Allied team has stolen the Tank!", Map.Tank_Stolen );
	OnTrigger( "Tank Barrier has been constructed.", Map.Tank_Barrier_Built );
	OnTrigger( "Axis have destroyed the Allied Assault Ramp.", Map.Allied_Assault_Ramp_Destroyed );
	OnTrigger( "The Axis Watchtower MG Nest has been destroyed.", Map.Axis_Watchtower_MG_Nest_Destroyed );
	OnTrigger( "Allies have opened the Crypt Wall!", Map.Crypt_Floor_Destroyed );
	OnTrigger( "Allies destroyed the Heinrich's Tomb!", Map.Heinrichs_Tomb_Destroyed );
	OnTrigger( "Allies have opened the Crypt Access!", Map.Main_Crypt_Access_Destroyed );
	OnTrigger( "Axis has destroyed the Allied Portable Radar.", Map.Portable_Radar_Destroyed );
	OnTrigger( "Allies have opened the West Crypt Access!", Map.West_Crypt_Access_Destroyed );
	OnTrigger( "Allied have destroyed the Axis Bridge Ramp.", Map.Bridge_Ramp_Destroyed );
	OnTrigger( "Allied team has opened the Crypt Gate!", Map.Crypt_Gate_Open );
	OnTrigger( "Allied Air Support has destroyed the Bridge!", Map.Bridge_Destroyed );
	OnTrigger( "The Tank has passed the Old Destroyed House!", Map.Tank_Passed_Old_House );
	OnTrigger( "^1The Allies are sending the Bridge coordinates in 35 seconds...", Map.Transmission_Sent );
	OnTrigger( "^1Trasmission interrupted!", Map.Transmission_Sent );
	OnTrigger( "^7Trasmission completed! Air Raid will destroy the Bridge in 15 seconds...", Map.Transmission_Finished );

	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"BUILD_Allied_Assault_Ramp",
		"BUILD_Allied_CP_2",
		"BUILD_Portable_Radar",
		"PLANT_Tank_Barrier",
		"PLANT_Main_Crypt_Access",
		"PLANT_Heinrichs_Tomb",
		"PLANT_Crypt_Floor",
		"PLANT_West_Crypt_Access",
		"SWITCH_Call_Air_Raid",
		"DEFEND_Tank_Barrier_5",
		"DEFEND_Tank_Barrier_6",
		"DEFEND_Tank_Barrier_7",
		"DEFEND_CP_1",
		"DEFEND_CP_2",
		"DEFEND_CP_3",
		"DEFEND_Tomb_7",
		"DEFEND_Tomb_8",
		"DEFEND_Tomb_9",
		"DEFEND_Tomb_10",
		"SWITCH_Call_Air_Raid",
		"BUILD_Portable_Radar",
	});
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"BUILD_Tank",
		"ESCORT_tank",
		"DEFEND_tank_7",
		"DEFEND_tank_8",
		"DEFEND_tank_9",
		"DEFEND_tank_10",
	});
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"DEFEND_tank_1",
		"DEFEND_tank_2",
		"DEFEND_tank_3",
		"DEFEND_tank_4",
		"DEFEND_tank_5",
		"DEFEND_tank_6",
		"ESCORT_tank",
	});
	SetAvailableMapGoals( TEAM.AXIS, false, {
		"BUILD_Axis_Watchtower_MG_Nest",
		"BUILD_Tank_Barrier",
		"BUILD_Axis_Bridge",
		"DEFEND_Tank_Barrier_1",
		"DEFEND_Tank_Barrier_2",
		"DEFEND_Tank_Barrier_3",
		"DEFEND_Tank_Barrier_4",
		"PLANT_Portable_Radar",
		"DEFEND_CP_4",
		"DEFEND_CP_5",
		"DEFEND_CP_6",
		"DEFEND_CP_7",
		"PLANT_Allied_Assault_Ramp",
		"PLANT_Assault_Ramp_2",
		"PLANT_Allied_CP_2",
		"DEFEND_Tomb_1",
		"DEFEND_Tomb_2",
		"DEFEND_Tomb_3",
		"DEFEND_Tomb_4",
		"DEFEND_Tomb_5",
		"DEFEND_Tomb_6",
		"SWITCH_Call_Air_Raid",
	});

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