From 23241a6af137858e3c677a6e46ed0ff79336d207 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 4 Jan 2021 16:23:35 -0500 Subject: [PATCH] v0.9.1b: fixed Tengu's adjusted bomb logic affecting all tiles --- .../actors/mobs/NewTengu.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java index cf4a8f83c..deb2c3edd 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewTengu.java @@ -590,25 +590,27 @@ public class NewTengu extends Mob { PathFinder.buildDistanceMap( bombPos, BArray.not( Dungeon.level.solid, null ), 2 ); for (int cell = 0; cell < PathFinder.distance.length; cell++) { - Char ch = Actor.findChar(cell); - if (ch != null && !(ch instanceof NewTengu)){ - int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth*2); - dmg -= ch.drRoll(); + if (PathFinder.distance[cell] < Integer.MAX_VALUE) { + Char ch = Actor.findChar(cell); + if (ch != null && !(ch instanceof NewTengu)) { + int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth * 2); + dmg -= ch.drRoll(); - if (dmg > 0) { - ch.damage(dmg, Bomb.class); + if (dmg > 0) { + ch.damage(dmg, Bomb.class); + } + + if (ch == Dungeon.hero && !ch.isAlive()) { + Dungeon.fail(NewTengu.class); + } } - if (ch == Dungeon.hero && !ch.isAlive()) { - Dungeon.fail(NewTengu.class); - } - } - - Heap h = Dungeon.level.heaps.get(cell); - if (h != null){ - for (Item i : h.items.toArray(new Item[0])){ - if (i instanceof BombItem){ - h.remove(i); + Heap h = Dungeon.level.heaps.get(cell); + if (h != null) { + for (Item i : h.items.toArray(new Item[0])) { + if (i instanceof BombItem) { + h.remove(i); + } } } }