From 0a85d4ef41d2822a49344fa53d1e6b8dbf07c980 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 3 Nov 2022 14:10:13 -0400 Subject: [PATCH] v2.0.0: fixed magicImmune not blocking cursed artifacts or wand charging --- .../shatteredpixeldungeon/items/artifacts/Artifact.java | 3 ++- .../shatteredpixel/shatteredpixeldungeon/items/wands/Wand.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java index 3db27597d..d41f18fe9 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/Artifact.java @@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.artifacts; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; @@ -230,7 +231,7 @@ public class Artifact extends KindofMisc { } public boolean isCursed() { - return cursed; + return target.buff(MagicImmune.class) == null && cursed; } public void charge(Hero target, float amount){ 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 f18b318dd..2be4950b2 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 @@ -682,7 +682,7 @@ public abstract class Wand extends Item { @Override public boolean act() { - if (curCharges < maxCharges) + if (curCharges < maxCharges && target.buff(MagicImmune.class) == null) recharge(); while (partialCharge >= 1 && curCharges < maxCharges) {