//==========================================================================================
//
//	uje_final_battle.gm
//
//	Who       	When		What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	29 November 2020	Initial Script
//
//==========================================================================================
//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

};

global OnMapLoad = function()
{
	// Register callback functions
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Built );
	OnTrigger( "MISSING_STRING", Map.Tank_Built );
	OnTrigger( "MISSING_STRING", Map.bridge_1_Built );
	OnTrigger( "MISSING_STRING", Map.bridge_2_Built );
	OnTrigger( "MISSING_STRING", Map.bridge_3_Built );
	OnTrigger( "MISSING_STRING", Map.stone_barrier_Built );
	OnTrigger( "MISSING_STRING", Map.wooden_barrier_Built );
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.bridge_1_Destroyed );
	OnTrigger( "MISSING_STRING", Map.bridge_2_Destroyed );
	OnTrigger( "MISSING_STRING", Map.bridge_3_Destroyed );
	OnTrigger( "MISSING_STRING", Map.stone_barrier_Destroyed );
	OnTrigger( "MISSING_STRING", Map.wooden_barrier_Destroyed );
	OnTrigger( "MISSING_STRING", Map.ammo_Taken );
	OnTrigger( "MISSING_STRING", Map.ammo_Returned );
	OnTrigger( "MISSING_STRING", Map.ammo_Secured );
	OnTrigger( "MISSING_STRING", Map.spawnflagchurch_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflagchurch_Allies_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflaglake_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflaglake_Allies_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflagroad_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflagroad_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, "MOUNTMG42_.*" );

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


	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_wooden_barrier =
		{
		},
		PLANT_wooden_barrier =
		{
		},
		BUILD_stone_barrier =
		{
		},
		PLANT_stone_barrier =
		{
		},
		BUILD_bridge_1 =
		{
		},
		PLANT_bridge_1 =
		{
		},
		BUILD_bridge_2 =
		{
		},
		PLANT_bridge_2 =
		{
		},
		BUILD_bridge_3 =
		{
		},
		PLANT_bridge_3 =
		{
		},
		FLAG_ammo =
		{
		},
		CHECKPOINT_spawnflagchurch =
		{
		},
		CHECKPOINT_spawnflagroad =
		{
		},
		BUILD_Axis_Command_Post =
		{
		},
		PLANT_Axis_Command_Post =
		{
		},
		BUILD_Allied_Command_Post =
		{
		},
		PLANT_Allied_Command_Post =
		{
		},
		CHECKPOINT_spawnflaglake =
		{
		},
		BUILD_Tank =
		{
		},
	};
	Util.Routes(MapRoutes);
};
