public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && guess.Contains("sorry")) { api.DialogueSuccess(guess, "OK, that won't make sense if you don't succeed in the exam. All your classmates are doing last\n tasks now, I think. " + "You have only 30 minutes out of 90 left. Good luck, the Information Man!"); } else if (api.dialogueStep == 1 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(1); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && api.IsGreeting(guess)) { api.ProcessDialogue(guess, "You've come to get the exam results?"); api.SetHints("Answer positively"); } else if (api.dialogueStep == 1 && (guess.ToLower() == "yes" || guess.ToLower() == "yeah")) { api.ProcessDialogue(guess, "Cool! Can you tell me your name?"); api.SetHints("Be accurate!"); } else if (api.dialogueStep == 2) { if (guess == player.fullname || string.Equals(guess, "The Information Man", StringComparison.CurrentCultureIgnoreCase)) { api.ProcessDialogue(guess, "Oh, I have you in my list! You've written it brilliantly! Your grade is 'A'! Congrutulations!"); api.SetHints("Thank the professor!"); } else { api.DialogueFail(guess, "I don't have you in my list. Don't waste my time anymore!"); } } else if (api.dialogueStep == 3) { api.DialogueSuccess(guess, "I let you go! Goodbye!"); } else if (api.dialogueStep == 4 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(4); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && api.IsGreeting(guess)) { api.ProcessDialogue(guess, " You are my new neighbor, aren't you?"); api.SetHints("Answer positively"); } else if (api.dialogueStep == 1 && (guess.ToLower() == "yes" || guess.ToLower() == "yeah")) { api.ProcessDialogue(guess, "You think yes, but I think no. You can't be my neighbor so quickly."); api.SetHints("Answer anything"); } else if (api.dialogueStep == 2) { api.ProcessDialogue(guess, "Firstly, what is your name?"); api.SetHints("Be accurate!"); } else if (api.dialogueStep == 3 && (guess == player.fullname || string.Equals(guess, "The Information Man", StringComparison.CurrentCultureIgnoreCase))) { api.ProcessDialogue(guess, "Such an unusual name. You can compete for the prize of being my new neighbor!"); api.SetHints("Answer anything"); } else if (api.dialogueStep == 4) { api.ProcessDialogue("And yours?", "I'm Simon Barrel-Roll. Glad we know each others' names, such a helpful information."); api.SetHints("Answer anything"); } else if (api.dialogueStep == 5) { api.ProcessDialogue(guess, "I've heard someones voice? Who is this? Ah, never mind. Well, didn't you know that\n all my previous neighbors had an IQ > 120? You should solve some tasks to " + "proudly call me your\n neighbor!"); api.SetHints("Answer anything"); } else if (api.dialogueStep == 6) { api.task(new Tasks.EntropyTask()); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Here's the task: \n" + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 7) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.task(null); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Absobloodylootely! Welcome to this room. Hope you won't leave me soon!"); api.SetHints("Answer anything"); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "Hahaha, wrong! Try again!"); } } else if (api.dialogueStep == 8) { api.ProcessDialogue(guess, "Here's your bed! I heard you're going to have a hard day tomorrow, so dispose\n yourself with comfort " + "and have a nice dream!"); api.SetHints("Answer anything"); } else if (api.dialogueStep == 9) { api.DialogueSuccess(guess, "See you soon! Goodnight!"); } else if (api.dialogueStep == 10 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(10); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "" && api.dialogueStep != 4 && api.dialogueStep != 9) { inputField.ActivateInputField(); } else if (api.dialogueStep == 0) { api.ProcessDialogue("Wait, what?", "Yes. Dormitory manager is away today. She has left for you 3 available rooms. " + "There is\n one elite room and two good but not elite. You should pick one room. Then I will open one not elite\n room " + "and your task is to pick the room again. You can either change your first choice or pick the same\n room. It will be your room then. " + "Are you ready?"); api.SetHints("Answer positively"); } else if (api.dialogueStep == 1) { api.ProcessDialogue(guess, "Spin the barrel!.. I mean, pick the room!"); api.SetHints("Click at one room!"); inputField.DeactivateInputField(); } else if (api.dialogueStep == 3) { api.ProcessDialogue(guess, "Spin the barrel!"); api.SetHints("Spin it with grace"); } else if (api.dialogueStep == 4) { api.ProcessDialogue("...spinning the barrel...", "Can you tell me where did you come from?"); api.SetHints("Name your city in >4 symbols"); } else if (api.dialogueStep == 5 && guess.Length > 4) { api.ProcessDialogue(guess, "Interesting! Who do you want to send your greetings to?"); api.SetHints("List three names"); } else if (api.dialogueStep == 6 && guess.Split().Length > 2) { api.ProcessDialogue(guess, "Have you got some gifts with you?"); api.SetHints("Be accurate"); } else if (api.dialogueStep == 7) { api.ProcessDialogue(guess, "Cool. 300 points on the barrel! Letter!"); api.SetHints("Do you know letter?"); } else if (api.dialogueStep == 8 && guess.Length == 1 && char.IsLetter(guess[0])) { api.ProcessDialogue(guess, "No such letter. Basically, it's a \"Field of Dreams\" gameover. " + "But I give you the last chance.\n Spin the barrel!"); api.SetHints("Spin it with grace"); } else if (api.dialogueStep == 9) { api.ProcessDialogue("...spinning the barrel...", "Would you love to change your first choice of room?"); api.SetHints("Answer: \n1. Yes \n2. No"); } else if (api.dialogueStep == 10 && guess.ToLower() == "yes") { api.task(new Tasks.DefinedTask("What is the probability that by switching in this game player wins?", "0.67")); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Hmmm.. You think that switching is better? Can you give the actual probability that you will\n win by switching?"); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 10 && guess.ToLower() == "no") { api.task(new Tasks.DefinedTask("What is the probability that by selecting the same door in this game player wins?", "0.33")); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Hmmm.. You think that switching is a bad idea? Can you give the actual probability that\n you will win by selecting the same door?"); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 11) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.task(null); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Exactly! OK, a matter of life and death! It's time, my friend! Pick the room!"); api.SetHints("Click at one room!"); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "You're wrong! You thought that it's only a show? It's a life, my friend, life itself. Try again!"); } } else if (guess == "hjkl") { api.DialogueSuccess(11); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && (guess.ToLower().Contains("yes") || guess.ToLower().Contains("no"))) { api.ProcessDialogue(guess, "Great. Why are you here then?"); api.SetHints("Write something containing \"go\""); } else if (api.dialogueStep == 1 && guess.ToLower().Contains("go")) { api.ProcessDialogue(guess, "OK, I will let you go."); api.SetHints("Answer anything"); } else if (api.dialogueStep == 2) { api.ProcessDialogue(guess, "Not right now, haha. Just two questions actually. Firstly, don't you know who is the author\n of this masterpiece on the wall?"); api.SetHints("Don't lie!"); } else if (api.dialogueStep == 3) { api.ProcessDialogue(guess, "I will remember your answer. Btw, I've never seen you here before. Are you a freshman?"); api.SetHints("You're a freshman. Confirm it!"); } else if (api.dialogueStep == 4 && (guess.ToLower() == "yes" || guess.ToLower() == "yeah")) { api.ProcessDialogue(guess, "Welcome to this wonderful place. I promise you'll have an unforgetable Information Theory\n journey, " + "the Information Man. I'll give you a simple task that will surely help you to get into the\n swing of things here. Are you excited?"); api.SetHints("Answer anything"); } else if (api.dialogueStep == 5) { api.task(new Tasks.PoissonDistributionTask()); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Cool! " + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 6) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.task(null); player.UpdateTaskPanel(); api.DialogueSuccess(guess, "I see you're a smart guy, the Information Man! I let you go."); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "You're wrong! Are you really the Information Man then? Try again!"); } } else if (api.dialogueStep == 7 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(7); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && api.IsGreeting(guess)) { api.ProcessDialogue(guess + ".. What, are you talking??", "Of course, yes. Paper can communicate with people. I'm a representative of the royal\n sheets family. " + "I was made from the best wood in the whole country! So, I think we will get on well."); api.SetHints("Answer anything"); } else if (api.dialogueStep == 1) { api.ProcessDialogue(guess, "Cool! But actually, I'm just a result of the process of imagination in your mind. All my\n words doesn't exist in reality. " + "Do you really think that I'm talking to you right now? Yes? No?"); api.SetHints("Be accurate!"); } else if (api.dialogueStep == 2) { api.ProcessDialogue("Yes, no.. Don't waste my time, you, a sheet of paper!", "OK, I understand. Exam. Exam is such an important event. " + "And you don't want to fail.\n I know. But I advice you to think about the life of paper in your spare time! " + "Cause sometimes people\n use us miserably. We don't like such service! Peace!"); } else if (api.dialogueStep == 3) { api.ProcessDialogue(guess, "OK, let's postpone our important talk for a short time. We'll have enough time after\n the exam. " + "Let's unite and together solve these annoying tasks. Hope I'll bring them to you correctly.\n Are you ready for the first one?"); api.SetHints("Answer anything"); } else if (api.dialogueStep == 4) { System.Random rnd = new System.Random(); String word = ""; switch (rnd.Next(0, 3)) { case 0: word = "I love Information Theory"; break; case 1: word = "Sheet of Paper is my friend"; break; case 2: word = "this is a game of the year"; break; } api.task(new Tasks.EntropyTask("My name is " + player.fullname + " and " + word)); player.UpdateTaskPanel(); api.ProcessDialogue("Yes, my companion!", "Task One: Easy one: " + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 5) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "My paper congratulations to you! Next task consists of five subtasks. Get ready:"); api.SetHints("Answer anything"); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 6) { api.task(new Tasks.TwoRandomVariables()); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Task Two: " + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 7) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "First one is correct! Next:\n " + api.task().WriteSubTask()); api.task().taskDescription = api.task().WriteTask(); player.UpdateTaskPanel(); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 8) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "Second one is correct! Next:\n " + api.task().WriteSubTask()); api.task().taskDescription = api.task().WriteTask(); player.UpdateTaskPanel(); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 9) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "Third one is correct! Next:\n " + api.task().WriteSubTask()); api.task().taskDescription = api.task().WriteTask(); player.UpdateTaskPanel(); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 10) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "Forth one is correct! Next:\n " + api.task().WriteSubTask()); api.task().taskDescription = api.task().WriteTask(); player.UpdateTaskPanel(); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 11) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.ProcessDialogue(guess, "Fifth one is correct! Cool! Task was done easily! Are you ready for the last one?"); api.SetHints("Answer anything"); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 12) { api.task(new Tasks.HuffmanCodingTask()); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Task Three: Hard & Fun! \n" + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 13) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.DialogueSuccess(guess, "Hooray!! Mate, you've done everything. Now, hurry up! Rewrite solutions carefully and\n " + "pass them to the Professor. And hope for your 'A' grade!"); StartCoroutine(EndOfExam()); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "My paper disappointments to you. Wrong one! Try again!"); } } else if (api.dialogueStep == 14 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(14); } else { api.WrongInput(guess); } }
public void GetInput(string guess) { if (guess == "") { inputField.ActivateInputField(); } else if (api.dialogueStep == 0 && api.IsGreeting(guess)) { api.ProcessDialogue(guess, "You've come for an interview?"); api.SetHints("Answer positively"); } else if (api.dialogueStep == 1 && (guess.ToLower() == "yes" || guess.ToLower() == "yeah")) { api.ProcessDialogue(guess, "Cool! Can you tell me your name?"); api.SetHints("Be accurate!"); } else if (api.dialogueStep == 2) { if (guess == player.fullname || string.Equals(guess, "The Information Man", StringComparison.CurrentCultureIgnoreCase)) { api.ProcessDialogue(guess, "Oh, I have you in my list! OK, I will give you few tasks to check your skills.\n " + "Are you ready for the first one?"); api.SetHints("Answer anything"); } else { api.DialogueFail(guess, "I don't have you in my list. Don't waste my time anymore!"); } } else if (api.dialogueStep == 3) { api.task(new Tasks.SumTask()); player.UpdateTaskPanel(); switch (PlayerPrefs.GetInt("professor")) { case 0: api.ProcessDialogue(guess, "Your answer doesn't matter, actually. Never mind. " + api.task().taskDescription); break; case 1: api.ProcessDialogue(guess, "Basically, your answer doesn't matter. Nevertheless, " + api.task().taskDescription); break; case 2: api.ProcessDialogue(guess, "Your compiler doesn't matter actually. Well. " + api.task().taskDescription); break; } api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 4) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.task(null); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "Surprisingly, correct! OK. Next task."); api.SetHints("Answer anything"); } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "You're wrong! Try again!"); } } else if (api.dialogueStep == 5) { api.task(new Tasks.ProbabilityTask()); player.UpdateTaskPanel(); api.ProcessDialogue(guess, "I see your happy face. That's cool! Next one may require more time to succeed.\n" + api.task().taskDescription); api.SetHints("Use:\n \"Ctrl+T\" to see the task\n \"Ctrl+H\" to see helpful formulas"); } else if (api.dialogueStep == 6) { if (api.task().CheckResult(guess, api.task().writeAnswer) == 1) { api.task(null); player.UpdateTaskPanel(); switch (PlayerPrefs.GetInt("professor")) { case 0: api.ProcessDialogue(guess, "Basically, you're correct! And the last one: why do you want to study in Innopolis University?"); api.SetHints("Write something in\n>20 symbols and at least 5 words"); break; case 1: api.ProcessDialogue(guess, "Well done! And the last one: what are the roots of the equation ax^2+bx+c?"); api.SetHints("Think carefully"); break; case 2: api.ProcessDialogue(guess, "You're right.. ahem! And the last one: name three best programming languages."); api.SetHints("You your knowledge of Compilers course. Oh, wait..."); break; } } else { api.AnotherAttempt(); api.ProcessDialogue(guess, "You're wrong! Try again!"); } } else if (api.dialogueStep == 7 && PlayerPrefs.GetInt("professor") == 0 && guess.Length > 20 && guess.Split().Length > 4) { api.DialogueSuccess(guess, "Very interesting. I think it's enough for you. Welcome to this wonderful place!\n " + "Dormitory manager is waiting for you. You are free to go."); } else if (api.dialogueStep == 7 && PlayerPrefs.GetInt("professor") == 1 && (guess.ToLower().StartsWith("x ") || guess.ToLower().StartsWith("x") || guess.ToLower().Contains(" x ") || (guess.ToLower().Contains("x1") && guess.ToLower().Contains("x2")))) { api.DialogueSuccess(guess, "Nice one! I think it's enough for you. Welcome to this wonderful place!\n " + "Dormitory manager is waiting for you. You are free to go."); } else if (api.dialogueStep == 7 && PlayerPrefs.GetInt("professor") == 2 && guess.Split().Length == 3 && (guess.ToLower().Contains("go") || guess.ToLower().Contains("scala") || guess.ToLower().Contains("c++"))) { api.DialogueSuccess(guess, "Good opinion. I think it's enough for you. Welcome to this wonderful place!\n " + "Dormitory manager is waiting for you. You are free to go."); } else if (api.dialogueStep == 8 && guess != "") { textPanel.text += "\n" + player.fullname + ": " + guess; inputField.text = ""; } else if (guess == "hjkl") { api.DialogueSuccess(8); } else { api.WrongInput(guess); } }