Example #1
0
 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);
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
 public void but408()
 {
     if (api.dialogueStep == 2 || api.dialogueStep == 12)
     {
         // при нажатии якубович открывает рандомную след. дверь и спрашивает, хочет ли игрок сменить дверь
         if (open[0] == false)
         {
             i = UnityEngine.Random.Range(1, 3);
             if (i == 1)
             {
                 i = 1; other = 2;
             }
             else
             {
                 i = 2; other = 1;
             }
             flat[i].enabled = true;
             flat[i].sprite  = Resources.Load <Sprite>("flat") as Sprite;
             door[i].enabled = false;
             open[0]         = true;
             open[other]     = true;
             api.ProcessDialogue("408", names[i] + " is not an elite room");
             api.SetHints("Live with it");
         }
         else
         {
             api.DialogueSuccess("408", "Good luck, the Information Man, good luck..");
             StartCoroutine(LevelLoad());
         }
     }
 }
Example #4
0
 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);
     }
 }
Example #5
0
    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);
        }
    }
Example #6
0
    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);
        }
    }