diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java index 4d2d14f78..082740154 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Healing.java @@ -59,6 +59,9 @@ public class Healing extends Buff { healingLeft -= healingThisTick(); if (healingLeft <= 0){ + if (target instanceof Hero) { + ((Hero) target).resting = false; + } detach(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java index d7f6c0899..359b9ae3b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/WellFed.java @@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; @@ -43,10 +44,17 @@ public class WellFed extends Buff { left --; if (left < 0){ detach(); + if (target instanceof Hero) { + ((Hero) target).resting = false; + } return true; - } else if (left % 18 == 0){ - target.HP = Math.min(target.HT, target.HP + 1); + } else if (left % 18 == 0 && target.HP < target.HT){ + target.HP += 1; target.sprite.showStatusWithIcon(CharSprite.POSITIVE, "1", FloatingText.HEALING); + + if (target.HP == target.HT && target instanceof Hero) { + ((Hero) target).resting = false; + } } spend(TICK); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java index c5b6cd406..905c6dfe0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/ChaliceOfBlood.java @@ -168,9 +168,13 @@ public class ChaliceOfBlood extends Artifact { if (Random.Float() < heal%1){ heal++; } - if (heal >= 1f) { + if (heal >= 1f && target.HP < target.HT) { target.HP = Math.min(target.HT, target.HP + (int)heal); target.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString((int)heal), FloatingText.HEALING); + + if (target.HP == target.HT && target instanceof Hero) { + ((Hero) target).resting = false; + } } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java index adb8761ac..176880632 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/DriedRose.java @@ -310,7 +310,7 @@ public class DriedRose extends Artifact { } updateQuickslot(); } - } else { + } else if (ghost.HP < ghost.HT) { int heal = Math.round((1 + level()/3f)*amount); ghost.HP = Math.min( ghost.HT, ghost.HP + heal); ghost.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(heal), FloatingText.HEALING); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java index 7294c1d95..2a13b76f2 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java @@ -83,14 +83,24 @@ public class ElixirOfAquaticRejuvenation extends Elixir { } else { healAmt = (float)Math.floor(healAmt); } - target.HP += healAmt; - left -= healAmt; + target.HP += (int)healAmt; + left -= (int)healAmt; target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - target.sprite.showStatusWithIcon( CharSprite.POSITIVE, "1", FloatingText.HEALING ); + target.sprite.showStatusWithIcon( CharSprite.POSITIVE, Integer.toString((int)healAmt), FloatingText.HEALING ); + + if (target.HP >= target.HT) { + target.HP = target.HT; + if (target instanceof Hero) { + ((Hero) target).resting = false; + } + } } if (left <= 0){ detach(); + if (target instanceof Hero) { + ((Hero) target).resting = false; + } } else { spend(TICK); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java index 54e46d465..35b9647bc 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java @@ -92,15 +92,20 @@ public class Sungrass extends Plant { partialHeal += (40 + target.HT)/150f; if (partialHeal > 1){ - target.HP += (int)partialHeal; - level -= (int)partialHeal; - partialHeal -= (int)partialHeal; - target.sprite.showStatusWithIcon(CharSprite.POSITIVE, "1", FloatingText.HEALING); - - if (target.HP >= target.HT) { - target.HP = target.HT; - if (target instanceof Hero){ - ((Hero)target).resting = false; + int healThisTurn = (int)partialHeal; + partialHeal -= healThisTurn; + level -= healThisTurn; + + if (target.HP < target.HT) { + + target.HP += healThisTurn; + target.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(healThisTurn), FloatingText.HEALING); + + if (target.HP >= target.HT) { + target.HP = target.HT; + if (target instanceof Hero) { + ((Hero) target).resting = false; + } } } }