Exemple #1
0
        public void TestWeaponCreation()
        {
            var weapon = new Weapon();

            Assert.IsInstanceOfType(weapon, typeof(Item));
        }
Exemple #2
0
        private static Weapon CreateWeapon()
        {
            var random = new Random();
            var weapon = new Weapon();

            weapon.WeaponDamage = random.Next(1, 11);
            weapon.Agility = random.Next(1, 11);
            weapon.Intellect = random.Next(1, 11);
            weapon.Stamina = random.Next(1, 11);
            weapon.Strength = random.Next(1, 11);

            var weaponType = random.Next(1, 5);

            switch (weaponType)
            {
                case 1:
                    weapon.WeaponType = WeaponTypes.Sword;
                    weapon.Name = "Sword";
                    weapon.Description = "You can chop off heads now!";
                    break;
                case 2:
                    weapon.WeaponType = WeaponTypes.Staff;
                    weapon.Name = "Staff";
                    weapon.Description = "Will make you a bit wiser!";
                    break;
                case 3:
                    weapon.WeaponType = WeaponTypes.Dagger;
                    weapon.Name = "Dagger";
                    weapon.Description = "You can cook with this one!";
                    break;
                case 4:
                    weapon.WeaponType = WeaponTypes.Bow;
                    weapon.Name = "Bow";
                    weapon.Description = "You can shoot out in a distance!";
                    break;
                default:
                    weapon.WeaponType = WeaponTypes.Unarmed;
                    weapon.Name = "Fists";
                    weapon.Description = "Did somebody order a Knuckle Sandwich?";
                    break;
            }

            return weapon;
        }