v0.6.1: fixed well of health unintentionally not healing instantly

This commit is contained in:
Evan Debenham
2017-07-20 21:42:11 -04:00
committed by Evan Debenham
parent 49b81e0b86
commit babc3f4dc8
2 changed files with 9 additions and 7 deletions
@@ -44,8 +44,11 @@ public class WaterOfHealth extends WellWater {
protected boolean affectHero( Hero hero ) { protected boolean affectHero( Hero hero ) {
Sample.INSTANCE.play( Assets.SND_DRINK ); Sample.INSTANCE.play( Assets.SND_DRINK );
PotionOfHealing.heal( hero ); hero.HP = hero.HT;
hero.sprite.emitter().start( Speck.factory( Speck.HEALING ), 0.4f, 4 );
PotionOfHealing.cure( hero );
hero.belongings.uncurseEquipped(); hero.belongings.uncurseEquipped();
((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING ); ((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING );
@@ -43,14 +43,13 @@ public class PotionOfHealing extends Potion {
@Override @Override
public void apply( Hero hero ) { public void apply( Hero hero ) {
setKnown(); setKnown();
heal( Dungeon.hero ); //starts out healing 30 hp, equalizes with hero health total at level 11
Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.333f, 0);
cure( hero );
GLog.p( Messages.get(this, "heal") ); GLog.p( Messages.get(this, "heal") );
} }
public static void heal( Hero hero ) { public static void cure( Hero hero ) {
//starts out healing 30 hp, equalizes with hero health total at level 11
Buff.affect( hero, Healing.class ).setHeal((int)(0.8f*hero.HT + 14), 0.333f, 0);
Buff.detach( hero, Poison.class ); Buff.detach( hero, Poison.class );
Buff.detach( hero, Cripple.class ); Buff.detach( hero, Cripple.class );
Buff.detach( hero, Weakness.class ); Buff.detach( hero, Weakness.class );