 _LOADED["level/core/pool/common_elements.lua"] = nil;
require("level/core/pool/common_elements.lua");

-- Style overrides
--------------------------------------

PoolSideStyle.navgraph = "level/core/pool/nav_2.xml",

SetDefaultStyle(PoolSideStyle);

MakeState{
	type="StateCoreLevel",
	levelId = 1,
	
	--beginComic = "level/story/pool/1",

	-- Customer Factory
	customerFactory = {

		locations = {
			{ x = -250, y = 400 },
		},

		customers = {	
			{
				name = {"PoolOldTimerFemaleTutorialServe"},
				nextWave = 8,
			},
			{
				name = {"PoolSpringBreakGirlTutorialServe"},
				nextWave = 8,
			},
			{
				name = {"PoolFemale1TutorialServe"},
				nextWave = 8,
			},
			{
				name = {"PoolLocalLovebirdTutorialServe"},
				nextWave = 8,
			},
			
			-- Spawnable customers
			--[[
				-- Basic customers
				-----------------------------------
				PoolOldTimerFemale						-- Orange Juice, Boat
				PoolSpringBreakGirl						-- Suntan, Volley
				PoolLocalLovebird						-- Ice Cream, Swim
				PoolFemale1								-- Wildcard, Wildcard
				
				-- Advanced customers
				-----------------------------------
				PoolConventionGeek						-- Wildcard, Suntan
				
				PoolNewlywedMale						-- Ice Cream or Cooking, Volley/Boat
				PoolNewlywedFemale						-- OJ or Suntan, Volley/Boat
				
				PoolJapaneseExecutive					-- Combination, Cooking, Boat
				PoolTexasTycoon							-- Cooking, Combination, Swim
				
				PoolAmericasFormerTopModel				-- Suntan, Cooking or Combination, Swim
				PoolShark								-- Suntan, Cooking or Combination, Volley
			]]
		},
	},
	
	
	-- Goals
	targetMoney = 75,
	parTime = 180000,
	targetStars = 15,
	goals = {
		
		-- Level quota. Must match targetMoney above
		--------------------------------------------------------		
		{
			type = kClosingTimeWin,
			description = GetString("Goal_ClosingTime", "75"),
			quantity = 1,
			icon = goalIconsTable[kClosingTimeWin],
		},
		
		-- Par Time. Must match parTime above
		--------------------------------------------------------
		{
			type = kEndLevelInLessThan,
			description = GetString("Goal_CompleteBefore", "3:00"),
			quantity = 1,
			condition = 180000,
			optional = true,
			group = kGoalLessThan,
			icon = goalIconsTable[kEndLevelInLessThan],
		},
		
		-- Quality Stars. Must match targetStars above
		--------------------------------------------------------
		{
			type = kHaveStars,
			description = GetString("Goal_Stars", "15"),
			quantity = 1,
			condition = 15,
			optional = true,
			icon = goalIconsTable[kHaveStars],
		},
		
		-- Losing condition. Must match targetMoney above
		--------------------------------------------------------
		{
			type = kClosingTimeLose,
			description = GetString("Goal_ClosingTime", "75"),
			quantity = 1,
			loosingCondition = true,
			icon = goalIconsTable[kClosingTimeLose],
		},
		
	},
	
	tutorialManager = {
		firstStep = 0,
		lastStep = 24,
		boxImage = "level/core/common/textures/tutorial_back",
		boxBorder = 40,
		arrowAnim = TutorialArrowAnim,
		arrowImage = "level/core/common/textures/arrow",
		
		steps = {
			[0] = {
				message = "Tut_Pool_1_1",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 3000,
				triggers = {
					[kWaitTimeFinished] = 1,
					[kSkippedStep] = 1,
				},
			},
			[1] = {
				message = "",
				--message = "Tut_Pool_1_2",
				--messagePosition = {x = 600, y = 300},
				customerList = {"PoolLocalLovebirdTutorialServe"},
				triggers = {
					[kCustomerArrived] = 2,
				},
			},
			[2] = {
				message = "Tut_Pool_1_3",
				arrowPos = {
					{x = 284, y = 64},
				},
				messagePosition = {x = 600, y = 300},
				triggers = {
					[kRentDragCustomer] = 3,
				},
			},
			[3] = {
				message = "Tut_Pool_1_4",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 248, y = 256},
					{x = 344, y = 256},
					{x = 440, y = 256},
				},
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kRentDropCustomerRight] = 4,
					[kRentDropCustomerWrong] = 2,
				},
			},
			[4] = {
				message = "Tut_Pool_1_5",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 2000,
				triggers = {
					[kWaitTimeFinished] = 5,
					[kSkippedStep] = 5,
				},
			},			
			[5] = {
				message = "Tut_Pool_1_6",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 504, y = 32},
				},
				enableStations = {"icecream"},
				triggers = {
					[kDispenserClicked] = 6,
				},
			},			
			[6] = {
				message = "Tut_Pool_1_7",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				triggers = {
					[kPickUpItem] = 7,
				},
			},			
			[7] = {
				message = "Tut_Pool_1_8",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 248, y = 256},
					{x = 344, y = 256},
					{x = 440, y = 256},
				},
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kServiceClicked] = 8,
				},
			},
			[8] = {
				message = "Tut_Pool_1_9",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 3000,
				triggers = {
					[kWaitTimeFinished] = 9,
					[kSkippedStep] = 9,
				},
			},
			[9] = {
				message = "Tut_Pool_1_10",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 416, y = 32},
					{x = 504, y = 32},
					{x = 592, y = 32},
				},
				stopDance = true,
				enableStations = {"orangejuice", "suntan", "icecream"},
				triggers = {
					[kDispenserClicked] = 10,
				},
			},
			[10] = {
				arrowPos = {
					{x = 416, y = 32},
					{x = 504, y = 32},
					{x = 592, y = 32},
				},
				triggers = {
					[kDispenserClicked] = 11,
				},
			},
			[11] = {
				message = "Tut_Pool_1_11",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				triggers = {
					[kEmployeeArriveRestPoint] = 12,
				},
			},
			[12] = {
				message = "Tut_Pool_1_12",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 344, y = 96},
				},
				stopDance = true,
				enableStations = {"garbage"},
				triggers = {
					[kDispenserClicked] = 13,
				},
			},
			[13] = {
				message = "Tut_Pool_1_13",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				triggers = {
					[kEmployeeArriveRestPoint] = 14,
				},
			},
			[14] = {
				waitTime = 1000,
				triggers = {
					[kWaitTimeFinished] = 15,
					[kSkippedStep] = 15,
				},
			},
			[15] = {
				message = "Tut_Pool_1_14",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 1000,
				triggers = {
					[kWaitTimeFinished] = 16,
					[kSkippedStep] = 16,
				},
			},
			[16] = {
				customerList = {"PoolSpringBreakGirlTutorialServe"},
				triggers = {
					[kCustomerArrived] = 17,
				},
			},
			[17] = {
				message = "Tut_Pool_1_15",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 284, y = 64},
					{x = 248, y = 256},
					{x = 344, y = 256},
					{x = 440, y = 256},
				},
				
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kRentDropCustomerRight] = 18,
				},
			},		
			[18] = {
				message = "Tut_Pool_1_16",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 416, y = 32},
				},
				enableStations = {"suntan"},
				triggers = {
					[kDispenserClicked] = 19,
				},
			},		
			[19] = {
				message = "Tut_Pool_1_17",
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 248, y = 256},
					{x = 344, y = 256},
					{x = 440, y = 256},
				},
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kServiceClicked] = 20,
				},
			},
			[20] = {
				enableStations = {"*"},
				triggers = {
					[kEmployeeArriveRestPoint] = 21,
				},
			},
			[21] = {
				message = "Tut_Pool_1_18",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				waitTime = 3000,
				triggers = {
					[kWaitTimeFinished] = 22,
					[kSkippedStep] = 22,
				},
			},
			[22] = {
				message = "Tut_Pool_1_19",
				stopDance = true,
				messagePosition = {x = 600, y = 300},
				arrowPos = {
					{x = 248, y = 256},
					{x = 344, y = 256},
					{x = 440, y = 256},
				},
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kServiceClicked] = 23,
				},
			},
			[23] = {
				message = "Tut_Pool_1_20",
				messagePosition = {x = 600, y = 300},
				enableStations = {"*"},
				waitTime = 4000,
				triggers = {
					[kWaitTimeFinished] = 24,
					[kSkippedStep] = 24,
				},
			},
			[24] = {
				stopDance = true,
				enableStations = {"icecream", "suntan", "orangejuice", "chair1", "chair2", "chair3", "garbage"},
				enableEmployees = true,
				activeMoney = 900000,
				resumeGame = true,
				endTutorial = true,
			},
			
		},
	},

	-- Graphic content
	
	CreateBackground();

	BlgContainer {
		name = "gameLayer",
		enableZSorting = true,

		-- Create level 0 stations
		CreateStations(0);
		
		-- Create the level decorations
		CreateDecos();
		CreateTimedDecos(1);

	},

	CreateBaseLevelControls(),
};

SetDefaultStyle(nil);