v1.2.0: fixed snap freeze and icecap not clearing magical fire
This commit is contained in:
parent
218af3ceb8
commit
0c242c95b8
|
@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.BlobEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SnowParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.MagicalFireRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
|
||||||
public class Freezing extends Blob {
|
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
|
//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 );
|
Char ch = Actor.findChar( cell );
|
||||||
if (ch != null) {
|
if (ch != null) {
|
||||||
|
@ -109,10 +110,16 @@ public class Freezing extends Blob {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fire != null) {
|
Fire fire = (Fire) Dungeon.level.blobs.get(Fire.class);
|
||||||
|
if (fire != null && fire.volume > 0) {
|
||||||
fire.clear( cell );
|
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 );
|
Heap heap = Dungeon.level.heaps.get( cell );
|
||||||
if (heap != null) {
|
if (heap != null) {
|
||||||
heap.freeze();
|
heap.freeze();
|
||||||
|
|
|
@ -49,12 +49,10 @@ public class PotionOfSnapFreeze extends ExoticPotion {
|
||||||
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
Sample.INSTANCE.play( Assets.Sounds.SHATTER );
|
||||||
}
|
}
|
||||||
|
|
||||||
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
|
|
||||||
|
|
||||||
for (int offset : PathFinder.NEIGHBOURS9){
|
for (int offset : PathFinder.NEIGHBOURS9){
|
||||||
if (!Dungeon.level.solid[cell+offset]) {
|
if (!Dungeon.level.solid[cell+offset]) {
|
||||||
|
|
||||||
Freezing.affect( cell + offset, fire );
|
Freezing.affect( cell + offset );
|
||||||
|
|
||||||
Char ch = Actor.findChar( cell + offset);
|
Char ch = Actor.findChar( cell + offset);
|
||||||
if (ch != null){
|
if (ch != null){
|
||||||
|
|
|
@ -49,11 +49,9 @@ public class Icecap extends Plant {
|
||||||
|
|
||||||
PathFinder.buildDistanceMap( pos, BArray.not( Dungeon.level.losBlocking, null ), 1 );
|
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++) {
|
for (int i=0; i < PathFinder.distance.length; i++) {
|
||||||
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
|
||||||
Freezing.affect( i, fire );
|
Freezing.affect( i );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user