//==========================================================================================
//
//	waffenschmiede_b2.gm
//
//	Who       	When		What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	27 December 2013	Initial Script
//
//==========================================================================================
//

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

	Axis_Command_Post_Dyno = 0,
	Generator_Dyno = 0,

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

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

	Axis_Command_Post_Planted = function( trigger )
	{
		Map.Axis_Command_Post_Dyno += 1;
		Util.MapDebugPrint( "Axis_Command_Post_Planted" );
	},

	Generator_Planted = function( trigger )
	{
		Map.Generator_Dyno += 1;
		Util.MapDebugPrint( "Generator_Planted" );
	},

	Axis_Command_Post_Defused = function( trigger )
	{
		Map.Axis_Command_Post_Dyno -= 1;
		Util.MapDebugPrint( "Axis_Command_Post_Defused" );
	},

	Generator_Defused = function( trigger )
	{
		Map.Generator_Dyno -= 1;
		Util.MapDebugPrint( "Generator_Defused" );
	},

	Axis_Command_Post_Destroyed = function( trigger )
	{
		Map.Axis_Command_Post_Dyno = 0;

		Util.MapDebugPrint( "Axis_Command_Post_Destroyed" );
	},

	Generator_Destroyed = function( trigger )
	{
		Map.Generator_Dyno = 0;

		Util.MapDebugPrint( "Generator_Destroyed" );
	},

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

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

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

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

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

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Generator_Built );
	OnTrigger( "Planted at the Axis Command Post.", Map.Axis_Command_Post_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Generator_Planted );
	OnTrigger( "Defused at the Axis Command Post.", Map.Axis_Command_Post_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Generator_Defused );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Generator_Destroyed );
	OnTrigger( "MISSING_STRING", Map.radarparts_Taken );
	OnTrigger( "MISSING_STRING", Map.radarparts_Returned );
	OnTrigger( "MISSING_STRING", Map.radarparts_Secured );
	OnTrigger( "MISSING_STRING", Map.flag1_flag_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.flag1_flag_Allies_Captured );

	//~Util.DisableGoal( ".*", true ); // all but routes
	//~SetAvailableMapGoals( TEAM.AXIS, true, "ATTACK_.*" );
	//~SetAvailableMapGoals( TEAM.ALLIES, true, "ATTACK_.*" );

	// Max users per goal
	//Util.SetMaxUsers( 1, "DEFEND_.*" );
	//Util.SetMaxUsers( 1, "GRENADE_.*" );
	//Util.SetMaxUsers( 1, "MOUNTMG42_.*" );

	// Camp times
	SetMapGoalProperties( "MOUNTMG42_.*", {MinCampTime=15, MaxCampTime=90} );
	SetMapGoalProperties( "MOBILEMG42_.*", {MinCampTime=10, MaxCampTime=60} );


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

global OnBotJoin = function( bot )
{
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		BUILD_Axis_Command_Post =
		{
		},
		BUILD_Generator =
		{
		},
		PLANT_Generator =
		{
		},
		PLANT_Axis_Command_Post =
		{
		},
		FLAG_radarparts =
		{
		},
		CHECKPOINT_flag1_flag =
		{
		},
	};
	Util.Routes(MapRoutes);
};
