// Update is called once per frame
    void Update()
    {
        opponentBP = opponent.currentBp;
        playerBP   = player.bp;

        if (!gc.isTutMode) //PLEASE REMEMBER TO SET THIS VAR TO TRUE AT THE BEG OF THE GAME!
        {
            if (!CheckIfItsOver())
            {
                if (!isPlayerTurn)
                {
                    if (gc.tutTracker == 2 || gc.tutTracker > 5)
                    {
                        if (actionTimer > 0)
                        {
                            actionTimer -= Time.deltaTime;
                        }
                        else
                        {
                            if (!actionChosen)
                            {
                                if (gc.tutTracker == 2)
                                {
                                    oa.ChooseRandomMove();
                                }
                                else
                                {
                                    int randAction = 0;
                                    randAction = Random.Range(0, 50);

                                    if (randAction > 2)
                                    {
                                        oa.ChooseRandomMove();
                                    }
                                    else
                                    {
                                        oa.BeQuirky();
                                    }
                                }
                                gc.tutTracker++;
                                actionChosen = true;
                            }
                        }
                    }
                    else
                    {
                        if (!actionChosen)
                        {
                            if (gc.tutTracker < 4)
                            {
                                gc.tutTracker++;
                                TutorialHandler tutC = FindObjectOfType <TutorialHandler>();
                                tutC.wordTracker = -1;
                                tutC.BeginText(tutC.tutWords[gc.tutTracker].lines);
                                isPlayerTurn = true;
                                gc.isTutMode = true;
                            }
                            else if (gc.tutTracker == 5)
                            {
                                TutorialHandler tutC = FindObjectOfType <TutorialHandler>();
                                tutC.BeginText(tutC.tutWords[4].lines);
                                isPlayerTurn = true;
                                gc.isTutMode = true;
                            }
                            else
                            {
                                TutorialHandler tutC = FindObjectOfType <TutorialHandler>();
                                tutC.wordTracker = -1;
                                tutC.BeginText(tutC.tutWords[gc.tutTracker].lines);
                                isPlayerTurn = true;
                                gc.isTutMode = true;
                            }
                        }
                    }
                }
                else
                {
                    if (gc.tutTracker == 3)
                    {
                        TutorialHandler tutC = FindObjectOfType <TutorialHandler>();
                        tutC.wordTracker = -1;
                        tutC.BeginText(tutC.tutWords[gc.tutTracker].lines);
                        isPlayerTurn = true;
                        gc.isTutMode = true;
                        gc.tutTracker++;
                    }
                }
            }
            else
            {
                if (!doOnce)
                {
                    if (didWin)
                    {
                        // ac.PlaySFX(gc.ac.battleNoises[3]);
                        gc.opponents[gc.GetTwin(opponent._name)].isDefeated = true;
                        dh.DisplayBattleText("Battle over!\nYou didn't break down yet! :D ");

                        ac.SwitchSong(ac.hallwayMusic);
                        sc.WaitThenTransitionAndLoad("Hallway", 3f, 2);
                        doOnce = true;
                    }
                    else
                    {
                        // ac.PlaySFX(gc.ac.battleNoises[4]);
                        gc.opponents[gc.GetTwin(opponent._name)].isDefeated = true;
                        gc.playerLost = true;
                        player.playerHolder.SetActive(true);
                        dh.DisplayBattleText("Battle over!\n...You're highkey panicking.");

                        ac.SwitchSong(ac.hallwayMusic);
                        sc.WaitThenTransitionAndLoad("Hallway", 3f, 2);
                        doOnce = true;
                    }
                }
            }
        }
    }
Beispiel #2
0
    // Update is called once per frame
    void Update()
    {
        UpdateUI();


        if (bp > 20)
        {
            bp = 20;
        }
        else if (bp < 0)
        {
            bp = 0;
        }

        if (mp > 20)
        {
            mp = 20;
        }
        else if (mp < 0)
        {
            mp = 0;
        }

        if (waitForText)
        {
            if (!dh.isActive)
            {
                ch.ChangeCamAnim(0);
                waitForText = false;
            }
        }

        if (Input.GetKey(KeyCode.Alpha0))
        {
            if (Input.GetKeyDown(KeyCode.M))
            {
                BackToMainMenu();
            }
        }

        if (madeMove && !dh.isActive)
        {
            if (storedMove.onSelf)
            {
                dh.DisplayBattleText("You used " + storedMove._name + "!");
            }
            else
            {
                dh.DisplayBattleText("You used " + storedMove._name + " on " + bh.opponent._name);
            }

            EndPlayerTurn();
        }
    }