//==========================================================================================
//
//	eisfaust.gm
//
//	Who                    	When		What
//------------------------------------------------------------------------------------------
//	^1{WeB}^7*^4GA^1NG$^4TA^7*	24 September 2016	Initial Script
//
//==========================================================================================
//

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

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

	Provisorische_Bruecke_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Ufer_MG" );

		Util.MapDebugPrint( "Provisorische_Bruecke_Built" );
	},

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

	Westturm_Built = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, "BUILD_Provisorische_Bruecke" );

		Util.MapDebugPrint( "Westturm_Built" );
	},

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

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

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

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

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

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

	Festungsmauer_Destroyed = function( trigger )
	{
	       SetAvailableMapGoals( TEAM.ALLIES, true, {
	       	"PLANT_V2_Rakete",
	       	"DEFEND_Rocket_1",
	       	"DEFEND_Rocket_2",
	       	"DEFEND_Rocket_3",
	       });
		 SetAvailableMapGoals( TEAM.ALLIES, false, {
		 	"CAMP_Hillside_1",
		 	"BUILD_Provisorische_Bruecke",
		 	"BUILD_Ufer_MG",
		 });
		 SetAvailableMapGoals( TEAM.AXIS, true, {
		 	"DEFEND_Rocket_1",
		 	"DEFEND_Rocket_2",
		 	"DEFEND_Rocket_3",
		 });
		 SetAvailableMapGoals( TEAM.AXIS, false, {
		 	"DEFEND_wall_1",
		 	"FLAG_V2_Dokumente",
		 	"BUILD_Neutral_Command_Post",
		 	"PLANT_Neutral_Command_Post",
		 	"CHECKPOINT_forwardspawn1_flag",
		 });

		Util.MapDebugPrint( "Festungsmauer_Destroyed" );
	},

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

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

	V2_Dokumente_Secured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_Funkraum" );

		Util.MapDebugPrint( "V2_Dokumente_Secured" );
	},

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

	forwardspawn1_flag_Allies_Captured = function( trigger )
	{
		SetAvailableMapGoals( TEAM.ALLIES, true, {
			"BUILD_Neutral_Command_Post",
			"PLANT_Festungsmauer",
		});

		Util.MapDebugPrint( "forwardspawn1_flag_Allies_Captured" );
	},

};

global OnMapLoad = function()
{
	OnTrigger( "Die Aliierten haben die provisorische Bruecke repariert!.", Map.Provisorische_Bruecke_Built );
	OnTrigger( "Die Allies haben das Ufer-MG errichtet!", Map.Ufer_MG_Built );
	OnTrigger( "Die Aliierten haben den Westturm gebaut!.", Map.Westturm_Built );
	OnTrigger( "Die Aliierten haben die Bergmauer gesprengt!", Map.Bergmauer_Destroyed );
	OnTrigger( "Die Aliierten haben die Festungsmauer gesprengt!", Map.Festungsmauer_Destroyed );
	OnTrigger( "Die provisorische Bruecke wurde von den Deutschen gesprengt.", Map.Provisorische_Bruecke_Destroyed );
	//OnTrigger( "MISSING_STRING", Map.V2_Rakete_Destroyed );
	OnTrigger( "Der Westturm wurde von den Deutschen gesprengt.", Map.Westturm_Destroyed );
	OnTrigger( "Axis have stolen V2 Dokumente!", Map.V2_Dokumente_Taken );
	OnTrigger( "Die Allies haben die V2 rechtzeitig gesprengt!", Map.V2_Dokumente_Returned );
	OnTrigger( "Dokumente wurden uebermittelt. Noch 5 Minuten bis zum Start der V2!", Map.V2_Dokumente_Secured );
	OnTrigger( "Die Axis haben die Ruine eingenommen!", Map.forwardspawn1_flag_Axis_Captured );
	OnTrigger( "Die Allies haben die Ruine eingenommen!", Map.forwardspawn1_flag_Allies_Captured );

	SetAvailableMapGoals( TEAM.ALLIES, false, {
		"BUILD_Neutral_Command_Post",
		"BUILD_Provisorische_Bruecke",
		"BUILD_Ufer_MG",
		"BUILD_Westturm",
		"PLANT_Festungsmauer",
		"PLANT_V2_Rakete",
		"MOUNTMG42_360",
		"REPAIRMG42_360",
		"DEFEND_Rocket_1",
		"DEFEND_Rocket_2",
		"DEFEND_Rocket_3",
	});
	SetAvailableMapGoals( TEAM.AXIS, false, {
		"MOUNTMG42_360",
		"REPAIRMG42_360",
		"DEFEND_Rocket_1",
		"DEFEND_Rocket_2",
		"DEFEND_Rocket_3",
	});

	SetGoalPriority("PLANT_Bergmauer", 0.91);
	SetGoalPriority("BUILD_Provisorische_Bruecke", 0.91);
	SetGoalPriority("BUILD_Ufer_MG", 0.91);
	SetGoalPriority("PLANT_Festungsmauer", 0.91);
	SetGoalPriority("CAMP_Hillside_1", 0.91);

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

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