public void ShouldReturnCorrectName()
        {
            //arrange
            AllArmor        allArmor        = new AllArmor();
            AllShields      allShields      = new AllShields();
            Battleaxe       battleaxe       = new Battleaxe();
            BrewersSupplies brewersSupplies = new BrewersSupplies();
            Dagger          dagger          = new Dagger();
            Darts           darts           = new Darts();
            Handaxe         handaxe         = new Handaxe();
            LightArmor      lightArmor      = new LightArmor();
            LightCrossbow   lightCrossbow   = new LightCrossbow();
            Longbow         longbow         = new Longbow();
            Longsword       longsword       = new Longsword();
            MartialWeapons  martialWeapons  = new MartialWeapons();
            MasonsTools     masonsTools     = new MasonsTools();
            MediumArmor     mediumArmor     = new MediumArmor();
            Quarterstaff    quarterstaff    = new Quarterstaff();
            Shortbow        shortbow        = new Shortbow();
            Shortsword      shortsword      = new Shortsword();
            SimpleWeapons   simpleWeapons   = new SimpleWeapons();
            Sling           sling           = new Sling();
            SmithsTools     smithsTools     = new SmithsTools();
            ThrowingHammer  throwingHammer  = new ThrowingHammer();
            Warhammer       warhammer       = new Warhammer();

            //assert
            allArmor.Name().Should().Be(new TextObj("All Armor"));
            allShields.Name().Should().Be(new TextObj("All Shields"));
            battleaxe.Name().Should().Be(new TextObj("Battleaxe"));
            brewersSupplies.Name().Should().Be(new TextObj("Brewer's Supplies"));
            dagger.Name().Should().Be(new TextObj("Dagger"));
            darts.Name().Should().Be(new TextObj("Darts"));
            handaxe.Name().Should().Be(new TextObj("Handaxe"));
            lightArmor.Name().Should().Be(new TextObj("Light Armor"));
            lightCrossbow.Name().Should().Be(new TextObj("Light Crossbow"));
            longbow.Name().Should().Be(new TextObj("Longbow"));
            longsword.Name().Should().Be(new TextObj("Longsword"));
            martialWeapons.Name().Should().Be(new TextObj("Martial Weapons"));
            masonsTools.Name().Should().Be(new TextObj("Mason's Tools"));
            mediumArmor.Name().Should().Be(new TextObj("Medium Armor"));
            quarterstaff.Name().Should().Be(new TextObj("Quarterstaff"));
            shortbow.Name().Should().Be(new TextObj("Shortbow"));
            shortsword.Name().Should().Be(new TextObj("Shortsword"));
            simpleWeapons.Name().Should().Be(new TextObj("Simple Weapons"));
            sling.Name().Should().Be(new TextObj("Sling"));
            smithsTools.Name().Should().Be(new TextObj("Smith's Tools"));
            throwingHammer.Name().Should().Be(new TextObj("Throwing Hammer"));
            warhammer.Name().Should().Be(new TextObj("Warhammer"));
        }
Exemplo n.º 2
0
        private static Item[] Range()
        {
            var items = new List <Item>();

            switch (Dungeon.Depth)
            {
            case 6:
                Item item;
                if (Random.Int(2) == 0)
                {
                    item = new Quarterstaff();
                }
                else
                {
                    item = new Spear();
                }
                items.Add(item.Identify());
                items.Add(new LeatherArmor().Identify());
                items.Add(new SeedPouch());
                items.Add(new Weightstone());
                break;

            case 11:
                Item item1;
                if (Random.Int(2) == 0)
                {
                    item1 = new Sword();
                }
                else
                {
                    item1 = new Mace();
                }
                items.Add(item1.Identify());
                items.Add(new MailArmor().Identify());
                items.Add(new ScrollHolder());
                items.Add(new Weightstone());
                break;

            case 16:
                Item item3;
                if (Random.Int(2) == 0)
                {
                    item3 = new Longsword();
                }
                else
                {
                    item3 = new BattleAxe();
                }
                items.Add(item3.Identify());
                items.Add(new ScaleArmor().Identify());
                items.Add(new WandHolster());
                items.Add(new Weightstone());
                break;

            case 21:
                switch (Random.Int(3))
                {
                case 0:
                    items.Add(new Glaive().Identify());
                    break;

                case 1:
                    items.Add(new WarHammer().Identify());
                    break;

                case 2:
                    items.Add(new PlateArmor().Identify());
                    break;
                }
                items.Add(new Torch());
                items.Add(new Torch());
                break;
            }

            items.Add(new PotionOfHealing());
            for (var i = 0; i < 3; i++)
            {
                items.Add(Generator.Random(Generator.Category.POTION));
            }

            items.Add(new ScrollOfIdentify());
            items.Add(new ScrollOfRemoveCurse());
            items.Add(new ScrollOfMagicMapping());
            items.Add(Generator.Random(Generator.Category.SCROLL));

            items.Add(new OverpricedRation());
            items.Add(new OverpricedRation());

            items.Add(new Ankh());

            var range = items.ToArray();

            Random.Shuffle(range);

            return(range);
        }
Exemplo n.º 3
0
        private MeleeWeapon ChangeWeapon(MeleeWeapon w)
        {
            MeleeWeapon n = null;

            if (w is Knuckles)
            {
                n = new Dagger();
            }
            else if (w is Dagger)
            {
                n = new Knuckles();
            }
            else if (w is Spear)
            {
                n = new Quarterstaff();
            }
            else if (w is Quarterstaff)
            {
                n = new Spear();
            }
            else if (w is Sword)
            {
                n = new Mace();
            }
            else if (w is Mace)
            {
                n = new Sword();
            }
            else if (w is Longsword)
            {
                n = new BattleAxe();
            }
            else if (w is BattleAxe)
            {
                n = new Longsword();
            }
            else if (w is Glaive)
            {
                n = new WarHammer();
            }
            else if (w is WarHammer)
            {
                n = new Glaive();
            }

            if (n == null)
            {
                return(null);
            }

            var level = w.level;

            if (level > 0)
            {
                n.Upgrade(level);
            }
            else if (level < 0)
            {
                n.Degrade(-level);
            }

            if (w.IsEnchanted)
            {
                n.Enchant(Weapon.Enchantment.Random());
            }

            n.levelKnown  = w.levelKnown;
            n.cursedKnown = w.cursedKnown;
            n.cursed      = w.cursed;

            Journal.Remove(Journal.Feature.WELL_OF_TRANSMUTATION);

            return(n);
        }