示例#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);
        }
示例#2
0
        public async Task Heal(IDice damageRoll)
        {
            var healingDone = await damageRoll.GetTotalRollAsync();

            HitPoints.GainHitPoints(healingDone);
        }