Exemplo n.º 1
0
    IEnumerator BattleCycle()
    {
        yield return(liveEnemyParty.BattleStart());

        while (!liveEnemyParty.IsDead())
        {
            //act
            yield return(livePlayerParty.ChooseActions());

            yield return(liveEnemyParty.ChooseActions());

            //check if player party is dead
            if (livePlayerParty.IsDead())
            {
                if (liveEnemyParty.unfailable)
                {
                    break;
                }
                else
                {
                    yield return(MessageManager.ShowMessage("", "Everyone died..."));

                    SceneManager.LoadScene("gameover");
                }
            }
        }

        yield return(liveEnemyParty.BattleFinish());

        FinishBattle();
    }