dofile("Scripts/levelManager.lua");

LManager = LevelManager.create();

LManager:AwardUpgrade(eGOODIE_GLASS);

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

gameQueue = {

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

--square block formation

LManager:AddTable(eTYPE_TABLE4, 160, 375);
LManager:AddTable(eTYPE_TABLE5, 360, 375);
LManager:AddTable(eTYPE_TABLE6, 560, 375);
LManager:AddTable(eTYPE_TABLE7, 160, 490);
LManager:AddTable(eTYPE_TABLE8, 360, 490);
LManager:AddTable(eTYPE_TABLE9, 560, 490);

LManager:AddCandle(165, 74, 25000);
LManager:AddCandle(285, 74, 25000);
LManager:AddCandle(576, 74, 25000);

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

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

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

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

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

seated = LManager.GenSeated(eTYPE_SEATED5);
seated.tableIdx = 6;
LManager:AddSeated(seated);

guest = LManager.GenGuest(eTYPE_GUEST3);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 43000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 71000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 130000;
guest.needs[4] = eWANT_GIFT;
guest.times[4] = 184000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 231000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST7);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 31000;
guest.needs[2] = eWANT_GIFT;
guest.times[2] = 50000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 57000;
guest.needs[4] = eWANT_DRINK;
guest.times[4] = 137000;
guest.needs[5] = eWANT_GIFT;
guest.times[5] = 177000;
guest.needs[6] = eWANT_TALK;
guest.times[6] = 217000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST9);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 24000;
guest.needs[2] = eWANT_DRINK;
guest.times[2] = 83000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 144000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 191000;
guest.needs[5] = eWANT_GIFT;
guest.times[5] = 230000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST10);
guest.needs[1] = eWANT_DRINK;
guest.times[1] = 17000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 64000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 97000;
guest.needs[4] = eWANT_DRINK;
guest.times[4] = 170000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 203000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST1);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 3000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 64000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 111000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 151000;
guest.needs[5] = eWANT_GIFT;
guest.times[5] = 163000;
guest.needs[6] = eWANT_TALK;
guest.times[6] = 210000;
guest.needs[7] = eWANT_TALK;
guest.times[7] = 234000;
guest.needs[8] = eWANT_TALK;
guest.times[8] = 255000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST2);
guest.needs[1] = eWANT_DRINK;
guest.times[1] = 10000;
guest.needs[2] = eWANT_DRINK;
guest.times[2] = 90000;
guest.needs[3] = eWANT_DRINK;
guest.times[3] = 104000;
guest.needs[4] = eWANT_GIFT;
guest.times[4] = 123000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 151000;
guest.needs[6] = eWANT_TALK;
guest.times[6] = 251000;
LManager:AddGuest(guest);

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

LManager:SetLevelNumber(3,3);
LManager:SetLevelScores(7999, 8700);
LManager:SetLevelTime(45000);

gameObject = LManager:GenerateGameObject();

levelSetting = LManager:GenerateLevelSettings();

TutorialSteps =
{
	start =
	{ 
		action = "onTrigger = function() end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_COMBO", next = "step01" },
		}
	},
	
	step01 =
	{
		action = "onTrigger = function() FreezeTime(); TextBox(25, 330, \"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" },
			[4] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_DONE", next = "step05" },
		}
	},
	
	step02 = 
	{
		action = "onTrigger = function() UnfreezeTime(); PlaceArrow(495, 330); TextBox(25, 330, \"Click on the topics to the right until they match the topics on the left.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WRONG", next = "step03" },
			[2] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step04" },
			[3] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_DONE", next = "step05" },
		}
	},

	step03 = 
	{
		action = "onTrigger = function() UnfreezeTime(); TextBox(25, 130, \"Keep trying. Click on the topics to the right until they match the topics on the left.\", 15000); 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(25, 330, \"Great job!  You helped them break the ice!. \", 8000); end",
		
		triggers = 
		{		
		}
	},

	step05= 
	{
		action = "onTrigger = function() UnfreezeTime(); HideArrows(); TextBox(25, 330, \"Try again next time. \", 5000); end",
		
		triggers = 
		{		
		}
	},
}
