Ejemplo n.º 1
0
    private void OnHeroAttackComplete()
    {
        heroSelectionSpotlight.gameObject.SetActive(false);
        enemySelectionSpotlight.gameObject.SetActive(false);

        selectedHero.SpendTurn();

        if (enemyMiddle.IsDead() && enemyLeft.IsDead() && enemyRight.IsDead())
        {
            state = State.BattleEnded;
            bool haveHeroesWon = true;
            HandleBattleEnded(haveHeroesWon);
            return;
        }

        state = State.EnemiesTurn;
        if (!enemyMiddle.IsAvailableToAct() && !enemyLeft.IsAvailableToAct() && !enemyRight.IsAvailableToAct())
        {
            enemyMiddle.TryRefreshTurn();
            enemyLeft.TryRefreshTurn();
            enemyRight.TryRefreshTurn();
        }
    }
Ejemplo n.º 2
0
    private void OnEnemyAttackComplete(CharacterBattle attackingEnemy)
    {
        heroSelectionSpotlight.gameObject.SetActive(true);
        enemySelectionSpotlight.gameObject.SetActive(true);

        attackingEnemy.SpendTurn();

        if (heroMiddle.IsDead() && heroLeft.IsDead() && heroRight.IsDead())
        {
            state = State.BattleEnded;
            bool haveHeroesWon = false;
            HandleBattleEnded(haveHeroesWon);
            return;
        }

        state = State.HeroesTurn;
        if (!heroMiddle.IsAvailableToAct() && !heroLeft.IsAvailableToAct() && !heroRight.IsAvailableToAct())
        {
            heroMiddle.TryRefreshTurn();
            heroLeft.TryRefreshTurn();
            heroRight.TryRefreshTurn();
        }
        ChangeSelectedHeroUp();
    }
Ejemplo n.º 3
0
 private bool AttackIsPossible()
 {
     return(selectedHero.IsAvailableToAct() && !selectedEnemy.IsDead());
 }