//==========================================================================================
//
//	coldfortzombie.gm
//
//	Who         	When		What
//------------------------------------------------------------------------------------------
//	^1GN^0A$^4H^1ER	11 May 2012	Initial Script
//
//==========================================================================================
//

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

	Axis_Basement_Fence_Dyno = 0,
	Main_Gate_Dyno = 0,
	Neutral_Command_Post_Dyno = 0,
	Side_Wall_Dyno = 0,

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

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

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

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

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

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

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

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

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

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

	Axis_Basement_Fence_Destroyed = function( trigger )
	{
		Map.Axis_Basement_Fence_Dyno = 0;

		Util.MapDebugPrint( "Axis_Basement_Fence_Destroyed" );
	},

	Main_Gate_Destroyed = function( trigger )
	{
		Map.Main_Gate_Dyno = 0;

		Util.MapDebugPrint( "Main_Gate_Destroyed" );
	},

	Neutral_Command_Post_Destroyed = function( trigger )
	{
		Map.Neutral_Command_Post_Dyno = 0;

		Util.MapDebugPrint( "Neutral_Command_Post_Destroyed" );
	},

	Side_Wall_Destroyed = function( trigger )
	{
		Map.Side_Wall_Dyno = 0;

		Util.MapDebugPrint( "Side_Wall_Destroyed" );
	},

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

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

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

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

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

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "Allied Fence Constructed", Map.Axis_Basement_Fence_Built );
	OnTrigger( "Axis Command Post constructed", Map.Neutral_Command_Post_Built );
	OnTrigger( "Planted at the Axis Basement Fence.", Map.Axis_Basement_Fence_Planted );
	OnTrigger( "Planted at the Main Gate.", Map.Main_Gate_Planted );
	OnTrigger( "Planted at the Netural Command Post.", Map.Neutral_Command_Post_Planted );
	OnTrigger( "Planted at the Side Wall.", Map.Side_Wall_Planted );
	OnTrigger( "Defused at the Allied Fence.", Map.Axis_Basement_Fence_Defused );
	OnTrigger( "Defused at the Main Gate.", Map. Main_Gate_Defused );
	OnTrigger( "Defused at the Netural Command Post.", Map.Neutral_Command_Post_Defused );
	OnTrigger( "Defused at the Side Wall.", Map.Side_Wall_Defused );
	OnTrigger( "Teh Allied Fence has been destroyed", Map.Axis_Basement_Fence_Destroyed );
	OnTrigger( "The Axis have destroyed the Main Gate", Map.Main_Gate_Destroyed );
	OnTrigger( "Axis team has destroyed the Allied Command Post", Map.Neutral_Command_Post_Destroyed );
	OnTrigger( "Axis have destroyed the Side Wall", Map.Side_Wall_Destroyed );
	OnTrigger( "The Axis have stolen the Allied gold", Map.allied_gold_Taken );
	OnTrigger( "The Allies have retrieved the gold", Map.allied_gold_Returned );
	OnTrigger( "Allies have returned the Gold", Map.allied_gold_Secured );
	OnTrigger( "Axis have captured the Forward Flag", Map.forward_flag_Axis_Captured );
	OnTrigger( "Allies have reclaimed the Forward Flag", Map.forward_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 )
{
};
