From aa6baa035f4cc08a4270bf009e8f76afa59be82d Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 9 Nov 2017 02:40:59 -0500 Subject: [PATCH] v0.6.2b: fixed distortion traps not full clearing notes entries --- .../shatteredpixeldungeon/journal/Notes.java | 4 ++++ .../levels/traps/DistortionTrap.java | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java index d9acb961b..76567cbda 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Notes.java @@ -249,4 +249,8 @@ public class Notes { return filtered; } + public static void remove( Record rec ){ + records.remove(rec); + } + } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java index 9b5637e61..169f374a9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java @@ -25,9 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.GoldenKey; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; import com.shatteredpixel.shatteredpixeldungeon.journal.Notes; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.watabou.noosa.Game; @@ -43,8 +40,13 @@ public class DistortionTrap extends Trap{ public void activate() { InterlevelScene.returnDepth = Dungeon.depth; Belongings belongings = Dungeon.hero.belongings; - Notes.remove((Key) new IronKey(Dungeon.depth).quantity(99)); - Notes.remove((Key) new GoldenKey(Dungeon.depth).quantity(99)); + + for (Notes.Record rec : Notes.getRecords()){ + if (rec.depth() == Dungeon.depth){ + Notes.remove(rec); + } + } + for (Item i : belongings){ if (i instanceof LloydsBeacon && ((LloydsBeacon) i).returnDepth == Dungeon.depth) ((LloydsBeacon) i).returnDepth = -1;