//==========================================================================================
//
//	island2.gm
//
//	Who                    	When		What
//------------------------------------------------------------------------------------------
//	^1{WeB}^7*^4GA^1NG$^4TA^7*	25 July 2017	Initial Script
//
//==========================================================================================
//

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

	Cannon_Supply_Doors_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Cannon_Supply_Doors_1",
			"DEFEND_Cannon_Supply_Doors_2",
		});

		Util.MapDebugPrint( "Cannon_Supply_Doors_Destroyed" );
	},

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

	main_Cannon_Destroyed = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Main_Cannon_1",
			"DEFEND_Main_Cannon_2",
		});

		Util.MapDebugPrint( "main_Cannon_Destroyed" );
	},

	War_Documents_Taken = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_Radioraum_1",
			"DEFEND_Radioraum_2",
			"DEFEND_Radioraum_3",
			"DEFEND_Radioraum_4",
			"DEFEND_Radioraum_5",
			"DEFEND_Radioraum_6",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"DEFEND_Radioraum_4",
			"DEFEND_Radioraum_5",
			"DEFEND_Radioraum_6",
		});
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_War_Documents_1",
			"DEFEND_War_Documents_2",
		});
		SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_Radio_Bunker_Transmitter" );

		Util.MapDebugPrint( "War_Documents_Taken" );
	},

	War_Documents_Returned = function()
	{
		SetAvailableMapGoals( TEAM.AXIS, false, {
			"DEFEND_Radioraum_1",
			"DEFEND_Radioraum_2",
			"DEFEND_Radioraum_3",
			"DEFEND_Radioraum_4",
			"DEFEND_Radioraum_5",
			"DEFEND_Radioraum_6",
		});
		SetAvailableMapGoals( TEAM.ALLIES, false, {
			"DEFEND_Radioraum_4",
			"DEFEND_Radioraum_5",
			"DEFEND_Radioraum_6",
		});
		SetAvailableMapGoals( TEAM.AXIS, true, {
			"DEFEND_War_Documents_1",
			"DEFEND_War_Documents_2",
		});

		Util.MapDebugPrint( "War_Documents_Returned" );
	},

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

};

global OnMapLoad = function()
{
	OnTrigger( "The Radio Bunker Door has been constructed!", Map.Radio_Bunker_Door_Built );
	OnTrigger( "Allies have breached the Cannon Supply Doors!", Map.Cannon_Supply_Doors_Destroyed );
	OnTrigger( "The Radio Bunker Door has been destroyed!", Map.Radio_Bunker_Door_Destroyed );
	OnTrigger( "Allies have destroyed the Cannon!", Map.main_Cannon_Destroyed );
	OnTrigger( "Allies have stolen the War Documents!", Map.War_Documents_Taken );
	OnTrigger( "Axis have returned the War Documents!", Map.War_Documents_Returned );
	OnTrigger( "Allied team has transmitted the war documents!", Map.War_Documents_Secured );

	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"MOUNTMG42_.*",
		"REPAIRMG42_.*",
	});
	SetAvailableMapGoals( TEAM.AXIS, false, {
		"MOUNTMG42_.*",
		"REPAIRMG42_.*",
		"DEFEND_Radioraum_.*",
	});
	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"DEFEND_Radioraum_4",
		"DEFEND_Radioraum_5",
		"DEFEND_Radioraum_6",
		"CAPPOINT_Radio_Bunker_Transmitter",
	});

	SetGoalPriority("PLANT_Radio_Bunker_Door", 0.75);
	SetGoalPriority("PLANT_main_Cannon", 0.85);
	SetGoalPriority("PLANT_Cannon_Supply_Doors", 0.91);
	SetGoalPriority("FLAG_War_Documents", 0.65);
	SetGoalPriority("CAPPOINT_Radio_Bunker_Transmitter", 0.91);

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

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