private DamageDistribution DeathTouchScenario() { var damageDistribution = new DamageDistribution(); var damageLeft = D._attacker.Card.CalculateCombatDamageAmount(); var blockers = D._attacker.Blockers.OrderByDescending(x => x.Score).ToList(); if (!D._attacker.AssignsDamageAsThoughItWasntBlocked) { foreach (var blocker in blockers) { if (damageLeft == 0) { break; } damageDistribution.Assign(blocker, 1); damageLeft--; } } AssignUnassignedDamage(blockers, damageLeft, damageDistribution); return(damageDistribution); }
protected override void ExecuteQuery() { var result = new DamageDistribution(); var dialog = Ui.Dialogs.CombatDamage.Create(D._attacker, result); Ui.Shell.ShowModalDialog(dialog); Result = result; }
private DamageDistribution DefaultScenario() { var damageDistribution = new DamageDistribution(); var damageLeft = D._attacker.Card.CalculateCombatDamageAmount(); var blockers = D._attacker.BlockersInDamageAssignmentOrder.ToList(); foreach (var blocker in blockers) { if (damageLeft == 0) { break; } var amount = damageLeft > blocker.LifepointsLeft ? blocker.LifepointsLeft : damageLeft; damageDistribution.Assign(blocker, amount); damageLeft -= amount; } AssignUnassignedDamage(blockers, damageLeft, damageDistribution); return(damageDistribution); }
private void AssignUnassignedDamage(List <Blocker> blockers, int damageLeft, DamageDistribution damageDistribution) { if (!(D._attacker.HasTrample || D._attacker.AssignsDamageAsThoughItWasntBlocked) && damageLeft > 0) { damageDistribution.Assign(blockers[0], damageLeft); } }
public MachineHandler() { Result = new DamageDistribution(); }