dofile("Scripts/levelManager.lua");

LManager = LevelManager.create();

LManager:AddGame(eGAME_SPIN);

LManager:AddTable(eTYPE_TABLE1, 210, 235);
LManager:AddTable(eTYPE_TABLE2, 420, 235);
LManager:AddTable(eTYPE_TABLE1, 315, 382);

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

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

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


guest = LManager.GenGuest(eTYPE_GUEST1);
guest.needs[1] = eWANT_DRINK;
guest.times[1] = 5000;
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST2);
LManager:AddGuest(guest);

guest = LManager.GenGuest(eTYPE_GUEST3);
LManager:AddGuest(guest);

LManager:AdjustGuestHappiness(500);
LManager:SetSnackTime(999000);

LManager:SetLevelNumber(1,1);
LManager:SetLevelScores(800, 1050);
LManager:SetLevelTime(-1); --disables timer

gameObject = LManager:GenerateGameObject();

levelSetting = LManager:GenerateLevelSettings();

TutorialSteps =
{
	start =
	{ 
		action = "onTrigger = function() PauseJokes(); TextBox(210, 385, \"Our first priority is to keep our guests happy so that they enjoy their dates.\", 9999000);	end",
		
		triggers = 
		{
			[1] = { condition = "REQUEST_NEED", data = "eWANT_DRINK", next = "step01" },
		}
	},
	
	step01 = 
	{
		action = "onTrigger = function() TextBox(335, 170, \"Table 1 has a request.  Click on the table to see what they want.\", 9999000) PlaceArrowOn(\"TABLE\")	end",
		
		triggers = 
		{
			[1] = { condition = "TABLE_VISITED", data = "eWANT_DRINK", next = "step02" },
		}
	},
	
	step02 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(395, 15, \"Your guests would like a drink. When it's ready pick up the order from the bar.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_PICKEDUP", data = "eREQ_DRINK", next = "step04" },
		}
	},
	
	step04 = 
	{
		action = "onTrigger = function() HideArrows(); PlaceArrowOn(\"TABLE\"); TextBox(120, 250, \"Good. Now head back to the table to deliver the drink.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_DELIVERED", data = "eREQ_DRINK", next = "step05" },
		}
	},
 
	step05 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(120, 250, \"Well done.  Your guests will now enjoy their drinks as they chat.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "REQUEST_NEED", data = "eWANT_CLEAN", next = "step06" },
		}
	},

	step06 = 
	{
		action = "onTrigger = function() PlaceArrowOn(\"TABLE\"); TextBox(335, 170, \"Your guests have finished their drinks and would now like them cleared.  Click the table to pick up the empties.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_PICKEDUP", data = "eREQ_EMPTY", next = "step07" },
		}
	},

	step07 = 
	{
		action = "onTrigger = function() HideArrows(); PlaceArrowOn(\"BUS_STATION\"); TextBox(425, 300, \"Great.  Now take the empty glasses over to the bus station to get them out of the way.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_DELIVERED", data = "eREQ_EMPTY", next = "step08" },
		}
	},

	step08 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(320, 250, \"Ok, now you give it a try; Just wait.  I think Naomi and Hans may need something soon.\", 5000); GameEvent(\"TRIGGER_DRINK\", 5500); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_DELIVERED", data = "eREQ_EMPTY", next = "step09" },
		}
	},

	step09 =
	{
		action = "onTrigger = function() HideArrows(); TextBox(210, 385, \"Great job! I think we're ready for the art of conversation.\", 9999000); GameEvent(\"TRIGGER_TALK\", 5000); end",
		
		triggers = 
		{
			[1] = { condition = "REQUEST_NEED", data = "eWANT_TALK", next = "step10" },
		}
	},
	
	step10 = 
	{
		action = "onTrigger = function() TextBox(450, 280, \"Table 3 has reached an awkward silence.  Let's see if we can get the conversation back on track.\", 9999000) PlaceArrowOn(\"TABLE\")	end",
		
		triggers = 
		{
			[1] = { condition = "TABLE_VISITED", data = "eWANT_TALK", next = "step11" },
		}
	},

	step11 = 
	{
		action = "onTrigger = function() HideArrows(); PlaceArrow(380, 225); TextBox(450, 190, \"Barb is offering a topic for discussion; help Ronnie reach some common ground by selecting the matching topic.\", 9999000)	end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step13" },
			[2] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WRONG", next = "step12" },
		}
	},

	step12 = 
	{
		action = "onTrigger = function() TextBox(450, 190, \"Keep trying.  Make sure the topic icon matches the one on the left.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "GAME_TRIGGER", data = "eTRIGGER_GAME_WIN", next = "step13" },
		}
	},
	
	step13 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(400, 385, \"That got the conversation going.  And see that survey pop up in the corner... \", 3000); end",
		
		triggers = 
		{		
			[1] = { condition = "TEXTBOX_DONE", data = "", next = "step14" },
		}
	},

	step14 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(400, 385, \"The girls have already shared their interests but the guys need help. Check the clipboard to see how you're doing in revealing the guy's interests. We need these to help make good matches! \", 9999000); GameEvent(\"TRIGGER_GIFT\", 7500); end",
		
		triggers = 
		{		
			[1] = { condition = "REQUEST_NEED", data = "eWANT_GIFT", next = "step15" },
		}
	},
	
	step15 = 
	{
		action = "onTrigger = function() TextBox(335, 170, \"Now I think Table 1 has one last request for the evening.\", 9999000) PlaceArrowOn(\"TABLE\")	end",
		
		triggers = 
		{
			[1] = { condition = "TABLE_VISITED", data = "eWANT_GIFT", next = "step16" },
		}
	},
	
	step16 = 
	{
		action = "onTrigger = function() HideArrows(); TextBox(295, 80, \"Morris and Connie are such a cute couple!  Morris would like to give a red rose to Connie so she knows he's interested in her!\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_PICKEDUP", data = "eREQ_GIFT", next = "step17" },
		}
	},
	
	step17 = 
	{
		action = "onTrigger = function() HideArrows(); PlaceArrowOn(\"TABLE\"); TextBox(120, 250, \"Good. Now head back to the table to deliver the rose to Connie.\", 9999000); end",
		
		triggers = 
		{
			[1] = { condition = "ITEM_DELIVERED", data = "eREQ_GIFT", next = "step18" },
		}
	},
 
	step18 = 
	{
		action = "onTrigger = function() UnpauseJokes(); HideArrows(); TextBox(120, 250, \"Nicely done.  I think the night has gone really well.  Now let's see if we have any matches.\", 9999000); GameEvent(\"REVEAL_INTERESTS\", 0); GameEvent(\"END_GAME\", 5000); end",
		
		triggers = 
		{
		}
	},
}