From 651c02410fbab4211cace34497f5c437e59f2c5c Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 2 Aug 2018 19:31:28 -0400 Subject: [PATCH] v0.7.0: various fixes: - searching incrementing hunger while floor is locked - scrolls of mystical energy not resetting recharge buff - sheep-ified shopkeepers not losing their stock - unstable spellbook going to -1 charges - typo in potion of cleansing desc --- .../actors/buffs/ArtifactRecharge.java | 4 ++++ .../shatteredpixeldungeon/actors/hero/Hero.java | 12 +++++++----- .../actors/mobs/npcs/Shopkeeper.java | 14 +++++++++----- .../items/artifacts/UnstableSpellbook.java | 4 ++-- .../scrolls/exotic/ScrollOfMysticalEnergy.java | 2 +- .../messages/items/items.properties | 4 ++-- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java index 74145142a..dfbb40916 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ArtifactRecharge.java @@ -62,6 +62,10 @@ public class ArtifactRecharge extends Buff { return true; } + public void reset(){ + left = 30; + } + @Override public int icon() { return BuffIndicator.RECHARGING; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index d2d0758c0..7eb740455 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -1583,11 +1583,13 @@ public class Hero extends Char { if (intentional) { sprite.showStatus( CharSprite.DEFAULT, Messages.get(this, "search") ); sprite.operate( pos ); - if (cursed){ - GLog.n(Messages.get(this, "search_distracted")); - buff(Hunger.class).reduceHunger(TIME_TO_SEARCH - (2*HUNGER_FOR_SEARCH)); - } else { - buff(Hunger.class).reduceHunger(TIME_TO_SEARCH - HUNGER_FOR_SEARCH); + if (!Dungeon.level.locked) { + if (cursed) { + GLog.n(Messages.get(this, "search_distracted")); + buff(Hunger.class).reduceHunger(TIME_TO_SEARCH - (2 * HUNGER_FOR_SEARCH)); + } else { + buff(Hunger.class).reduceHunger(TIME_TO_SEARCH - HUNGER_FOR_SEARCH); + } } spendAndNext(TIME_TO_SEARCH); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java index 04a92a66a..ab6b28120 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/Shopkeeper.java @@ -62,17 +62,21 @@ public class Shopkeeper extends NPC { } public void flee() { + destroy(); + + sprite.killAndErase(); + CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 ); + } + + @Override + public void destroy() { + super.destroy(); for (Heap heap: Dungeon.level.heaps.values()) { if (heap.type == Heap.Type.FOR_SALE) { CellEmitter.get( heap.pos ).burst( ElmoParticle.FACTORY, 4 ); heap.destroy(); } } - - destroy(); - - sprite.killAndErase(); - CellEmitter.get( pos ).burst( ElmoParticle.FACTORY, 6 ); } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java index 35380fd04..0154c21f3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/UnstableSpellbook.java @@ -127,8 +127,8 @@ public class UnstableSpellbook extends Artifact { curItem = scroll; curUser = hero; - //if this scroll hasn't been given to the book - if (!scrolls.contains(scroll.getClass())) { + //if there are changes left and the scroll has been given to the book + if (charge > 0 && !scrolls.contains(scroll.getClass())) { final Scroll fScroll = scroll; GameScene.show(new WndOptions( Messages.get(this, "prompt"), diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java index 656c518e6..5cf629099 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/scrolls/exotic/ScrollOfMysticalEnergy.java @@ -39,7 +39,7 @@ public class ScrollOfMysticalEnergy extends ExoticScroll { public void doRead() { //append buff - Buff.affect(curUser, ArtifactRecharge.class); + Buff.affect(curUser, ArtifactRecharge.class).reset(); Sample.INSTANCE.play( Assets.SND_READ ); Invisibility.dispel(); diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 3a761f707..8f176f786 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -322,7 +322,7 @@ items.artifacts.unstablespellbook.unknown_scroll=You're not sure what type of sc items.artifacts.unstablespellbook.desc=This Tome is in surprising good condition given its age. It fizzes and crackles as you move the pages, surging with unstable energy. If you read from this book, there's no telling what spell you might cast. items.artifacts.unstablespellbook.desc_cursed=The cursed book has bound itself to you, it is inhibiting your ability to use most scrolls. items.artifacts.unstablespellbook.desc_index=The book is incomplete. Its index is currently pointing to the following blank pages: -items.artifacts.unstablespellbook.desc_empowered=The scrolls that you've added to the book are glowing with power. Their magic seems stronger than it was before they were placed in the book. +items.artifacts.unstablespellbook.desc_empowered=The scrolls that you've added to the book are glowing with power. You will be able to choose the exotic version of these scroll's effects, but at the cost of an additional charge. items.artifacts.unstablespellbook.read_empowered=The scroll you added to the spellbook surges with energy. You are able to channel either the regular, or exotic version of this scroll's effect.\n\nChoosing the exotic variant will cost 2 charges instead of 1. @@ -562,7 +562,7 @@ items.potions.exotic.potionofadrenalinesurge.name=potion of adrenaline surge items.potions.exotic.potionofadrenalinesurge.desc=This powerful liquid will give you a greater boost of strength that withers after an extended period of time. items.potions.exotic.potionofcleansing.name=potion of cleansing -items.potions.exotic.potionofcleansing.desc=This power reagent will completely neutralize all harmful effects on the drinker when quaffed. It can be thrown at a target to cleanse them as well. +items.potions.exotic.potionofcleansing.desc=This powerful reagent will completely neutralize all harmful effects on the drinker when quaffed. It can be thrown at a target to cleanse them as well. items.potions.exotic.potionofcorrosivegas.name=potion of corrosive gas items.potions.exotic.potionofcorrosivegas.desc=Uncorking or shattering this pressurized glass will cause its contents to explode into a deadly cloud of corrosive rust-colored gas. The gas is less concentrated however, and will not last for very long.