v2.3.0: standardized healing over time buff behaviours:
- only show healing when healing occurs - only interrupt hero when they reach HT or when buff expires
This commit is contained in:
@@ -59,6 +59,9 @@ public class Healing extends Buff {
|
|||||||
healingLeft -= healingThisTick();
|
healingLeft -= healingThisTick();
|
||||||
|
|
||||||
if (healingLeft <= 0){
|
if (healingLeft <= 0){
|
||||||
|
if (target instanceof Hero) {
|
||||||
|
((Hero) target).resting = false;
|
||||||
|
}
|
||||||
detach();
|
detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+10
-2
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.actors.buffs;
|
|||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||||
@@ -43,10 +44,17 @@ public class WellFed extends Buff {
|
|||||||
left --;
|
left --;
|
||||||
if (left < 0){
|
if (left < 0){
|
||||||
detach();
|
detach();
|
||||||
|
if (target instanceof Hero) {
|
||||||
|
((Hero) target).resting = false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (left % 18 == 0){
|
} else if (left % 18 == 0 && target.HP < target.HT){
|
||||||
target.HP = Math.min(target.HT, target.HP + 1);
|
target.HP += 1;
|
||||||
target.sprite.showStatusWithIcon(CharSprite.POSITIVE, "1", FloatingText.HEALING);
|
target.sprite.showStatusWithIcon(CharSprite.POSITIVE, "1", FloatingText.HEALING);
|
||||||
|
|
||||||
|
if (target.HP == target.HT && target instanceof Hero) {
|
||||||
|
((Hero) target).resting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
|
|||||||
+5
-1
@@ -168,9 +168,13 @@ public class ChaliceOfBlood extends Artifact {
|
|||||||
if (Random.Float() < heal%1){
|
if (Random.Float() < heal%1){
|
||||||
heal++;
|
heal++;
|
||||||
}
|
}
|
||||||
if (heal >= 1f) {
|
if (heal >= 1f && target.HP < target.HT) {
|
||||||
target.HP = Math.min(target.HT, target.HP + (int)heal);
|
target.HP = Math.min(target.HT, target.HP + (int)heal);
|
||||||
target.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString((int)heal), FloatingText.HEALING);
|
target.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString((int)heal), FloatingText.HEALING);
|
||||||
|
|
||||||
|
if (target.HP == target.HT && target instanceof Hero) {
|
||||||
|
((Hero) target).resting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -310,7 +310,7 @@ public class DriedRose extends Artifact {
|
|||||||
}
|
}
|
||||||
updateQuickslot();
|
updateQuickslot();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (ghost.HP < ghost.HT) {
|
||||||
int heal = Math.round((1 + level()/3f)*amount);
|
int heal = Math.round((1 + level()/3f)*amount);
|
||||||
ghost.HP = Math.min( ghost.HT, ghost.HP + heal);
|
ghost.HP = Math.min( ghost.HT, ghost.HP + heal);
|
||||||
ghost.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(heal), FloatingText.HEALING);
|
ghost.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(heal), FloatingText.HEALING);
|
||||||
|
|||||||
+13
-3
@@ -83,14 +83,24 @@ public class ElixirOfAquaticRejuvenation extends Elixir {
|
|||||||
} else {
|
} else {
|
||||||
healAmt = (float)Math.floor(healAmt);
|
healAmt = (float)Math.floor(healAmt);
|
||||||
}
|
}
|
||||||
target.HP += healAmt;
|
target.HP += (int)healAmt;
|
||||||
left -= healAmt;
|
left -= (int)healAmt;
|
||||||
target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 );
|
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){
|
if (left <= 0){
|
||||||
detach();
|
detach();
|
||||||
|
if (target instanceof Hero) {
|
||||||
|
((Hero) target).resting = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,15 +92,20 @@ public class Sungrass extends Plant {
|
|||||||
partialHeal += (40 + target.HT)/150f;
|
partialHeal += (40 + target.HT)/150f;
|
||||||
|
|
||||||
if (partialHeal > 1){
|
if (partialHeal > 1){
|
||||||
target.HP += (int)partialHeal;
|
int healThisTurn = (int)partialHeal;
|
||||||
level -= (int)partialHeal;
|
partialHeal -= healThisTurn;
|
||||||
partialHeal -= (int)partialHeal;
|
level -= healThisTurn;
|
||||||
target.sprite.showStatusWithIcon(CharSprite.POSITIVE, "1", FloatingText.HEALING);
|
|
||||||
|
|
||||||
if (target.HP >= target.HT) {
|
if (target.HP < target.HT) {
|
||||||
target.HP = target.HT;
|
|
||||||
if (target instanceof Hero){
|
target.HP += healThisTurn;
|
||||||
((Hero)target).resting = false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user