From bdfe5f7c3cdb640fd7d0654f2f3345d60e81a9e6 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 16 Jan 2020 02:59:35 -0500 Subject: [PATCH] v0.8.0: adjusted the types of weapons shops can stock --- .../levels/rooms/special/ShopRoom.java | 50 ++++++------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java index 1e7741ef7..5a89eb66c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/ShopRoom.java @@ -50,22 +50,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurse; import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.BattleAxe; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Greatsword; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.HandAxe; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Longsword; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Mace; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Shortsword; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sword; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WarHammer; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.FishingSpear; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Javelin; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Kunai; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingClub; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingHammer; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingSpear; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Tomahawk; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Trident; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; @@ -162,43 +147,40 @@ public class ShopRoom extends SpecialRoom { protected static ArrayList generateItems() { ArrayList itemsToSpawn = new ArrayList<>(); - + + MeleeWeapon w; switch (Dungeon.depth) { - case 6: - itemsToSpawn.add( (Random.Int( 2 ) == 0 ? new Shortsword().identify() : new HandAxe()).identify() ); - itemsToSpawn.add( Random.Int( 2 ) == 0 ? - new FishingSpear().quantity(2) : - new ThrowingClub().quantity(2)); + case 6: default: + w = (MeleeWeapon) Generator.random(Generator.wepTiers[1]); + itemsToSpawn.add( Generator.random(Generator.misTiers[1]).quantity(2).identify() ); itemsToSpawn.add( new LeatherArmor().identify() ); break; case 11: - itemsToSpawn.add( (Random.Int( 2 ) == 0 ? new Sword().identify() : new Mace()).identify() ); - itemsToSpawn.add( Random.Int( 2 ) == 0 ? - new ThrowingSpear().quantity(2) : - new Kunai().quantity(2)); + w = (MeleeWeapon) Generator.random(Generator.wepTiers[2]); + itemsToSpawn.add( Generator.random(Generator.misTiers[2]).quantity(2).identify() ); itemsToSpawn.add( new MailArmor().identify() ); break; case 16: - itemsToSpawn.add( (Random.Int( 2 ) == 0 ? new Longsword().identify() : new BattleAxe()).identify() ); - itemsToSpawn.add( Random.Int( 2 ) == 0 ? - new Javelin().quantity(2) : - new Tomahawk().quantity(2)); + w = (MeleeWeapon) Generator.random(Generator.wepTiers[3]); + itemsToSpawn.add( Generator.random(Generator.misTiers[3]).quantity(2).identify() ); itemsToSpawn.add( new ScaleArmor().identify() ); break; case 21: - itemsToSpawn.add( Random.Int( 2 ) == 0 ? new Greatsword().identify() : new WarHammer().identify() ); - itemsToSpawn.add( Random.Int(2) == 0 ? - new Trident().quantity(2) : - new ThrowingHammer().quantity(2)); + w = (MeleeWeapon) Generator.random(Generator.wepTiers[4]); + itemsToSpawn.add( Generator.random(Generator.misTiers[4]).quantity(2).identify() ); itemsToSpawn.add( new PlateArmor().identify() ); itemsToSpawn.add( new Torch() ); itemsToSpawn.add( new Torch() ); itemsToSpawn.add( new Torch() ); break; } + w.enchant(null); + w.level(0); + w.identify(); + itemsToSpawn.add(w); itemsToSpawn.add( TippedDart.randomTipped(2) );