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

-- Customer style overrides
SetDefaultStyle(ClubStyle);

MakeState{
	type="StateCoreLevel",
	levelId = 2,
	
	-- Customer Factory
	customerFactory = {
		
		locations = {
			{ x = -50, y = 168 },
		},		

		customers = {
			{
				name = {"ClubConventionGeekBasic"},
				nextWave = 6,
			},
			{
				name = {"ClubJapaneseExecutiveBasic"},
				nextWave = 8,
			},
			{
				name = {"ClubFemale1Basic"},
				nextWave = 6,
			},
			{
				name = {"ClubOldTimerFemaleBasic","ClubOldTimerFemaleBasic"},
				nextWave = 15,
			},
			{
				name = {"ClubOldTimerMaleBasic","ClubConventionGeekBasic"},
				nextWave = 16,
			},
			{
				name = {"ClubNewlywedMale", "ClubNewlywedFemale"},
				nextWave = 15,
			},
			{
				name = {"ClubNewlywedMale", "ClubNewlywedFemale"},
				nextWave = 16,
			},
			
			-- Spawnable customers
			--[[
				-- Basic customers
				-- Add 'Basic' to the name before both extra stations are available
				-- e.g. 'ClubJapaneseExecutiveBasic'
				-----------------------------------
				ClubJapaneseExecutive				-- Margarita, Conga
				ClubFemale1							-- Cuba Libre, Conga
				ClubOldTimerFemale					-- Daiquiri, Square Dance
				ClubOldTimerMale					-- Wildcard, Square Dance or Conga
				
				-- Advanced customers
				-----------------------------------
				ClubConventionGeek						-- Daiquiri or Margarita, Cuba Libre or Cooking
				
				ClubNewlywedMale						-- Cuba Libre or Cooking, Tango
				ClubNewlywedFemale						-- Daiquiri or Margarita, Tango
				
				ClubLocalLovebird						-- Cooking, Wildcard, Tango
				ClubTexasTycoon							-- Combination, Cooking, Square Dance
				
				ClubAmericasFormerTopModel				-- Margarita, Cooking or Combination, Tango
				ClubFemale2								-- Daiquiri, Cooking or Combination, Conga or Square Dance
			]]
		},
	},

	-- Goals
	targetMoney = 344,
	parTime = 162000,
	targetStars = 45,
	goals = {
		
		-- Level quota. Must match targetMoney above
		--------------------------------------------------------		
		{
			type = kClosingTimeWin,
			description = GetString("Goal_ClosingTime", "344"),
			quantity = 1,
			icon = goalIconsTable[kClosingTimeWin],
		},
		
		-- Par Time. Must match parTime above
		--------------------------------------------------------
		{
			type = kEndLevelInLessThan,
			description = GetString("Goal_CompleteBefore", "2:42"),
			quantity = 1,
			condition = 162000,
			optional = true,
			group = kGoalLessThan,
			icon = goalIconsTable[kEndLevelInLessThan],
		},
		
		-- Quality Stars. Must match targetStars above
		--------------------------------------------------------
		{
			type = kHaveStars,
			description = GetString("Goal_Stars", "45"),
			quantity = 1,
			condition = 45,
			optional = true,
			icon = goalIconsTable[kHaveStars],
		},
		
		-- Losing condition. Must match targetMoney above
		--------------------------------------------------------
		{
			type = kClosingTimeLose,
			description = GetString("Goal_ClosingTime", "344"),
			quantity = 1,
			loosingCondition = true,
			icon = goalIconsTable[kClosingTimeLose],
		},
		
	},
	
	tutorialManager = {
		firstStep = 0,
		lastStep = 14,
		boxImage = "level/core/common/textures/tutorial_back",
		boxBorder = 40,
		arrowAnim = TutorialArrowAnim,
		arrowImage = "level/core/common/textures/arrow",

		steps = {
			[0] = {
				message = "Tut_Club_2_1",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 4000,
				triggers = {
					[kWaitTimeFinished] = 1,
					[kSkippedStep] = 1,
				},
			},
			[1] = {
				message = "Tut_Club_2_2",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 4000,
				triggers = {
					[kWaitTimeFinished] = 2,
					[kSkippedStep] = 2,
				},
			},
			[2] = {
				message = "Tut_Club_2_3",
				messagePosition = {x = 500, y = 300},
				enableStations = {"daiquiri"},
				arrowPos = {
					{x = 592, y = 16},
				},
				enableEmployees = false,
				triggers = {
					[kDispenserClicked] = 3,
				},
			},
			[3] = {
				message = "Tut_Club_2_4",
				messagePosition = {x = 500, y = 300},
				enableStations = {"margarita"},
				arrowPos = {
					{x = 504, y = 16},
				},
				triggers = {
					[kDispenserClicked] = 4,
				},
			},
			[4] = {
				message = "Tut_Club_2_5",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 4000,
				triggers = {
					[kEmployeeArriveRestPoint] = 5,
				},
			},
			[5] = {
				message = "Tut_Club_2_6",
				messagePosition = {x = 500, y = 300},
				enableStations = {"combination"},
				arrowPos = {
					{x = 680, y = 16},
				},
				enableEmployees = false,
				triggers = {
					[kDispenserClicked] = 6,
				},
			},
			[6] = {
				message = "Tut_Club_2_7",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 7,
					[kSkippedStep] = 7,
				},
			},
			
			[7] = {
				message = "Tut_Club_2_8",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 8,
					[kSkippedStep] = 8,
				},
			},
			[8] = {
				message = "Tut_Club_2_9",
				messagePosition = {x = 500, y = 300},
				enableStations = {"daiquiri", "margarita", "cubaLibre"},
				enableEmployees = false,
				arrowPos = {
					{x = 680, y = 16},
					{x = 592, y = 16},
					{x = 504, y = 16},
					{x = 416, y = 16},
				},
				triggers = {
					[kDispenserClicked] = 9,
				},
			},
			[9] = {
				message = "Tut_Club_2_9",
				messagePosition = {x = 500, y = 300},
				enableStations = {"daiquiri", "margarita", "cubaLibre"},
				enableEmployees = false,
				arrowPos = {
					{x = 680, y = 16},
					{x = 592, y = 16},
					{x = 504, y = 16},
					{x = 416, y = 16},
				},
				triggers = {
					[kDispenserClicked] = 10,
				},
			},
			[10] = {
				message = "Tut_Club_2_9",
				messagePosition = {x = 500, y = 300},
				enableStations = {"daiquiri", "margarita", "cubaLibre"},
				enableEmployees = false,
				arrowPos = {
					{x = 680, y = 16},
					{x = 592, y = 16},
					{x = 504, y = 16},
					{x = 416, y = 16},
				},
				triggers = {
					[kDispenserClicked] = 11,
				},
			},
			[11] = {
				message = "Tut_Club_2_9",
				messagePosition = {x = 500, y = 300},
				enableStations = {"daiquiri", "margarita", "cubaLibre"},
				enableEmployees = false,
				arrowPos = {
					{x = 680, y = 16},
					{x = 592, y = 16},
					{x = 504, y = 16},
					{x = 416, y = 16},
				},
				triggers = {
					[kDispenserClicked] = 12,
				},
			},
			[12] = {
				message = "Tut_Club_2_10",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = true,
				triggers = {
					[kCancelQueue] = 13,
				},
			},
			
			[13] = {
				message = "Tut_Club_2_11",
				messagePosition = {x = 500, y = 300},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 14,
					[kSkippedStep] = 14,
				},
			},
			
			[14] = {
				stopDance = true,
				enableStations = {"daiquiri", "cubaLibre", "margarita", "chair1", "chair2", "chair3", "garbage", "combination", "drums"},
				enableEmployees = true,
				activeMoney = 900000,
				resumeGame = true,
				endTutorial = true,
			},
			
		},
	},
		
	-------------------------------------------------------------------------
	-- Graphic content
	
	CreateBackground();

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

		CreateStations(1);
		
		CreateDecos();
		CreateTimedDecos(1);
	},

	CreateBaseLevelControls(),
};

SetDefaultStyle(nil);