From 760719790d33ead6a778a94c56026b61e11bdcfc Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 5 Oct 2022 15:47:57 -0400 Subject: [PATCH] v1.4.1: fixed magic resistance not working with cursed wand drain effect --- .../items/armor/glyphs/AntiMagic.java | 2 ++ .../shatteredpixeldungeon/items/wands/CursedWand.java | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java index 3d6bf9e18..fc4e16b1f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/glyphs/AntiMagic.java @@ -38,6 +38,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.CursedWand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfFireblast; @@ -75,6 +76,7 @@ public class AntiMagic extends Armor.Glyph { RESISTS.add( Bomb.MagicalBomb.class ); RESISTS.add( ScrollOfPsionicBlast.class ); + RESISTS.add( CursedWand.class ); RESISTS.add( WandOfBlastWave.class ); RESISTS.add( WandOfDisintegration.class ); RESISTS.add( WandOfFireblast.class ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java index 1d6d4ae47..f4ea962a6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/CursedWand.java @@ -218,7 +218,7 @@ public class CursedWand { } toHeal.HP = Math.min(toHeal.HT, toHeal.HP + damage); toHeal.sprite.emitter().burst(Speck.factory(Speck.HEALING), 3); - toDamage.damage(damage, origin == null ? toHeal : origin); + toDamage.damage(damage, new CursedWand()); toDamage.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10); if (toDamage == Dungeon.hero){ @@ -244,11 +244,7 @@ public class CursedWand { //Bomb explosion case 2: - if (user == Dungeon.hero) { - new Bomb.MagicalBomb().explode(targetPos); - } else { - new Bomb().explode(targetPos); - } + new Bomb.MagicalBomb().explode(targetPos); tryForWandProc(Actor.findChar(targetPos), origin); return true;