//==========================================================================================
//
//	fa_temple.gm
//
//	Who	When		What
//------------------------------------------------------------------------------------------
//	dd	22 August 2019	Initial Script
//
//==========================================================================================
//

global Map =
{
	Debug = 1, // please set to zero before distributing your script
	ShowMovers = false,

	Canyon_Rope_Bridge_Dyno = 0,
	Command_Post_Dyno = 0,
	Escape_caves_scaffolding_Dyno = 0,
	Tank_Barrier_Dyno = 0,
	Tank_Barrier_1_Dyno = 0,
	Tank_Bridge_Dyno = 0,
	Temple_MG_Nest_Dyno = 0,
	floor_breach_to_the_escape_caves_Dyno = 0,
	temple_caves_access_breach_Dyno = 0,
	temple_corridor_wall_crack_Dyno = 0,
	temple_wooden_barrier_Dyno = 0,

	Canyon_Rope_Bridge_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Canyon_Rope_Bridge_Built" );
	},

	Command_Post_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Command_Post_Built" );
	},

	Escape_caves_scaffolding_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Escape_caves_scaffolding_Built" );
	},

	Tank_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Built" );
	},

	Tank_Barrier_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Barrier_Built" );
	},

	Tank_Barrier_1_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Barrier_1_Built" );
	},

	Tank_Bridge_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Bridge_Built" );
	},

	Temple_MG_Nest_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Temple_MG_Nest_Built" );
	},

	temple_wooden_barrier_Built = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "temple_wooden_barrier_Built" );
	},

	Canyon_Rope_Bridge_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Canyon_Rope_Bridge_Dyno += 1;
		Util.MapDebugPrint( "Canyon_Rope_Bridge_Planted" );
	},

	Command_Post_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Command_Post_Dyno += 1;
		Util.MapDebugPrint( "Command_Post_Planted" );
	},

	Escape_caves_scaffolding_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Escape_caves_scaffolding_Dyno += 1;
		Util.MapDebugPrint( "Escape_caves_scaffolding_Planted" );
	},

	Tank_Barrier_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Barrier_Dyno += 1;
		Util.MapDebugPrint( "Tank_Barrier_Planted" );
	},

	Tank_Barrier_1_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Barrier_1_Dyno += 1;
		Util.MapDebugPrint( "Tank_Barrier_1_Planted" );
	},

	Tank_Bridge_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Bridge_Dyno += 1;
		Util.MapDebugPrint( "Tank_Bridge_Planted" );
	},

	Temple_MG_Nest_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Temple_MG_Nest_Dyno += 1;
		Util.MapDebugPrint( "Temple_MG_Nest_Planted" );
	},

	floor_breach_to_the_escape_caves_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.floor_breach_to_the_escape_caves_Dyno += 1;
		Util.MapDebugPrint( "floor_breach_to_the_escape_caves_Planted" );
	},

	temple_caves_access_breach_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_caves_access_breach_Dyno += 1;
		Util.MapDebugPrint( "temple_caves_access_breach_Planted" );
	},

	temple_corridor_wall_crack_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_corridor_wall_crack_Dyno += 1;
		Util.MapDebugPrint( "temple_corridor_wall_crack_Planted" );
	},

	temple_wooden_barrier_Planted = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_wooden_barrier_Dyno += 1;
		Util.MapDebugPrint( "temple_wooden_barrier_Planted" );
	},

	Canyon_Rope_Bridge_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Canyon_Rope_Bridge_Dyno -= 1;
		Util.MapDebugPrint( "Canyon_Rope_Bridge_Defused" );
	},

	Command_Post_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Command_Post_Dyno -= 1;
		Util.MapDebugPrint( "Command_Post_Defused" );
	},

	Escape_caves_scaffolding_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Escape_caves_scaffolding_Dyno -= 1;
		Util.MapDebugPrint( "Escape_caves_scaffolding_Defused" );
	},

	Tank_Barrier_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Barrier_Dyno -= 1;
		Util.MapDebugPrint( "Tank_Barrier_Defused" );
	},

	Tank_Barrier_1_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Barrier_1_Dyno -= 1;
		Util.MapDebugPrint( "Tank_Barrier_1_Defused" );
	},

	Tank_Bridge_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Bridge_Dyno -= 1;
		Util.MapDebugPrint( "Tank_Bridge_Defused" );
	},

	Temple_MG_Nest_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Temple_MG_Nest_Dyno -= 1;
		Util.MapDebugPrint( "Temple_MG_Nest_Defused" );
	},

	floor_breach_to_the_escape_caves_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.floor_breach_to_the_escape_caves_Dyno -= 1;
		Util.MapDebugPrint( "floor_breach_to_the_escape_caves_Defused" );
	},

	temple_caves_access_breach_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_caves_access_breach_Dyno -= 1;
		Util.MapDebugPrint( "temple_caves_access_breach_Defused" );
	},

	temple_corridor_wall_crack_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_corridor_wall_crack_Dyno -= 1;
		Util.MapDebugPrint( "temple_corridor_wall_crack_Defused" );
	},

	temple_wooden_barrier_Defused = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.temple_wooden_barrier_Dyno -= 1;
		Util.MapDebugPrint( "temple_wooden_barrier_Defused" );
	},

	Canyon_Rope_Bridge_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Canyon_Rope_Bridge_Destroyed" );
	},

	Command_Post_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Command_Post_Destroyed" );
	},

	Escape_caves_scaffolding_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Escape_caves_scaffolding_Destroyed" );
	},

	Tank_Barrier_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Map.Tank_Barrier_Dyno = 0;

		Util.MapDebugPrint( "Tank_Barrier_Destroyed" );
	},

	Tank_Barrier_1_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Barrier_1_Destroyed" );
	},

	Tank_Bridge_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Tank_Bridge_Destroyed" );
	},

	Temple_MG_Nest_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "Temple_MG_Nest_Destroyed" );
	},

	floor_breach_to_the_escape_caves_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "floor_breach_to_the_escape_caves_Destroyed" );
	},

	temple_caves_access_breach_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "temple_caves_access_breach_Destroyed" );
	},

	temple_corridor_wall_crack_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "temple_corridor_wall_crack_Destroyed" );
	},

	temple_wooden_barrier_Destroyed = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "temple_wooden_barrier_Destroyed" );
	},

	gold_Taken = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "gold_Taken" );
	},

	gold_Returned = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "gold_Returned" );
	},

	gold_Secured = function( trigger )
	{
		if ( TestMap )
			{ return; }

		Util.MapDebugPrint( "gold_Secured" );
	},

};

global OnMapLoad = function()
{
	if ( TestMapOn )
		{ Util.AutoTestMap(); }

	// Register callback functions
	OnTrigger( "MISSING_STRING", Map.Canyon_Rope_Bridge_Built );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Escape_caves_scaffolding_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Barrier_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Barrier_1_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Bridge_Built );
	OnTrigger( "MISSING_STRING", Map.Temple_MG_Nest_Built );
	OnTrigger( "MISSING_STRING", Map.temple_wooden_barrier_Built );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Canyon_Rope_Bridge_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Command_Post_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Escape_caves_scaffolding_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Tank_Barrier_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Tank_Barrier_1_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Tank_Bridge_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.Temple_MG_Nest_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.floor_breach_to_the_escape_caves_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.temple_caves_access_breach_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.temple_corridor_wall_crack_Planted );
	OnTrigger( "Planted at the MISSING_STRING.", Map.temple_wooden_barrier_Planted );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Canyon_Rope_Bridge_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Command_Post_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Escape_caves_scaffolding_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Tank_Barrier_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Tank_Barrier_1_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Tank_Bridge_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.Temple_MG_Nest_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.floor_breach_to_the_escape_caves_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.temple_caves_access_breach_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.temple_corridor_wall_crack_Defused );
	OnTrigger( "Defused at the MISSING_STRING.", Map.temple_wooden_barrier_Defused );
	OnTrigger( "MISSING_STRING", Map.Canyon_Rope_Bridge_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Escape_caves_scaffolding_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Tank_Barrier_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Tank_Barrier_1_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Tank_Bridge_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Temple_MG_Nest_Destroyed );
	OnTrigger( "MISSING_STRING", Map.floor_breach_to_the_escape_caves_Destroyed );
	OnTrigger( "MISSING_STRING", Map.temple_caves_access_breach_Destroyed );
	OnTrigger( "MISSING_STRING", Map.temple_corridor_wall_crack_Destroyed );
	OnTrigger( "MISSING_STRING", Map.temple_wooden_barrier_Destroyed );
	OnTrigger( "MISSING_STRING", Map.gold_Taken );
	OnTrigger( "MISSING_STRING", Map.gold_Returned );
	OnTrigger( "MISSING_STRING", Map.gold_Secured );

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

	// Max users per goal
	Util.SetMaxUsers( 1, "ATTACK_.*" );
	Util.SetMaxUsers( 1, "DEFEND_.*" );
	Util.SetMaxUsers( 1, "GRENADE_.*" );
	Util.SetMaxUsers( 1, "SNIPE_.*" );
	Util.SetMaxUsers( 1, "MOUNTMG42_.*" );
	Util.SetMaxUsers( 1, "MOBILEMG42_.*" );
	Util.SetMaxUsers( 1, "MOBILEMORTAR_.*" );
	Util.SetMaxUsers( 1, "AIRSTRIKE_.*" );
	Util.SetMaxUsers( 1, "CALLARTILLERY_.*" );

	// 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 )
{
	// Uncomment for shootable breakables
	//~bot.TargetBreakableDist = 90.0;
	// Only set MaxViewDistance on maps with limited sight (e.g. fog)
	//~bot.MaxViewDistance = 2400;
};

global InitializeRoutes = function()
{
	MapRoutes =
	{
		BUILD_Tank_Barrier =
		{
		},
		BUILD_Canyon_Rope_Bridge =
		{
		},
		BUILD_Escape_caves_scaffolding =
		{
		},
		BUILD_Command_Post =
		{
		},
		BUILD_Tank =
		{
		},
		BUILD_temple_wooden_barrier =
		{
		},
		BUILD_Tank_Barrier_1 =
		{
		},
		BUILD_Temple_MG_Nest =
		{
		},
		BUILD_Tank_Bridge =
		{
		},
		PLANT_Temple_MG_Nest =
		{
		},
		PLANT_Command_Post =
		{
		},
		PLANT_Tank_Barrier =
		{
		},
		PLANT_Tank_Barrier_1 =
		{
		},
		PLANT_Canyon_Rope_Bridge =
		{
		},
		PLANT_temple_corridor_wall_crack =
		{
		},
		PLANT_Escape_caves_scaffolding =
		{
		},
		PLANT_floor_breach_to_the_escape_caves =
		{
		},
		PLANT_Tank_Bridge =
		{
		},
		PLANT_temple_wooden_barrier =
		{
		},
		PLANT_temple_caves_access_breach =
		{
		},
		FLAG_gold =
		{
		},
	};
	Util.Routes(MapRoutes);
};
