dofile("Scripts/levelManager.lua");

LManager = LevelManager.create();

LManager:AwardUpgrade(eUPGRADE_SAMMY);

LManager:AddGame(eGAME_METER);
LManager:AddGame(eGAME_SPIN);
LManager:AddGame(eGAME_RECALL);
LManager:AddGame(eGAME_SHELL);
--LManager:AddGame(eGAME_COMBO);

gameQueue = {

      eGAME_SHELL,
      eGAME_SHELL,
};
LManager:SetGameQueue(gameQueue);

--square block formation
LManager:AddTable(eTYPE_TABLE1, 200, 260);
LManager:AddTable(eTYPE_TABLE3, 560, 260);
LManager:AddTable(eTYPE_TABLE5, 380, 375);
LManager:AddTable(eTYPE_TABLE7, 200, 490);
LManager:AddTable(eTYPE_TABLE9, 560, 490);

seated = LManager.GenSeated(eTYPE_SEATED1);
seated.tableIdx = 1;
LManager:AddSeated(seated);

seated = LManager.GenSeated(eTYPE_SEATED2);
seated.tableIdx = 2;
LManager:AddSeated(seated);

seated = LManager.GenSeated(eTYPE_SEATED7);
seated.tableIdx = 3;
LManager:AddSeated(seated);

seated = LManager.GenSeated(eTYPE_SEATED8);
seated.tableIdx = 4;
LManager:AddSeated(seated);

seated = LManager.GenSeated(eTYPE_SEATED3);
seated.tableIdx = 5;
LManager:AddSeated(seated);

guest = LManager.GenGuest(eTYPE_GUEST4);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 24000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 59000;
guest.needs[3] = eWANT_DRINK;
guest.times[3] = 68000;
guest.needs[4] = eWANT_GIFT;
guest.times[4] = 144000;
guest.needs[5] = eWANT_DRINK;
guest.times[5] = 158000;
guest.needs[6] = eWANT_GIFT;
guest.times[6] = 199000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST5);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 17000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 55000;
guest.needs[3] = eWANT_DRINK;
guest.times[3] = 74000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 101000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 150000;
guest.needs[6] = eWANT_TALK;
guest.times[6] = 207000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST6);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 2000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 85000;
guest.needs[3] = eWANT_DRINK;
guest.times[3] = 100000;
guest.needs[4] = eWANT_DRINK;
guest.times[4] = 138000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 166000;
guest.needs[6] = eWANT_GIFT;
guest.times[6] = 215000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST7);
guest.needs[1] = eWANT_GIFT;
guest.times[1] = 10000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 38000;
guest.needs[3] = eWANT_DRINK;
guest.times[3] = 93000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 125000;
guest.needs[5] = eWANT_DRINK;
guest.times[5] = 183000;
guest.needs[6] = eWANT_GIFT;
guest.times[6] = 190000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST1);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 31000;
guest.needs[2] = eWANT_GIFT;
guest.times[2] = 48000;
guest.needs[3] = eWANT_GIFT;
guest.times[3] = 102000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 114000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 190000;
guest.needs[6] = eWANT_GIFT;
guest.times[6] = 215000;
LManager:AddGuest(guest);

LManager:AdjustGuestHappiness(150);
LManager:SetSnackTime(20000);

LManager:SetLevelNumber(2,6);
LManager:SetLevelScores(6000, 6775);
LManager:SetLevelTime(45000);

gameObject = LManager:GenerateGameObject();

levelSetting = LManager:GenerateLevelSettings();

TutorialSteps =
{
	start =
	{ 
		action = "onTrigger = function() end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_SHELL", next = "step01" },
		}
	},
	
	step01 =
	{
		action = "onTrigger = function() FreezeTime(); TextBox(65, 190, \"Another conversation has started.  Give the guy a hand and help him focus on his date's interest.\", 5000); end",
		
		triggers = 
		{
			[1] = { condition = "TEXTBOX_DONE", data = "", next = "step02" },
			[2] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WRONG", next = "step03" },
			[3] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step04" },
		}
	},
	
	step02 = 
	{
		action = "onTrigger = function() UnfreezeTime(); PlaceArrow(500, 215); TextBox(65, 190, \"Remember which topic was where! Now they're moving on you!\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WRONG", next = "step03" },
			[2] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step04" },
		}
	},

	step03 = 
	{
		action = "onTrigger = function() UnfreezeTime(); TextBox(65, 190, \"Keep trying. Match the topic on the left.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step04" },
			[2] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_DONE", next = "step05" },
		}
	},
	
	step04= 
	{
		action = "onTrigger = function() UnfreezeTime(); HideArrows(); TextBox(65, 190, \"Another conversation completed successfully. \", 4000); end",
		
		triggers = 
		{		
		}
	},

	step05= 
	{
		action = "onTrigger = function() UnfreezeTime(); HideArrows(); TextBox(65, 190, \"Try again next time. \", 4000); end",
		
		triggers = 
		{		
		}
	},
}
