diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java index 246e4628a..82cfee5a7 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/LloydsBeacon.java @@ -57,8 +57,8 @@ public class LloydsBeacon extends Artifact { public static final String AC_SET = "SET"; public static final String AC_RETURN = "RETURN"; - private int returnDepth = -1; - private int returnPos; + public int returnDepth = -1; + public int returnPos; { image = ItemSpriteSheet.ARTIFACT_BEACON; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java index 86dc146fc..918ac6b74 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DistortionTrap.java @@ -21,8 +21,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.traps; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings; import com.shatteredpixel.shatteredpixeldungeon.items.Item; -import com.shatteredpixel.shatteredpixeldungeon.items.keys.Key; +import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.LloydsBeacon; import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.TrapSprite; import com.watabou.noosa.Game; @@ -37,10 +38,12 @@ public class DistortionTrap extends Trap{ @Override public void activate() { InterlevelScene.returnDepth = Dungeon.depth; - for (Item item : Dungeon.hero.belongings.backpack.items.toArray( new Item[0])){ - if (item instanceof Key && ((Key)item).depth == Dungeon.depth){ - item.detachAll(Dungeon.hero.belongings.backpack); - } + Belongings belongings = Dungeon.hero.belongings; + belongings.ironKeys[Dungeon.depth] = 0; + belongings.specialKeys[Dungeon.depth] = 0; + for (Item i : belongings){ + if (i instanceof LloydsBeacon && ((LloydsBeacon) i).returnDepth == Dungeon.depth) + ((LloydsBeacon) i).returnDepth = -1; } InterlevelScene.mode = InterlevelScene.Mode.RESET; Game.switchScene(InterlevelScene.class);