Ejemplo n.º 1
0
    IEnumerator _heroAction()
    {
        Hero activeHero = battleOrder.ActiveHero(currentTurn);

        if (!activeHero.isDead)
        {
            switch (activeHero.allyOrEnemy)
            {
            case AllyOrEnemy.Ally:
                activeHero.Action(enemies);
                break;

            case AllyOrEnemy.Enemy:
                activeHero.Action(allies);
                break;
            }

            while (activeHero.heroState == HeroState.Attacking)
            {
                yield return(null);
            }
        }

        nextTurn();
        currentState = BattleState.HeroAction;

        if (!activeHero.isDead)
        {
            DamageCheck();
        }
    }