Exemple #1
0
        public async Task DamageAsync(IDamage damage)
        {
            if (IsImmune(damage.DamageType))
            {
                return;
            }
            var damageDealt = await damage.RollAsync();

            if (IsResistant(damage.DamageType))
            {
                damageDealt /= 2;
            }
            if (IsVulnerable(damage.DamageType))
            {
                damageDealt *= 2;
            }
            HitPoints.LoseHitPoints(damageDealt);
        }