//==========================================================================================
//
//	venice_tcrc2_v1.gm
//
//	Who                	When		What
//------------------------------------------------------------------------------------------
//	^1-=-[DSK]-=-^5Classic	31 October 2015	Initial Script
//
//==========================================================================================
//

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	tank_Damaged = function()
	{
		Util.SetPositionGoal("BUILD_Tank", "MOVER_tank");
		Util.MapDebugPrint( "tank_Damaged" );
	},
};

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.Foot_Bridge_Built );
	OnTrigger( "MISSING_STRING", Map.Library_MG_Built );
	OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Built );
	OnTrigger( "MISSING_STRING", Map.Plant_Tank_Built );
	OnTrigger( "MISSING_STRING", Map.Side_Entrance_Built );
	OnTrigger( "MISSING_STRING", Map.Speedboat_Built );
	OnTrigger( "MISSING_STRING", Map.Allied_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Axis_Command_Post_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Foot_Bridge_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Library_MG_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Library_Side_Wall_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Plant_Tank_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Side_Entrance_Destroyed );
	OnTrigger( "MISSING_STRING", Map.Tank_Crate_Destroyed );
	OnTrigger( "MISSING_STRING", Map.relic_Taken );
	OnTrigger( "MISSING_STRING", Map.relic_Returned );
	OnTrigger( "MISSING_STRING", Map.relic_Secured );
	OnTrigger( "The Tank has been damaged", Map.tank_Damaged );

	Util.SetGoalPosition( -1401.381, 956.593, -135.690, "PLANT_Tank_Crate" );

	GetGoal("BUILD_Tank").TraceEntity = GetGameIdFromEntity(GetEntityByName("tank_build"));

	SetGoalPriority("PLANT_Tank_Crate", 0.9);
	//~Util.DisableGoal( ".*", true ); // all but routes

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