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); }
public async Task Heal(IDice damageRoll) { var healingDone = await damageRoll.GetTotalRollAsync(); HitPoints.GainHitPoints(healingDone); }