//==========================================================================================
//
//	boromir_a2.gm
//
//	Who       	When		What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	10 March 2013	Initial Script
//
//==========================================================================================
//

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

	Anti_Aircraft_Gun_Dyno = 0,
	Villa_Gate_Dyno = 0,

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

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

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

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

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

	Anti_Aircraft_Gun_Destroyed = function( trigger )
	{
		Map.Anti_Aircraft_Gun_Dyno = 0;

		Util.MapDebugPrint( "Anti_Aircraft_Gun_Destroyed" );
	},

	Villa_Gate_Destroyed = function( trigger )
	{
		Map.Villa_Gate_Dyno = 0;

		Util.MapDebugPrint( "Villa_Gate_Destroyed" );
	},

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "MISSING_STRING", Map.Villa_Gate_Built );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Anti_Aircraft_Gun_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Villa_Gate_Planted );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Anti_Aircraft_Gun_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Villa_Gate_Defused );
	OnTrigger( "MISSING_STRING", Map.Anti_Aircraft_Gun_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Villa_Gate_Destroyed );

	//~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_Villa_Gate =
		{
		},
		PLANT_Villa_Gate =
		{
		},
		PLANT_Anti_Aircraft_Gun =
		{
		},
	};
	Util.Routes(MapRoutes);
};
