From 55597433e118c90e27a0494fab306a296729d9e5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 14 Nov 2022 14:32:58 -0500 Subject: [PATCH] v2.0.0: fixed antimagic not preventing shield battery use --- .../shatteredpixeldungeon/items/wands/Wand.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java index 2be4950b2..ffc87f5f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java @@ -573,6 +573,12 @@ public abstract class Wand extends Item { if (target == curUser.pos || cell == curUser.pos) { if (target == curUser.pos && curUser.hasTalent(Talent.SHIELD_BATTERY)){ + + if (curUser.buff(MagicImmune.class) != null){ + GLog.w( Messages.get(this, "no_magic") ); + return; + } + float shield = curUser.HT * (0.04f*curWand.curCharges); if (curUser.pointsInTalent(Talent.SHIELD_BATTERY) == 2) shield *= 1.5f; Buff.affect(curUser, Barrier.class).setShield(Math.round(shield));