Example #1
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);
     }
 }
Example #2
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);
            }
Example #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);
            }