コード例 #1
0
    public void SwitchPanels()
    {
        options.hide();
        switch (button.name)
        {
        case "Hurt":
            attack.show();
            skills.hide();
            items.hide();
            break;

        case "Consume":
            attack.hide();
            skills.hide();
            items.show();
            break;

        case "Protect":
            attack.hide();
            skills.show();
            items.show();
            break;

        case "Run":
            playerTurn.playerTurn = false;
            NPCEntity.NPCTurn     = true;
            break;
        }
    }
コード例 #2
0
    private void CheckForSubOption()
    {
        if (Input.GetKeyDown(KeyCode.Z))
        {
            switch (index)
            {
            case 0:
                options.hide();
                attack.show();
                skills.hide();
                items.hide();
                totalOptions = Attacks.GetSize();
                player.switchState(Transitions.Command.attackSelect);
                break;

            case 1:
                options.hide();
                items.show();
                attack.hide();
                skills.hide();
                //totalOptions = Items.GetSize();
                player.switchState(Transitions.Command.itemSelect);
                break;

            case 2:
                options.hide();
                skills.show();
                attack.hide();
                items.hide();
                totalOptions = Skills.GetSize();
                player.switchState(Transitions.Command.skillSelect);
                break;

            case 3:
                options.hide();
                player.switchState(Transitions.Command.exitBattle);
                break;

            default:
                break;
            }
        }
    }
コード例 #3
0
    void Awake()
    {
        player = GameObject.Find("PlayerController").GetComponent <SMPlayerStats>();
        //dialogueManager = GameObject.Find("DialogueManager").GetComponent<DialogueManager>();
        Continue  = GameObject.Find("Continue").GetComponent <Button>();
        playerNav = GameObject.Find("PlayerNav").GetComponent <Image>();
        attack    = GameObject.Find("Attack sub").GetComponent <PanelScript>();
        skills    = GameObject.Find("Skill sub").GetComponent <PanelScript>();
        items     = GameObject.Find("Item sub").GetComponent <PanelScript>();
        options   = GameObject.Find("Options").GetComponent <PanelScript>();

        options.show();
        attack.hide();
        skills.hide();
        items.hide();
        playerNav.gameObject.SetActive(true);
    }
コード例 #4
0
    private void CheckForAction(string action)
    {
        if (Input.GetKeyDown(KeyCode.X))
        {
            options.show();
            attack.hide();
            skills.hide();
            items.hide();
            player.switchState(Transitions.Command.back);
        }

        Text   text;
        string name;
        Action move = new Attacks();

        (int, int, int)stats = (0, 0, 0);

        switch (action)
        {
        case "attack":
            break;

        case "skill":
            move = new Skills();
            break;

        case "item":
            //move = new Items();
            break;

        default:
            break;
        }

        if (Input.GetKeyDown(KeyCode.Z))
        {
            //gonna need a way to scroll down for when there are more than 4 options
            switch (index)
            {
            case 0:
                text        = button0.GetComponentInChildren <Text>();
                name        = text.ToString();
                displayStat = button0.GetComponent <SMDialogueTrigger>();
                stats       = move.Use(name);
                break;

            case 1:
                text        = button1.GetComponentInChildren <Text>();
                name        = text.ToString();
                displayStat = button1.GetComponent <SMDialogueTrigger>();
                stats       = move.Use(name);
                break;

            case 2:
                text        = button2.GetComponentInChildren <Text>();
                name        = text.ToString();
                displayStat = button2.GetComponent <SMDialogueTrigger>();
                stats       = move.Use(name);
                break;

            case 3:
                text        = button3.GetComponentInChildren <Text>();
                name        = text.ToString();
                displayStat = button3.GetComponent <SMDialogueTrigger>();
                stats       = move.Use(name);
                break;

            default:
                break;
            }

            playerNav.gameObject.SetActive(false);
            string[] msg = new string[] { "Your anixety changed by " + stats.Item1 +
                                          "!\nYour will changed by " + stats.Item2 + "!\nYou dealt " + stats.Item3 +
                                          " damage to the enemy!" };
            displayStat.TriggerDialogue(new Dialogue("", msg));
            SMDialogueTrigger.turn = 0;
            player.switchState(Transitions.Command.playerChoice);
        }
    }