v3.2.0: fixed shop rooms not generating thrown weapons properly

This commit is contained in:
Evan Debenham
2025-07-19 10:40:28 -04:00
parent fee32169c9
commit 744419f432

View File

@@ -52,6 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRemoveCurs
import com.shatteredpixel.shatteredpixeldungeon.items.spells.Alchemize;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
@@ -223,28 +224,29 @@ public class ShopRoom extends SpecialRoom {
ArrayList<Item> itemsToSpawn = new ArrayList<>();
MeleeWeapon w;
MissileWeapon m;
switch (Dungeon.depth) {
case 6: default:
w = (MeleeWeapon) Generator.random(Generator.wepTiers[1]);
itemsToSpawn.add( Generator.random(Generator.misTiers[1]).quantity(2).identify(false) );
m = (MissileWeapon) Generator.random(Generator.misTiers[1]);
itemsToSpawn.add( new LeatherArmor().identify(false) );
break;
case 11:
w = (MeleeWeapon) Generator.random(Generator.wepTiers[2]);
itemsToSpawn.add( Generator.random(Generator.misTiers[2]).quantity(2).identify(false) );
m = (MissileWeapon) Generator.random(Generator.misTiers[2]);
itemsToSpawn.add( new MailArmor().identify(false) );
break;
case 16:
w = (MeleeWeapon) Generator.random(Generator.wepTiers[3]);
itemsToSpawn.add( Generator.random(Generator.misTiers[3]).quantity(2).identify(false) );
m = (MissileWeapon) Generator.random(Generator.misTiers[3]);
itemsToSpawn.add( new ScaleArmor().identify(false) );
break;
case 20: case 21:
w = (MeleeWeapon) Generator.random(Generator.wepTiers[4]);
itemsToSpawn.add( Generator.random(Generator.misTiers[4]).quantity(2).identify(false) );
m = (MissileWeapon) Generator.random(Generator.misTiers[4]);
itemsToSpawn.add( new PlateArmor().identify(false) );
itemsToSpawn.add( new Torch() );
itemsToSpawn.add( new Torch() );
@@ -257,6 +259,12 @@ public class ShopRoom extends SpecialRoom {
w.identify(false);
itemsToSpawn.add(w);
m.enchant(null);
m.cursed = false;
m.level(0);
m.identify(false);
itemsToSpawn.add(m);
itemsToSpawn.add( TippedDart.randomTipped(2) );
itemsToSpawn.add( new Alchemize().quantity(Random.IntRange(2, 3)));