From 5f02b2c99687ed8604110970a490a0fa904c2aee Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 26 Apr 2025 14:58:59 -0400 Subject: [PATCH] v3.1.0: Fixed lay on hands applying 0 barrier to allies --- .../actors/hero/spells/LayOnHands.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java index eec6206ad..37fa8172f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/spells/LayOnHands.java @@ -105,10 +105,10 @@ public class LayOnHands extends TargetedClericSpell { } private void affectChar(Hero hero, Char ch){ - Barrier barrier = Buff.affect(ch, Barrier.class); int totalHeal = 5 + 5*hero.pointsInTalent(Talent.LAY_ON_HANDS); int totalBarrier = 0; if (ch == hero){ + Barrier barrier = Buff.affect(ch, Barrier.class); totalBarrier = totalHeal; totalBarrier = Math.min(3*totalHeal - barrier.shielding(), totalBarrier); totalBarrier = Math.max(0, totalBarrier); @@ -117,15 +117,18 @@ public class LayOnHands extends TargetedClericSpell { } else { if (ch.HT - ch.HP < totalHeal){ totalBarrier = totalHeal - (ch.HT - ch.HP); - totalBarrier = Math.min(3*totalHeal - barrier.shielding(), totalBarrier); - totalBarrier = Math.max(0, totalBarrier); if (ch.HP != ch.HT) { ch.HP = ch.HT; ch.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(totalHeal - totalBarrier), FloatingText.HEALING); } if (totalBarrier > 0) { - barrier.incShield(totalBarrier); - ch.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(totalBarrier), FloatingText.SHIELDING); + Barrier barrier = Buff.affect(ch, Barrier.class); + totalBarrier = Math.min(3 * totalHeal - barrier.shielding(), totalBarrier); + totalBarrier = Math.max(0, totalBarrier); + if (totalBarrier > 0) { + barrier.incShield(totalBarrier); + ch.sprite.showStatusWithIcon(CharSprite.POSITIVE, Integer.toString(totalBarrier), FloatingText.SHIELDING); + } } } else { ch.HP = ch.HP + totalHeal;