예제 #1
0
    protected virtual IEnumerator DealDamageAfterTime(int damage, float currentDelay, TokenManager enemyToBeAttacked)
    {
        BattleManager.instance.remainingActions++;

        yield return(new WaitForSeconds(currentDelay + 0.75f));

        if (enemyToBeAttacked != null)
        {
            enemyToBeAttacked.TakeDamage(damage, true, this);
            if (myCard.cardType == CardType.Creature)
            {
                if (myCreatureCard.attacksPoison)
                {
                    enemyToBeAttacked.AddBuff(StatType.Poison, myCreatureCard.poisonDamagePerTurn, myCreatureCard.poisionTurnLength);
                }
            }
            actionRemaining = false;
            if (attackSound != null)
            {
                SoundsManager.instance.PlayGivenSound(attackSound);
            }
            else
            {
                SoundsManager.instance.PlayAttackSound();
            }
        }
        BattleManager.instance.remainingActions--;
    }