示例#1
0
            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);
            }
示例#2
0
            protected override void ExecuteQuery()
            {
                var result = new DamageDistribution();

                var dialog = Ui.Dialogs.CombatDamage.Create(D._attacker, result);

                Ui.Shell.ShowModalDialog(dialog);

                Result = result;
            }
示例#3
0
            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);
            }
示例#4
0
 private void AssignUnassignedDamage(List <Blocker> blockers, int damageLeft, DamageDistribution damageDistribution)
 {
     if (!(D._attacker.HasTrample || D._attacker.AssignsDamageAsThoughItWasntBlocked) && damageLeft > 0)
     {
         damageDistribution.Assign(blockers[0], damageLeft);
     }
 }
示例#5
0
 public MachineHandler()
 {
     Result = new DamageDistribution();
 }