/*
     * Set the demon's lines based on player response
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        switch (option)
        {
        //"Come to find demon name"
        case 0:
            nextDialog = nameDialog;
            break;

        //"Pay tribute"
        case 1:
            nextDialog = tributeDialog;
            break;

        //"Learn about the world"
        case 2:
            nextDialog = worldDialog;
            break;
        }

        nextDialog.SetActive(true);
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #2
0
    /*
     * Advance to final confrontation if ready
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        switch (option)
        {
        case 0:
            nextDialog = incorrectDialog;
            break;

        case 1:
            if (certain)
            {
                nextDialog = correctCertainDialog;
            }
            else
            {
                nextDialog = correctGuessDialog;
            }
            break;
        }

        nextDialog.SetActive(true);
        nextDialog.GetComponent <DialogItemController>().extraSetup();
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #3
0
    /*
     * Show the next line of dialog
     * or advance to the next item in the chain
     */
    public override void showNext(ConversationTile conversation)
    {
        if (lineCounter < lines.Count)
        {
            //Advance to next line in this dialog
            textObj.text = lines[lineCounter++];
        }
        else
        {
            //Reset to start of dialog
            lineCounter  = 0;
            textObj.text = lines[lineCounter++];

            //Advance to next dialog if it exists
            if (nextDialog != null)
            {
                nextDialog.SetActive(true);
                nextDialog.GetComponent <DialogItemController>().extraSetup();
                conversation.setDialog(nextDialog);

                this.gameObject.SetActive(false);
            }
            else
            {
                conversation.endInteraction();
                this.gameObject.SetActive(false);
            }
        }
    }
コード例 #4
0
    /*
     * Set the demon's lines based on player response
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        GameController gameController = GameObject.Find("GameManager").GetComponent <GameController>();

        gameController.metIronDemon = true;

        switch (option)
        {
        case 0:
            gameController.hasIron   = false;
            nextDialog               = ironDialog;
            gameController.ironMetal = GameController.metals.iron;
            break;

        case 1:
            nextDialog = otherDialog;
            gameController.ironMetal = GameController.metals.copper;
            break;

        case 2:
            nextDialog = otherDialog;
            gameController.ironMetal = GameController.metals.mercury;
            break;

        case 3:
            nextDialog = nothingDialog;
            break;
        }

        nextDialog.SetActive(true);
        nextDialog.GetComponent <DialogItemController>().extraSetup();
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #5
0
    /*
     * Set the demon's lines based on player response
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        GameController gameController = GameObject.Find("GameManager").GetComponent <GameController>();

        gameController.metCopperDemon = true;

        bool angered = false;

        switch (option)
        {
        case 0:
            nextDialog = ironDialog;
            angered    = true;
            gameController.copperMetal = GameController.metals.iron;
            break;

        case 1:
            gameController.hasCopper = false;
            nextDialog = copperDialog;
            gameController.copperMetal = GameController.metals.copper;
            break;

        case 2:
            nextDialog = mercuryDialog;
            angered    = true;
            gameController.copperMetal = GameController.metals.mercury;
            break;

        case 3:
            nextDialog = defaultDialog;
            angered    = true;
            break;
        }

        /* Downcasting conversation to specific type
         * Assuming this script is only used where it is required,
         * This should always work.
         */
        CopperDemonConversation con = (conversation as CopperDemonConversation);

        if (con != null)
        {
            con.setAngered(angered);
        }

        nextDialog.SetActive(true);
        nextDialog.GetComponent <DialogItemController>().extraSetup();
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #6
0
    /*
     * Advance to final confrontation if ready
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        switch (option)
        {
        case 0:
            nextDialog = readyDialog;
            break;

        case 1:
            nextDialog = notReadyDialog;
            break;
        }

        nextDialog.SetActive(true);
        nextDialog.GetComponent <DialogItemController>().extraSetup();
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #7
0
    /*
     * Add the book to the player inventory if it was taken
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        switch (option)
        {
        //"Take book"
        case 0:
            nextDialog = loveDialog;
            break;

        //"Leave book"
        case 1:
            nextDialog = jokeDialog;
            break;
        }

        nextDialog.SetActive(true);
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #8
0
    /*
     * Add the book to the player inventory if it was taken
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        switch (option)
        {
        //"Take book"
        case 0:
            nextDialog = takenDialog;
            GameController gameController = GameObject.Find("GameManager").GetComponent <GameController>();
            gameController.hasBook = true;
            break;

        //"Leave book"
        case 1:
            nextDialog = leftDialog;
            break;
        }

        nextDialog.SetActive(true);
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }
コード例 #9
0
    /*
     * Add the book to the player inventory if it was taken
     */
    public override void selectOption(int option, ConversationTile conversation)
    {
        GameController gameController = GameObject.Find("GameManager").GetComponent <GameController>();

        switch (option)
        {
        //"Take"
        case 0:
            nextDialog = takenDialog;
            switch (contents)
            {
            case Contents.Copper:
                gameController.hasCopper     = true;
                gameController.hasCopperName = true;
                break;

            case Contents.Iron:
                gameController.hasIron     = true;
                gameController.hasIronName = true;
                break;

            case Contents.Mercury:
                gameController.hasMercury     = true;
                gameController.hasMercuryName = true;
                break;

            case Contents.Key:
                gameController.hasKey     = true;
                gameController.hasKeyName = true;
                break;

            default:
                break;
            }
            break;

        //"Leave"
        case 1:
            nextDialog = leftDialog;
            switch (contents)
            {
            case Contents.Copper:
                gameController.hasCopperName = true;
                break;

            case Contents.Iron:
                gameController.hasIronName = true;
                break;

            case Contents.Mercury:
                gameController.hasMercuryName = true;
                break;

            case Contents.Key:
                gameController.hasKeyName = true;
                break;

            default:
                break;
            }
            break;
        }

        nextDialog.SetActive(true);
        conversation.setDialog(nextDialog);

        this.gameObject.SetActive(false);
    }