From babc3f4dc8747e1baf74b58543c831fba5d99dbb Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 20 Jul 2017 21:42:11 -0400 Subject: [PATCH] v0.6.1: fixed well of health unintentionally not healing instantly --- .../actors/blobs/WaterOfHealth.java | 7 +++++-- .../items/potions/PotionOfHealing.java | 9 ++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java index 716b85288..bace7dec9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/WaterOfHealth.java @@ -44,8 +44,11 @@ public class WaterOfHealth extends WellWater { protected boolean affectHero( Hero hero ) { 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(); ((Hunger)hero.buff( Hunger.class )).satisfy( Hunger.STARVING ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java index 20b2b79a0..0e98d2bc9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/PotionOfHealing.java @@ -43,14 +43,13 @@ public class PotionOfHealing extends Potion { @Override public void apply( Hero hero ) { 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") ); } - public static void heal( 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); + public static void cure( Hero hero ) { Buff.detach( hero, Poison.class ); Buff.detach( hero, Cripple.class ); Buff.detach( hero, Weakness.class );