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

-- Customer style overrides	
SetDefaultStyle(ClubStyle);

MakeState{
	type="StateCoreLevel",
	levelId = 1,
	
	--beginComic = "level/story/club/1",
	
	-- Customer Factory
	customerFactory = {
		
		locations = {
			{ x = -50, y = 168 },
		},		

		customers = {
			{
				name = {"ClubNewlywedMaleBasic", "ClubNewlywedFemale"},
				nextWave = 7,
			},
			{
				name = {"ClubJapaneseExecutiveBasic"},
				nextWave = 7,
			},
			{
				name = {"ClubFemale1Basic","ClubJapaneseExecutiveBasic"},
				nextWave = 12,
			},
			{
				name = {"ClubOldTimerFemaleBasic"},
				nextWave = 7,
			},
			{
				name = {"ClubNewlywedMaleBasic", "ClubNewlywedFemale"},
				nextWave = 12,
			},
			{
				name = {"ClubOldTimerMaleBasic"},
				nextWave = 7,
			},
			{
				name = {"ClubOldTimerMaleBasic","ClubJapaneseExecutiveBasic"},
				nextWave = 10,
			},
			
			
			-- 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 = 296,
	parTime = 200000,
	targetStars = 51,
	goals = {
		
		-- Level quota. Must match targetMoney above
		--------------------------------------------------------		
		{
			type = kClosingTimeWin,
			description = GetString("Goal_ClosingTime", "296"),
			quantity = 1,
			icon = goalIconsTable[kClosingTimeWin],
		},
		
		-- Par Time. Must match parTime above
		--------------------------------------------------------
		{
			type = kEndLevelInLessThan,
			description = GetString("Goal_CompleteBefore", "3:20"),
			quantity = 1,
			condition = 200000,
			optional = true,
			group = kGoalLessThan,
			icon = goalIconsTable[kEndLevelInLessThan],
		},
		
		-- Quality Stars. Must match targetStars above
		--------------------------------------------------------
		{
			type = kHaveStars,
			description = GetString("Goal_Stars", "51"),
			quantity = 1,
			condition = 51,
			optional = true,
			icon = goalIconsTable[kHaveStars],
		},
		
		-- Losing condition. Must match targetMoney above
		--------------------------------------------------------
		{
			type = kClosingTimeLose,
			description = GetString("Goal_ClosingTime", "296"),
			quantity = 1,
			loosingCondition = true,
			icon = goalIconsTable[kClosingTimeLose],
		},
		
	},
	
	tutorialManager = {
		firstStep = 11,
		lastStep = 37,
		boxImage = "level/core/common/textures/tutorial_back",
		boxBorder = 40,
		arrowAnim = TutorialArrowAnim,
		arrowImage = "level/core/common/textures/arrow",

		steps = {
			[0] = {
				message = "Tutorial_Club_2_2",
				messagePosition = {x = 512, y = 320},
				enableStations = {"*"},
				enableEmployees = false,
				waitTime = 2000,
				triggers = {
					[kWaitTimeFinished] = 1,
					[kSkippedStep] = 1,
				},
			},
			[1] = {
				customerList = {"ClubOldTimerFemaleTutorialServe"},
				triggers = {
					[kCustomerArrived] = 2,
				},
			},
			[2] = {
				message = "#Click-and-drag this guest into one of the chairs.",
				messagePosition = {x = 480, y = 24},
				arrowPos = {
					{x = 348, y = 64},
					{x = 56, y = 320},
					{x = 160, y = 320},
					{x = 56, y = 512},
				},
				
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kRentDropCustomerRight] = 3,
				},
			},
			[3] = {
				message = "Tutorial_Club_2_3",
				messagePosition = {x = 512, y = 320},
				arrowPos = {
					{x = 712, y = 32},
				},
				enableStations = {"daiquiri"},
				triggers = {
					[kDispenserClicked] = 4,
				},
			},
			[4] = {
				message = " ",
				messagePosition = {x = 512, y = 320},
				enableStations = {"*"},
				triggers = {
					[kPickUpItem] = 5,
				},
			},
			[5] = {
				message = "Tutorial_Club_2_4",
				messagePosition = {x = 512, y = 320},
				arrowPos = {
					{x = 56, y = 320},
					{x = 160, y = 320},
					{x = 56, y = 512},
				},
				enableStations = {"chair1", "chair2", "chair3"},
				triggers = {
					[kServiceClicked] = 6,
				},
			},
			[6] = {
				message = "Tutorial_Club_2_5",
				messagePosition = {x = 512, y = 320},
				enableStations = {"*"},
				waitTime = 5000,
				triggers = {
					[kEmployeeArriveRestPoint] = 7,
				},
			},
			
			[7] = {
				message = "Tutorial_Club_2_6",
				messagePosition = {x = 512, y = 320},
				waitTime = 5000,
				stopDance = true,
				triggers = {
					[kWaitTimeFinished] = 8,
					[kSkippedStep] = 8,
				},
			},
			[8] = {
				message = "Tutorial_Club_2_7",
				messagePosition = {x = 512, y = 320},
				enableStations = {"chair1", "chair2", "chair3"},
				arrowPos = {
					{x = 56, y = 320},
					{x = 160, y = 320},
					{x = 56, y = 512},
				},
				triggers = {
					[kServiceClicked] = 9,
				},
			},
			[9] = {
				message = " ",
				enableStations = {"*"},
				triggers = {
					[kServiceCleaned] = 10,
				},
			},
			[10] = {
				message = "Tutorial_Club_2_8",
				messagePosition = {x = 512, y = 320},
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 11,
					[kSkippedStep] = 11,
				},
			},
			
			[11] = {
				message = "Tut_Club_1_1",
				messagePosition = {x = 20, y = 340},
				waitTime = 2000,
				triggers = {
					[kWaitTimeFinished] = 12,
					[kSkippedStep] = 12,
				},
			},
			
			[12] = {
				stopDance = true,
				customerList = {"ClubJapaneseExecutiveTutorialDrag"},
				triggers = {
					[kCustomerArrived] = 13,
				},
			},
			[13] = {
				message = "Tut_Club_1_2",
				messagePosition = {x = 20, y = 340},
				arrowPos = {
					{x = 736, y = 520},
				},
				triggers = {
					[kDragCustomer] = 14,
				},
			},
			[14] = {
				arrowPos = {
					{x = 664, y = 320},
				},
				triggers = {
					[kMoveCustomerInside] = 15,
					[kDropCustomerOutside] = 13,
				},
			},
			[15] = {
				message = "Tut_Club_1_3",
				messagePosition = {x = 20, y = 340},
				arrowPos = {
					{x = 664, y = 320},
				},
				triggers = {
					[kMoveCustomerOutside] = 14,
					[kDropCustomerRight] = 16,
					[kDropCustomerWrong] = 16,
				},
			},
			[16] = {
				message = "Tut_Club_1_4",
				waitTime = 5000,
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kWaitTimeFinished] = 17,
					[kSkippedStep] = 17,
				},
			},
			[17] = {
				messagePosition = {x = 24, y = 64},
				customerList = {"ClubFemale1TutorialDrag", "ClubJapaneseExecutiveTutorialDrag"},
				triggers = {
					[kCustomerArrived] = 18,
				},
			},
			[18] = {
				message = "Tut_Club_1_5",
				messagePosition = {x = 20, y = 340},
				arrowPos = {
					{x = 734, y = 520},
				},
				triggers = {
					[kDragCustomer] = 19,
				},
			},
			[19] = {
				message = "Tut_Club_1_6",
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kDropCustomerRight] = 20,
					[kDropCustomerWrong] = 21,
					[kDropCustomerOutside] = 18,
				},
			},
			[20] = {
				message = "Tut_Club_1_7",
				waitTime = 5000,
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kWaitTimeFinished] = 22,
					[kSkippedStep] = 22,
					[kDragCustomer] = 22,
				},
			},
			[21] = {
				message = "Tut_Club_1_8",
				waitTime = 5000,
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kWaitTimeFinished] = 22,
					[kSkippedStep] = 22,
					[kDragCustomer] = 22,
				},
			},
			[22] = {
				message = "Tut_Club_1_9",
				messagePosition = {x = 20, y = 340},
				cancelWait = true,
				arrowPos = {
					{x = 784, y = 520},
				},
				triggers = {
					[kDropCustomerRight] = 23,
					[kDropCustomerWrong] = 23,
				},
			},
			[23] = {
				waitTime = 3000,
				triggers = {
					[kWaitTimeFinished] = 24,
				},
			},
			[24] = {
				message = "Tut_Club_1_10",
				messagePosition = {x = 20, y = 340},
				stopDance = true,
				customerList = {"ClubNewlywedMaleTutorialDrag"},
				triggers = {
					[kCustomerArrived] = 25,
				},
			},
			[25] = {
				arrowPos = {
					{x = 736, y = 520},
				},
				triggers = {
					[kDragCustomer] = 26,
				},
			},
			[26] = {
				arrowPos = {
					{x = 600, y = 350},
				},
				triggers = {
					[kMoveCustomerWrong] = 27,
					[kDropCustomerOutside] = 25,
				},
			},
			[27] = {
				message = "Tut_Club_1_11",
				messagePosition = {x = 20, y = 340},
				arrowPos = {
					{x = 600, y = 350},
				},
				triggers = {
					[kMoveCustomerOutside] = 26,
					[kDropCustomerWrong] = 28,
				},
			},
			[28] = {
				message = "Tut_Club_1_12",
				messagePosition = {x = 20, y = 340},
				waitTime = 2000,
				triggers = {
					[kWaitTimeFinished] = 29,
					[kSkippedStep] = 29,
				},
			},
			[29] = {
				customerList = {"ClubNewlywedFemaleTutorialDrag"},
				triggers = {
					[kCustomerArrived] = 30,
				},
			},
			[30] = {
				message = "Tut_Club_1_13",
				messagePosition = {x = 20, y = 340},
				arrowPos = {
					{x = 736, y = 520},
				},
				triggers = {
					[kDragCustomer] = 31,
				},
			},
			[31] = {
				triggers = {
					[kMoveCustomerRight] = 32,
					[kMoveCustomerWrong] = 33,
					[kDropCustomerOutside] = 30,
				},
			},
			[32] = {
				message = "Tut_Club_1_14",
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kMoveCustomerOutside] = 31,
					[kMoveCustomerWrong] = 33,
					[kDropCustomerRight] = 34,
					[kDropCustomerOutside] = 35,
				},
			},
			[33] = {
				message = "Tut_Club_1_15",
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kMoveCustomerOutside] = 31,
					[kMoveCustomerRight] = 32,
					[kDropCustomerRight] = 34,
					[kDropCustomerOutside] = 35,
				},
			},
			[34] = {
				message = "Tut_Club_1_16",
				messagePosition = {x = 20, y = 340},
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 36,
					[kSkippedStep] = 36,
				},
			},
			[35] = {
				message = "Tut_Club_1_17",
				messagePosition = {x = 20, y = 340},
				triggers = {
					[kDragCustomer] = 31,
				},
			},
			[36] = {
				message = "Tut_Club_1_18",
				messagePosition = {x = 20, y = 340},
				waitTime = 5000,
				triggers = {
					[kWaitTimeFinished] = 37,
					[kSkippedStep] = 37,
				},
			},
			[37] = {
				stopDance = true,
				enableStations = {"margarita", "cubaLibre", "daiquiri", "chair1", "chair2", "chair3", "garbage", "drums"},
				enableEmployees = true,
				activeMoney = 90000,
				resumeGame = true,
				endTutorial = true,
			},
		},
	},
	
	-------------------------------------------------------------------------
	-- Graphic content
	
	CreateBackground();

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

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

	CreateBaseLevelControls(),
};

SetDefaultStyle(nil);