v2.0.0: fixed magicImmune not blocking cursed artifacts or wand charging

This commit is contained in:
Evan Debenham
2022-11-03 14:10:13 -04:00
parent d41f68bb96
commit 0a85d4ef41
2 changed files with 3 additions and 2 deletions

View File

@@ -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){

View File

@@ -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) {