From 4eb658c012c555d120b9887df46b67ed0c0b6504 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 5 Feb 2021 15:14:18 -0500 Subject: [PATCH] v0.9.2: healing buff now cancels resting when the hero reaches full HP --- .../shatteredpixeldungeon/actors/buffs/Healing.java | 5 +++++ 1 file changed, 5 insertions(+) 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 a4709bd77..a05eb0dbd 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 @@ -21,6 +21,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; @@ -46,6 +47,10 @@ public class Healing extends Buff { public boolean act(){ target.HP = Math.min(target.HT, target.HP + healingThisTick()); + + if (target.HP == target.HT && target instanceof Hero){ + ((Hero)target).resting = false; + } healingLeft -= healingThisTick();