From 213f7a2f6a05e67eb80196e37468d5fc47bdbb7f Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 15 Aug 2024 13:45:48 -0400 Subject: [PATCH] v2.5.0: various inventory management changes: - waterskin now fits in the potion bandolier - styli now fit in the scroll holder - dark floors no longer contain torches, +1 vision range - increased the rate that most enemy equip drops fade (also boosted base rate for DM-200 and Golems) - bombs no longer damage equipment - stones of intuition now always get 2 uses --- .../assets/messages/items/items.properties | 12 ++++--- .../actors/mobs/DM200.java | 8 ++--- .../actors/mobs/Golem.java | 8 ++--- .../actors/mobs/Guard.java | 6 ++-- .../actors/mobs/Skeleton.java | 6 ++-- .../actors/mobs/Slime.java | 6 ++-- .../items/Generator.java | 2 +- .../shatteredpixeldungeon/items/Heap.java | 8 ++--- .../items/bags/PotionBandolier.java | 3 +- .../items/bags/ScrollHolder.java | 4 ++- .../items/stones/StoneOfIntuition.java | 32 ++++++++++++------- .../shatteredpixeldungeon/levels/Level.java | 4 +-- 12 files changed, 54 insertions(+), 45 deletions(-) diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 9ac49ad6d..55d741a31 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -461,13 +461,13 @@ items.artifacts.unstablespellbook.read_empowered=The scroll you added to the spe items.bags.bag.name=backpack items.bags.potionbandolier.name=potion bandolier -items.bags.potionbandolier.desc=This thick bandolier fits around your chest like a sash, it has many insulated straps on it to hold potion vials.\n\nWhile inside the bandolier, your potions should be protected from the cold. +items.bags.potionbandolier.desc=This thick bandolier fits around your chest like a sash, it has many insulated straps on it to hold potion vials, your waterskin, or liquid metal vials.\n\nWhile inside the bandolier, your potions should be protected from the cold. items.bags.scrollholder.name=scroll holder -items.bags.scrollholder.desc=This tubular container looks like it would hold an astronomer's tools and charts, but your scrolls will fit just as well. There's even a few side compartments which would nicely fit your spell crystals and powders.\n\nThe holder doesn't look very flammable, so your scrolls should be safe from fire inside it. +items.bags.scrollholder.desc=This tubular container looks like it would hold an astronomer's tools and charts, but your scrolls will fit just as well. There's even a few side compartments which would nicely fit spell crystals, arcane styli, and arcane resin.\n\nThe holder doesn't look very flammable, so your scrolls should be safe from fire inside it. items.bags.velvetpouch.name=velvet pouch -items.bags.velvetpouch.desc=This small velvet pouch can store many small items in it, such as seeds and runestones. +items.bags.velvetpouch.desc=This small velvet pouch can store many small items in it, such as seeds, runestones, and some alchemy ingredients. items.bags.magicalholster.name=magical holster items.bags.magicalholster.desc=This slim holster is made from some exotic animal hide, and possesses powerful magic which lets it store a massive amount of ranged weapons.\n\nYou can simply reach into the bag and will always grab the item you were looking for.\n\nDue to the holster's magic, wands will charge slightly faster and thrown weapons will last slightly longer inside of it. @@ -1306,11 +1306,13 @@ items.stones.stoneofflock.desc=This runestone summons magical sheep for a short items.stones.stoneofintuition.name=stone of intuition items.stones.stoneofintuition.inv_title=Select an item -items.stones.stoneofintuition.desc=This runestone holds a weaker version of the magic found in scrolls of identification. Rather than directly identifying an item, it will work on your intuition, allowing you to attempt to identify the type of a potion, scroll, or ring by guessing. A correct guess will also preserve the magic in the stone, allowing it to be used a second time! +items.stones.stoneofintuition.desc=This runestone holds a weaker version of the magic found in scrolls of identification. Rather than directly identifying an item, it will work on your intuition, allowing you to attempt to identify the type of a potion, scroll, or ring by guessing. +items.stones.stoneofintuition.break_info=You can use stones of intuition twice before one breaks, _your next use won't consume a stone_. +items.stones.stoneofintuition.break_warn=You've used a stone of intuition previously, so _your next use will consume a stone_. items.stones.stoneofintuition$wndguess.text=Guess what the type of the unidentified item is. If you guess correctly, the type will be identified! items.stones.stoneofintuition$wndguess.correct=Correct. The item's type has been identified! -items.stones.stoneofintuition$wndguess.preserved=Your stone of intuition has been preserved! items.stones.stoneofintuition$wndguess.incorrect=Your guess was incorrect. +items.stones.stoneofintuition$wndguess.break=Your stone of intuition crumbles to dust... items.stones.stoneofshock.name=stone of shock items.stones.stoneofshock.desc=This runestone unleashes a blast of electrical energy which briefly stuns all nearby targets, and grants the thrower wand charge for each target hit. diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java index 4a7f31c6d..0fa3600f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/DM200.java @@ -47,7 +47,7 @@ public class DM200 extends Mob { maxLvl = 17; loot = Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR); - lootChance = 0.125f; //initially, see lootChance() + lootChance = 0.2f; //initially, see lootChance() properties.add(Property.INORGANIC); properties.add(Property.LARGE); @@ -72,9 +72,9 @@ public class DM200 extends Mob { @Override public float lootChance(){ - //each drop makes future drops 1/2 as likely - // so loot chance looks like: 1/8, 1/16, 1/32, 1/64, etc. - return super.lootChance() * (float)Math.pow(1/2f, Dungeon.LimitedDrops.DM200_EQUIP.count); + //each drop makes future drops 1/3 as likely + // so loot chance looks like: 1/5, 1/15, 1/45, 1/135, etc. + return super.lootChance() * (float)Math.pow(1/3f, Dungeon.LimitedDrops.DM200_EQUIP.count); } public Item createLoot() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java index 0c2e1dee0..3e0c516de 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Golem.java @@ -49,7 +49,7 @@ public class Golem extends Mob { maxLvl = 22; loot = Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR); - lootChance = 0.125f; //initially, see lootChance() + lootChance = 0.2f; //initially, see lootChance() properties.add(Property.INORGANIC); properties.add(Property.LARGE); @@ -75,9 +75,9 @@ public class Golem extends Mob { @Override public float lootChance() { - //each drop makes future drops 1/2 as likely - // so loot chance looks like: 1/8, 1/16, 1/32, 1/64, etc. - return super.lootChance() * (float)Math.pow(1/2f, Dungeon.LimitedDrops.GOLEM_EQUIP.count); + //each drop makes future drops 1/3 as likely + // so loot chance looks like: 1/5, 1/15, 1/45, 1/135, etc. + return super.lootChance() * (float)Math.pow(1/3f, Dungeon.LimitedDrops.GOLEM_EQUIP.count); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java index fe1b8625f..4647a34b2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Guard.java @@ -142,9 +142,9 @@ public class Guard extends Mob { @Override public float lootChance() { - //each drop makes future drops 1/2 as likely - // so loot chance looks like: 1/5, 1/10, 1/20, 1/40, etc. - return super.lootChance() * (float)Math.pow(1/2f, Dungeon.LimitedDrops.GUARD_ARM.count); + //each drop makes future drops 1/3 as likely + // so loot chance looks like: 1/5, 1/15, 1/45, 1/135, etc. + return super.lootChance() * (float)Math.pow(1/3f, Dungeon.LimitedDrops.GUARD_ARM.count); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java index 7f4e1dfcf..13bc06290 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Skeleton.java @@ -112,9 +112,9 @@ public class Skeleton extends Mob { @Override public float lootChance() { - //each drop makes future drops 1/2 as likely - // so loot chance looks like: 1/6, 1/12, 1/24, 1/48, etc. - return super.lootChance() * (float)Math.pow(1/2f, Dungeon.LimitedDrops.SKELE_WEP.count); + //each drop makes future drops 1/3 as likely + // so loot chance looks like: 1/6, 1/18, 1/54, 1/162, etc. + return super.lootChance() * (float)Math.pow(1/3f, Dungeon.LimitedDrops.SKELE_WEP.count); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java index e13e9240f..cdcf79200 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Slime.java @@ -68,9 +68,9 @@ public class Slime extends Mob { @Override public float lootChance(){ - //each drop makes future drops 1/3 as likely - // so loot chance looks like: 1/5, 1/15, 1/45, 1/135, etc. - return super.lootChance() * (float)Math.pow(1/3f, Dungeon.LimitedDrops.SLIME_WEP.count); + //each drop makes future drops 1/4 as likely + // so loot chance looks like: 1/5, 1/20, 1/80, 1/320, etc. + return super.lootChance() * (float)Math.pow(1/4f, Dungeon.LimitedDrops.SLIME_WEP.count); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index 0e60bb325..1fbbd6e7c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -283,7 +283,7 @@ public class Generator { static { subOrderings.put(Trinket.class, new ArrayList<>(Arrays.asList(Trinket.class, TrinketCatalyst.class))); subOrderings.put(MissileWeapon.class, new ArrayList<>(Arrays.asList(MissileWeapon.class, Bomb.class))); - subOrderings.put(Potion.class, new ArrayList<>(Arrays.asList(Potion.class, ExoticPotion.class, Brew.class, Elixir.class, LiquidMetal.class))); + subOrderings.put(Potion.class, new ArrayList<>(Arrays.asList(Waterskin.class, Potion.class, ExoticPotion.class, Brew.class, Elixir.class, LiquidMetal.class))); subOrderings.put(Scroll.class, new ArrayList<>(Arrays.asList(Scroll.class, ExoticScroll.class, Spell.class, ArcaneResin.class))); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java index 83bec2a8d..7ea41cc1d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/Heap.java @@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; -import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; @@ -275,8 +274,8 @@ public class Heap implements Bundlable { for (Item item : items.toArray( new Item[0] )) { - //unique items aren't affect by explosions - if (item.unique || (item instanceof Armor && ((Armor) item).checkSeal() != null)){ + //unique items and equipment aren't affect by explosions + if (item.unique || item.isUpgradable() || item instanceof EquipableItem){ continue; } @@ -296,8 +295,7 @@ public class Heap implements Bundlable { return; } - //upgraded items can endure the blast - } else if (item.level() <= 0) { + } else { items.remove( item ); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/PotionBandolier.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/PotionBandolier.java index e9a098f5a..1a316c3f8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/PotionBandolier.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/PotionBandolier.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.bags; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.LiquidMetal; +import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -34,7 +35,7 @@ public class PotionBandolier extends Bag { @Override public boolean canHold( Item item ) { - if (item instanceof Potion || item instanceof LiquidMetal){ + if (item instanceof Potion || item instanceof LiquidMetal || item instanceof Waterskin){ return super.canHold(item); } else { return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/ScrollHolder.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/ScrollHolder.java index b50110e44..9d178b29a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/ScrollHolder.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/bags/ScrollHolder.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.bags; import com.shatteredpixel.shatteredpixeldungeon.items.ArcaneResin; import com.shatteredpixel.shatteredpixeldungeon.items.Item; +import com.shatteredpixel.shatteredpixeldungeon.items.Stylus; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning; import com.shatteredpixel.shatteredpixeldungeon.items.spells.Spell; @@ -36,7 +37,8 @@ public class ScrollHolder extends Bag { @Override public boolean canHold( Item item ) { - if (item instanceof Scroll || item instanceof Spell || item instanceof ArcaneResin){ + if (item instanceof Scroll || item instanceof Spell + || item instanceof ArcaneResin || item instanceof Stylus){ return super.canHold(item); } else { return false; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java index b4951b128..1e9baaf6b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/stones/StoneOfIntuition.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.stones; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.effects.Identification; import com.shatteredpixel.shatteredpixeldungeon.items.Item; @@ -72,6 +73,19 @@ public class StoneOfIntuition extends InventoryStone { } + @Override + public String desc() { + String text = super.desc(); + if (Dungeon.hero != null){ + if (Dungeon.hero.buff(IntuitionUseTracker.class) == null){ + text += "\n\n" + Messages.get(this, "break_info"); + } else { + text += "\n\n" + Messages.get(this, "break_warn"); + } + } + return text; + } + public static class IntuitionUseTracker extends Buff {{ revivePersists = true; }}; private static Class curGuess = null; @@ -109,20 +123,14 @@ public class StoneOfIntuition extends InventoryStone { } GLog.p( Messages.get(WndGuess.class, "correct") ); curUser.sprite.parent.add( new Identification( curUser.sprite.center().offset( 0, -16 ) ) ); - - if (curUser.buff(IntuitionUseTracker.class) == null){ - GLog.h( Messages.get(WndGuess.class, "preserved") ); - Buff.affect(curUser, IntuitionUseTracker.class); - } else { - curItem.detach( curUser.belongings.backpack ); - curUser.buff(IntuitionUseTracker.class).detach(); - } + } else { + GLog.w( Messages.get(WndGuess.class, "incorrect") ); + } + if (curUser.buff(IntuitionUseTracker.class) == null){ + Buff.affect(curUser, IntuitionUseTracker.class); } else { curItem.detach( curUser.belongings.backpack ); - if (curUser.buff(IntuitionUseTracker.class) != null) { - curUser.buff(IntuitionUseTracker.class).detach(); - } - GLog.n( Messages.get(WndGuess.class, "incorrect") ); + curUser.buff(IntuitionUseTracker.class).detach(); } curGuess = null; hide(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 231a3f0f8..a8d10e9f3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -63,7 +63,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Stylus; -import com.shatteredpixel.shatteredpixeldungeon.items.Torch; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TalismanOfForesight; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; @@ -260,8 +259,7 @@ public abstract class Level implements Bundlable { break; case 3: feeling = Feeling.DARK; - addItemToSpawn(new Torch()); - viewDistance = Math.round(viewDistance/2f); + viewDistance = Math.round(5*viewDistance/8f); break; case 4: feeling = Feeling.LARGE;