//==========================================================================================
//
//	uje_horror_island.gm
//
//	Who       	When		What
//------------------------------------------------------------------------------------------
//	^1[UJE]^3Niek	12 October 2018	Initial Script
//
//==========================================================================================
//

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

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

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

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

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

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

};

global OnMapLoad = function()
{
	OnTrigger( "MISSING_STRING", Map.First_Pillar_Built );
	OnTrigger( "^4The Allies have blocked the cave entrances!", Map.Rocks_Built );
	OnTrigger( "^1The first pillar has been destroyed!", Map.First_Pillar_Destroyed );
	OnTrigger( "^1The Axis have opened the cave entrances!", Map.Rocks_Destroyed );
	OnTrigger( "MISSING_STRING", Map.spawnflag_Axis_Captured );
	OnTrigger( "MISSING_STRING", Map.spawnflag_Allies_Captured );

	// all but routes
	Util.DisableGoal( ".*", true );

	//Axis goals activation
	SetAvailableMapGoals( TEAM.AXIS, true, {
		"CHECKPOINT_spawnflag",
		"PLANT_Rocks",
		"ATTACK_First.*",
		".*CAB.*"
	});

	//Allies goals activation
	SetAvailableMapGoals( TEAM.ALLIES, true, {
		"CHECKPOINT_spawnflag",
		"BUILD_Rocks",
		"DEFEND_First.*",
		".*CAB.*",
	});

	// Max users per goal
	Util.SetMaxUsers( 1, "PLANT.*" );
	Util.SetMaxUsers( 2, "CHECKPOINT_spawnflag" );

	// Camp times
	SetMapGoalProperties( "ATTACK.*", {MinCampTime=20, MaxCampTime=40} );
	SetMapGoalProperties( "DEFEND.*", {MinCampTime=20, MaxCampTime=30} );

	//Offset Plant/Build Fix
	Util.SetGoalOffset( 80, 0, 0, "PLANT_Rocks" );
	Util.SetGoalOffset( -80, 0, 0, "PLANT_First_Pillar" );

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


