Esempio n. 1
0
 public void EndDialogue()
 {
     display.GetComponent <PanelScript>().hide();
     //options.GetComponent<PanelScript>().show();
     //playerNav.gameObject.SetActive(true);
     player.switchState(Transitions.Command.waitForEnemy);
     Debug.Log("End of Dialogue");
 }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        switch (player.getState())
        {
        //need a way to differentiate when this state has been called by
        //player action or enemy action
        case Transitions.ProcessState.dialogue:
            TriggerDialogue();
            if (turn == 0)
            {
                player.switchState(Transitions.Command.waitForEnemy);
            }
            else if (turn == 1)
            {
                player.switchState(Transitions.Command.waitForPlayer);
            }
            break;

        default:
            break;
        }
    }
Esempio n. 3
0
    public void EnemyTurn()
    {
        Attacks move = new Attacks();

        (int, int, int)stats = (0, 0, 0);
        int whatItChooses = Random.Range(1, 5);

        switch (whatItChooses)
        {
        case 1:
            stats = move.Use(name);
            print("They scared you!");
            break;

        case 2:
            stats = move.Use(name);
            print("They healed themself");
            break;

        case 3:
            stats = move.Use(name);
            print("They attacked you!");
            break;

        case 4:
            stats = move.Use(name);
            print("Their mental attribute increased");
            break;
        }

        string[] msg = new string[] { "Your anixety changed by " + stats.Item1 +
                                      "!\nYour will changed by " + stats.Item2 + "!" };
        displayStat.TriggerDialogue(new Dialogue("", msg));
        SMDialogueTrigger.turn = 1;
        player.switchState(Transitions.Command.enemyChoice);
    }
Esempio n. 4
0
 public void Die()
 {
     //should display final dialogue before battle exit
     player.switchState(Transitions.Command.exitBattle);
     //what happens to an NPC when they're defeated?
 }
Esempio n. 5
0
 private void SpeakToNPC()
 {
     print("Start battle");
     player.switchState(Transitions.Command.startBattle);
     SceneManager.LoadScene("Combat");
 }
Esempio n. 6
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);
        }
    }