v0.7.4: fixed boomerangs being lost during the tengu fight

This commit is contained in:
Evan Debenham 2019-06-11 16:28:54 -04:00
parent 911f71e59e
commit 68764f802e
2 changed files with 19 additions and 3 deletions

View File

@ -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){

View File

@ -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)