v0.2.4: made potions susceptible to cold, refactored a bit of buff logic.

This commit is contained in:
Evan Debenham
2015-02-10 02:09:57 -05:00
parent ae2ba8be0e
commit 72975a49cc
9 changed files with 101 additions and 61 deletions
@@ -35,22 +35,25 @@ public class PotionOfFrost extends Potion {
}
@Override
protected void shatter( int cell ) {
public void shatter( int cell ) {
PathFinder.buildDistanceMap( cell, BArray.not( Level.losBlocking, null ), DISTANCE );
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
boolean visible = false;
for (int i=0; i < Level.LENGTH; i++) {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
Freezing.affect( i, fire );
visible = Freezing.affect( i, fire ) || visible;
}
}
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
setKnown();
if (visible) {
splash( cell );
Sample.INSTANCE.play( Assets.SND_SHATTER );
setKnown();
}
}
@Override