v2.0.0: fixed magicImmune not blocking cursed artifacts or wand charging
This commit is contained in:
@@ -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){
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user