public void GetResponseTest()
    {
        //Arrange
        string[] responses = new string[9] {
            "Don’t try and force me to tell you anything. I’ve got more money than you.",
            "Don’t patronise me you cretin. I’ve got more money than you.",
            "How dare you threaten me you lunatic, I’ve got more money than you.",
            "No my dear fellow for you see I have more money than you.",
            "Ha ha ha. Not that funny dear fellow, you’ll need more money to make it funnier.",
            "My good man, I know that time is money, but you can’t rush magnificence!",
            "My good man, there isn’t enough money around here to warrant seeing anything.",
            "I thank you for your kindness, but it would be better with some patronage!",
            "My good man, you don’t need my help to solve this. Not to mention there’s no money involved."
        };
        string[] questioningStyles = new string[9] {
            "Forceful",
            "Condescending",
            "Intimidating",
            "Coaxing",
            "Wisecracking",
            "Rushed",
            "Inquisitive",
            "Kind",
            "Inspiring"
        };


        var npc = new NonPlayerCharacter(null, null, null, null, null, responses);

        //Assert
        for (int i = 0; i < questioningStyles.Length; i++)
        {
            Assert.AreSame(npc.GetResponse(questioningStyles [i]), responses [i]);
        }
    }
Ejemplo n.º 2
0
    public void QuestionCharacter(int reference)
    {
        //reference passes the question style reference i.e leftmost button=0, middle=1, rightmost=2
        string        choice;
        List <string> weaknesses;
        string        response;

        choice     = GetQuestioningChoice(reference);
        weaknesses = character.GetWeaknesses();

        if ((weaknesses.Contains(choice)) && (character.getVerbalClue() != null))
        { //If chosen style is a weakness to the character
            VerbalClue clue = character.getVerbalClue();
            if (!NotebookManager.instance.logbook.GetLogbook().Contains(character.getVerbalClue()))
            {                                                      //If the logbook doesnt contain the clue already
                response = "Clue Added: " + clue.getDescription(); //Change the responce and add to the logbook
                NotebookManager.instance.logbook.AddVerbalClueToLogbook(clue);
                NotebookManager.instance.UpdateNotebook();
            }
            else
            {
                response = "Clue Already Obtained";         //Otherwise state the clue is already in the logbook
            }
        }
        else
        {
            response = character.GetResponse(choice); //Otherwise just give the responce
        }
        clueSpeech.text = response;                   //Update the UI Text with the appropriate repsonce
    }
Ejemplo n.º 3
0
    public void QuestionCharacter(int reference)
    {
        //reference passes the question style reference i.e leftmost button=0, middle=1, rightmost=2
        string response;
        string choice;

        choice = GetQuestioningChoice(reference);
        if (character.CanBeQuestionned())               //ADDITION BY WEDUNNIT
        {
            List <string> weaknesses;
            weaknesses = character.GetWeaknesses();

            if ((weaknesses.Contains(choice)) && (character.getVerbalClue() != null))                 //If chosen style is a weakness to the character
            {
                VerbalClue clue = character.getVerbalClue();
                if (!NotebookManager.instance.logbook.GetLogbook().Contains(character.getVerbalClue())) //If the logbook doesnt contain the clue already
                {
                    response = "Clue Added: " + clue.getDescription();                                  //Change the responce and add to the logbook
                    NotebookManager.instance.logbook.AddVerbalClueToLogbook(clue);
                    GameMaster.instance.UnblockAllCharacters();                                         //ADDITION BY WEDUNNIT
                    NotebookManager.instance.UpdateNotebook();
                    //__NEW_FOR_ASSESSMENT_4__(START)
                    if (GameObject.Find("Multiplayer Manager Object") != null)
                    {
                        MultiplayerManager.instance.GetTurnManager().IncrementActionCounter();                         // For turn switching in multiplayer.
                    }
                    //__NEW_FOR_ASSESSMENT_4__(END)
                }
                else
                {
                    response = "Clue Already Obtained";                                         //Otherwise state the clue is already in the logbook
                }
            }
            else
            {
                response = character.GetResponse(choice);                               //Otherwise just give the responce
            }
        }
        else                                                                            //If the character blocks questioning //ADDITION BY WEDUNNIT
        {
            response = character.GetResponse(choice + "ButBlocked");                    //Gets relevent reply //ADDITION BY WEDUNNIT
        }

        clueSpeech.text = response;             //Update the UI Text with the appropriate repsonce
    }
Ejemplo n.º 4
0
    public void GetResponseTest()
    {
        var npc = new NonPlayerCharacter(null, null, null, null, null, responses);

        //Assert
        for (int i = 0; i < questioningStyles.Length; i++)
        {
            Assert.AreSame(npc.GetResponse(questioningStyles [i]), responses [i]);
        }
    }