Example #1
0
        public void TestRangedWeaponAttack()
        {
            RangedWeapon longBow = new RangedWeapon()
            {
                Name           = "Longbow"
                , WeaponType   = "Martial Ranged",
                AmmunitionType = "Arrow",
                CloseRange     = 150,
                MaxRange       = 600,
                Cost           = new CoinPurse()
                {
                    Gold = 50
                },
                Weight     = 2,
                Properties = new [] { "heavy", "two-handed" }
            };

            longBow.WeaponDamages.Add(new Damage()
            {
                DefaultDamage  = 4,
                QuantityOfDice = 2,
                SidesOfDice    = 8,
                DamageType     = "piercing"
            });
            Ammunition basicArrows = new Ammunition()
            {
                AmmunitionType = "Arrow",
                Name           = "Basic Arrows",
                Quantity       = 20
            };
            DamageRealized attack = longBow.WeaponHit(ref basicArrows);

            Console.WriteLine(attack.DamageDescription);
            Assert.AreEqual(19, basicArrows.Quantity);
        }