diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/HeavyBoomerang.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/HeavyBoomerang.java index c4e2019bc..eb6b52f48 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/HeavyBoomerang.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/HeavyBoomerang.java @@ -77,6 +77,15 @@ public class HeavyBoomerang extends MissileWeapon { left = 3; } + public int returnPos(){ + return returnPos; + } + + public MissileWeapon cancel(){ + detach(); + return boomerang; + } + @Override public boolean act() { if (returnDepth == Dungeon.depth){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java index 535a3a186..edea91af7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/PrisonBossLevel.java @@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Tengu; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.HeavyBoomerang; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.MazeRoom; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EmptyRoom; @@ -276,12 +277,18 @@ public class PrisonBossLevel extends Level { private void clearEntities(Room safeArea){ for (Heap heap : heaps.values()){ if (safeArea == null || !safeArea.inside(cellToPoint(heap.pos))){ - for (Item item : heap.items) - storedItems.add(item); + storedItems.addAll(heap.items); heap.destroy(); } } - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[Dungeon.level.mobs.size()])){ + + for (HeavyBoomerang.CircleBack b : Dungeon.hero.buffs(HeavyBoomerang.CircleBack.class)){ + if (safeArea == null || !safeArea.inside(cellToPoint(b.returnPos()))){ + storedItems.add(b.cancel()); + } + } + + for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])){ if (mob != tengu && (safeArea == null || !safeArea.inside(cellToPoint(mob.pos)))){ mob.destroy(); if (mob.sprite != null)