dofile("Scripts/levelManager.lua");

LManager = LevelManager.create();

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

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

gameQueue = {

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

-- skewed block formation
LManager:AddTable(eTYPE_TABLE1, 200, 260);
LManager:AddTable(eTYPE_TABLE2, 400, 260);
--LManager:AddTable(eTYPE_TABLE3, 560, 260);
LManager:AddTable(eTYPE_TABLE4, 140, 375);
LManager:AddTable(eTYPE_TABLE5, 340, 375);
LManager:AddTable(eTYPE_TABLE6, 540, 375);
--LManager:AddTable(eTYPE_TABLE7, 100, 490);
LManager:AddTable(eTYPE_TABLE8, 280, 490);
LManager:AddTable(eTYPE_TABLE9, 480, 490);

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

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

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

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

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

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

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

guest = LManager.GenGuest(eTYPE_GUEST1);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 69000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 105000;
guest.needs[3] = eWANT_GIFT;
guest.times[3] = 195000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST2);
guest.needs[1] = eWANT_DRINK;
guest.times[1] = 29000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 111000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 163000;
guest.needs[4] = eWANT_GIFT;
guest.times[4] = 201000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST4);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 1500;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 60000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 123000;
guest.needs[4] = eWANT_DRINK;
guest.times[4] = 144000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 216000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST10);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 15000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 45000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 85000;
guest.needs[4] = eWANT_DRINK;
guest.times[4] = 165000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 180000;
guest.needs[6] = eWANT_TALK;
guest.times[6] = 203000;
guest.needs[7] = eWANT_DRINK;
guest.times[7] = 225000;
guest.needs[8] = eWANT_GIFT;
guest.times[8] = 260000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST9);
guest.needs[1] = eWANT_DRINK;
guest.times[1] = 21000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 51000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 129000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 171000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST6);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 63000;
guest.needs[2] = eWANT_GIFT;
guest.times[2] = 93000;
guest.needs[3] = eWANT_TALK;
guest.times[3] = 135000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 183000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST11);
guest.needs[1] = eWANT_TALK;
guest.times[1] = 30000;
guest.needs[2] = eWANT_TALK;
guest.times[2] = 99000;
guest.needs[3] = eWANT_GIFT;
guest.times[3] = 141000;
guest.needs[4] = eWANT_TALK;
guest.times[4] = 189000;
guest.needs[5] = eWANT_TALK;
guest.times[5] = 217000;
guest.needs[6] = eWANT_DRINK;
guest.times[6] = 252000;
guest.needs[7] = eWANT_TALK;
guest.times[7] = 268000;
LManager:AddGuest(guest);

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

LManager:SetLevelNumber(4,1);
LManager:SetLevelScores(8600, 9140);
LManager:SetLevelTime(40000);
gameObject = LManager:GenerateGameObject();

levelSetting = LManager:GenerateLevelSettings();

TutorialSteps =
{
	start =
	{ 
		action = "onTrigger = function() end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_TAG", next = "step01" },
		}
	},
	
	step01 =
	{
		action = "onTrigger = function() FreezeTime(); TextBox(25, 350, \"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(265, 215); TextBox(25, 350, \"Click on the topic of conversation when it appears!\", 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, 350, \"Keep trying. You need to tag all three.\", 5000); 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, 350, \"Excellent!  These guys should have no problem talking now! \", 4000); end",
		
		triggers = 
		{		
		}
	},

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