v0.9.1b: fixed Tengu's adjusted bomb logic affecting all tiles

This commit is contained in:
Evan Debenham
2021-01-04 16:23:35 -05:00
parent d89533b9de
commit 23241a6af1
@@ -590,9 +590,10 @@ public class NewTengu extends Mob {
PathFinder.buildDistanceMap( bombPos, BArray.not( Dungeon.level.solid, null ), 2 ); PathFinder.buildDistanceMap( bombPos, BArray.not( Dungeon.level.solid, null ), 2 );
for (int cell = 0; cell < PathFinder.distance.length; cell++) { for (int cell = 0; cell < PathFinder.distance.length; cell++) {
if (PathFinder.distance[cell] < Integer.MAX_VALUE) {
Char ch = Actor.findChar(cell); Char ch = Actor.findChar(cell);
if (ch != null && !(ch instanceof NewTengu)){ if (ch != null && !(ch instanceof NewTengu)) {
int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth*2); int dmg = Random.NormalIntRange(5 + Dungeon.depth, 10 + Dungeon.depth * 2);
dmg -= ch.drRoll(); dmg -= ch.drRoll();
if (dmg > 0) { if (dmg > 0) {
@@ -605,13 +606,14 @@ public class NewTengu extends Mob {
} }
Heap h = Dungeon.level.heaps.get(cell); Heap h = Dungeon.level.heaps.get(cell);
if (h != null){ if (h != null) {
for (Item i : h.items.toArray(new Item[0])){ for (Item i : h.items.toArray(new Item[0])) {
if (i instanceof BombItem){ if (i instanceof BombItem) {
h.remove(i); h.remove(i);
} }
} }
} }
}
} }
Sample.INSTANCE.play(Assets.Sounds.BLAST); Sample.INSTANCE.play(Assets.Sounds.BLAST);