//==========================================================================================
//
//	beetown_a1.gm
//
//	Who        	When		What
//------------------------------------------------------------------------------------------
//	Maker	05 October 2017	incomplete waypoints without script
//	palota	20 January 2025	Initial Script
//
//==========================================================================================
//

global Map =
{
	beer_Secured = function( trigger )
	{
		if (trigger.Action=="opening")
		{
			n=trigger.Name[5]-49;
			SetAvailableMapGoals( TEAM.AXIS, false, "CAPPOINT_x" + n );
			if (n<4) { SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_x" + (n+1) ); }
			Util.MapDebugPrint( "beer" + n + "_Secured" );
		}
	},
	honey_Secured = function( trigger )
	{
		if (trigger.Action=="opening")
		{
			n=trigger.Name[6]-49;
			SetAvailableMapGoals( TEAM.ALLIES, false, "CAPPOINT_l" + n );
			if (n<4) { SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_l" + (n+1) ); }
			Util.MapDebugPrint( "honey" + n + "_Secured" );
		}
	},

};

global OnMapLoad = function()
{
	OnTrigger( "beer_2_del_Moving", Map.beer_Secured );
	OnTrigger( "beer_3_del_Moving", Map.beer_Secured );
	OnTrigger( "beer_4_del_Moving", Map.beer_Secured );
	OnTrigger( "honey_2_del_Moving", Map.honey_Secured );
	OnTrigger( "honey_3_del_Moving", Map.honey_Secured );
	OnTrigger( "honey_4_del_Moving", Map.honey_Secured );

	Util.DisableGoal("CAPPOINT_.*");
	SetAvailableMapGoals( TEAM.AXIS, true, "CAPPOINT_x1" );
	SetAvailableMapGoals( TEAM.ALLIES, true, "CAPPOINT_l1" );

	Util.AddUsePoint( "PLANT_Axis_Main_Gate", Vec3(23,1110,56) );
	Util.AddUsePoint( "PLANT_Allies_Main_Gate", Vec3(-17,-1128,56) );


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