From 00bc4ef4730c646bd1fca8eb9f9b982131cadc68 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 5 Aug 2022 13:51:32 -0400 Subject: [PATCH] v1.4.0: fixed fireblast sometimes not igniting close heaps or barricades --- .../items/wands/WandOfFireblast.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java index 70d3310b9..c793fd628 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfFireblast.java @@ -88,9 +88,14 @@ public class WandOfFireblast extends DamageWand { GameScene.updateMap(cell); } - //only ignite cells directly near caster if they are flammable - if (Dungeon.level.adjacent(bolt.sourcePos, cell) && !Dungeon.level.flamable[cell]){ + //only ignite cells directly near caster if they are flammable or solid + if (Dungeon.level.adjacent(bolt.sourcePos, cell) + && !(Dungeon.level.flamable[cell] || Dungeon.level.solid[cell])){ adjacentCells.add(cell); + //do burn any heaps located here though + if (Dungeon.level.heaps.get(cell) != null){ + Dungeon.level.heaps.get(cell).burn(); + } } else { GameScene.add( Blob.seed( cell, 1+chargesPerCast(), Fire.class ) ); } @@ -101,11 +106,16 @@ public class WandOfFireblast extends DamageWand { } } - //ignite cells that share a side with an adjacent cell, are flammable, and are further from the source pos + //if wand was shot right at a wall + if (cone.cells.isEmpty()){ + adjacentCells.add(bolt.sourcePos); + } + + //ignite cells that share a side with an adjacent cell, are flammable, and are closer to the collision pos //This prevents short-range casts not igniting barricades or bookshelves for (int cell : adjacentCells){ - for (int i : PathFinder.NEIGHBOURS4){ - if (Dungeon.level.trueDistance(cell+i, bolt.sourcePos) > Dungeon.level.trueDistance(cell, bolt.sourcePos) + for (int i : PathFinder.NEIGHBOURS8){ + if (Dungeon.level.trueDistance(cell+i, bolt.collisionPos) < Dungeon.level.trueDistance(cell, bolt.collisionPos) && Dungeon.level.flamable[cell+i] && Fire.volumeAt(cell+i, Fire.class) == 0){ GameScene.add( Blob.seed( cell+i, 1+chargesPerCast(), Fire.class ) );