v0.2.4: potions of liquid flame now work in a 3x3 grid instead of 1x1, all potions now put out flames at the tile they are thrown.

This commit is contained in:
Evan Debenham
2015-02-15 05:09:50 -05:00
parent 1e5a6663be
commit 34d4c63a16
2 changed files with 34 additions and 9 deletions
@@ -20,6 +20,11 @@ package com.shatteredpixel.shatteredpixeldungeon.items.potions;
import java.util.ArrayList;
import java.util.HashSet;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning;
import com.watabou.noosa.audio.Sample;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
@@ -190,7 +195,7 @@ public class Potion extends Item {
hero.spend( TIME_TO_DRINK );
hero.busy();
onThrow( hero.pos );
apply( hero );
Sample.INSTANCE.play( Assets.SND_DRINK );
@@ -199,11 +204,7 @@ public class Potion extends Item {
@Override
protected void onThrow( int cell ) {
if (Dungeon.hero.pos == cell) {
apply( Dungeon.hero );
} else if (Dungeon.level.map[cell] == Terrain.WELL || Level.pit[cell]) {
if (Dungeon.level.map[cell] == Terrain.WELL || Level.pit[cell]) {
super.onThrow( cell );
@@ -291,10 +292,18 @@ public class Potion extends Item {
return handler.known().size() == potions.length;
}
protected void splash( int cell ) {
protected void splash( int cell ) {
final int color = ItemSprite.pick( image, 8, 10 );
Splash.at( cell, color, 5 );
}
Fire fire = (Fire)Dungeon.level.blobs.get( Fire.class );
if (fire != null)
fire.clear( cell );
Char ch = Actor.findChar(cell);
if (ch != null)
Buff.detach( ch, Burning.class );
}
@Override
public int price() {