From 0c242c95b87909cc8d1723b23274d9079ba42cee Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 21 Mar 2022 23:56:19 -0400 Subject: [PATCH] v1.2.0: fixed snap freeze and icecap not clearing magical fire --- .../actors/blobs/Freezing.java | 13 ++++++++++--- .../items/potions/exotic/PotionOfSnapFreeze.java | 4 +--- .../shatteredpixeldungeon/plants/Icecap.java | 6 ++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java index 1f969237c..0068e04d2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Freezing.java @@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; +import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.MagicalFireRoom; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; public class Freezing extends Blob { @@ -98,7 +99,7 @@ public class Freezing extends Blob { } //legacy functionality from before this was a proper blob. Returns true if this cell is visible - public static boolean affect( int cell, Fire fire ) { + public static boolean affect( int cell ) { Char ch = Actor.findChar( cell ); if (ch != null) { @@ -108,10 +109,16 @@ public class Freezing extends Blob { Buff.prolong(ch, Frost.class, Frost.DURATION); } } - - if (fire != null) { + + Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class); + if (fire != null && fire.volume > 0) { fire.clear( cell ); } + + MagicalFireRoom.EternalFire eternalFire = (MagicalFireRoom.EternalFire)Dungeon.level.blobs.get(MagicalFireRoom.EternalFire.class); + if (eternalFire != null && eternalFire.volume > 0) { + eternalFire.clear( cell ); + } Heap heap = Dungeon.level.heaps.get( cell ); if (heap != null) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java index 368c33429..77774c236 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/exotic/PotionOfSnapFreeze.java @@ -49,12 +49,10 @@ public class PotionOfSnapFreeze extends ExoticPotion { Sample.INSTANCE.play( Assets.Sounds.SHATTER ); } - Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); - for (int offset : PathFinder.NEIGHBOURS9){ if (!Dungeon.level.solid[cell+offset]) { - Freezing.affect( cell + offset, fire ); + Freezing.affect( cell + offset ); Char ch = Actor.findChar( cell + offset); if (ch != null){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java index 7c5fd01f0..945ac9cfb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Icecap.java @@ -48,12 +48,10 @@ public class Icecap extends Plant { } PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 ); - - Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class ); - + for (int i=0; i < PathFinder.distance.length; i++) { if (PathFinder.distance[i] < Integer.MAX_VALUE) { - Freezing.affect( i, fire ); + Freezing.affect( i ); } } }