v0.9.2: healing buff now cancels resting when the hero reaches full HP
This commit is contained in:
parent
c4bf878276
commit
4eb658c012
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator;
|
||||||
|
@ -47,6 +48,10 @@ public class Healing extends Buff {
|
||||||
|
|
||||||
target.HP = Math.min(target.HT, target.HP + healingThisTick());
|
target.HP = Math.min(target.HT, target.HP + healingThisTick());
|
||||||
|
|
||||||
|
if (target.HP == target.HT && target instanceof Hero){
|
||||||
|
((Hero)target).resting = false;
|
||||||
|
}
|
||||||
|
|
||||||
healingLeft -= healingThisTick();
|
healingLeft -= healingThisTick();
|
||||||
|
|
||||||
if (healingLeft <= 0){
|
if (healingLeft <= 0){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user