v1.2.0: fixed snap freeze and icecap not clearing magical fire

This commit is contained in:
Evan Debenham 2022-03-21 23:56:19 -04:00
parent 218af3ceb8
commit 0c242c95b8
3 changed files with 13 additions and 10 deletions

View File

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

View File

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

View File

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