示例#1
0
    public override int TakeDamage(Vector2Int locationOfAttack, int amount)
    {
        int oldHealth = Health.CurrentHealth;

        Animation.GetHit(locationOfAttack);
        BattleManager.cardResolveStack.AddDamageDealt(amount);
        Health.TakeDamage(amount);
        int damageDealt = oldHealth - Health.CurrentHealth;

        BattleManager.cardResolveStack.AddDamageDealt(damageDealt);
        EnemyUI.UpdateHealthBar(Health);
        if (Health.IsDead)
        {
            Eliminate(); // KO'd
        }
        else
        {
            EnemyUI.FadeHealthBar();
        }
        return(damageDealt);
    }