From 8e519303c589dfc0e04bb04c80cca779e49a4c1b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Thu, 27 Mar 2025 14:09:15 -0400 Subject: [PATCH] v3.1.0: mirror images now benefit from body form and holy weapon when hero is unarmed --- .../actors/mobs/npcs/MirrorImage.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java index f7100d98a..220089750 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/npcs/MirrorImage.java @@ -31,9 +31,14 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Burning; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.BodyForm; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.MirrorSprite; @@ -177,6 +182,18 @@ public class MirrorImage extends NPC { } return damage; } else { + //hero benefits from holy weapon and body form when unarmed, so do mirror images + boolean wasEnemy = enemy.alignment == Alignment.ENEMY; + if (hero.buff(BodyForm.BodyFormBuff.class) != null + && hero.buff(BodyForm.BodyFormBuff.class).enchant() != null){ + damage = hero.buff(BodyForm.BodyFormBuff.class).enchant().proc(new WornShortsword(), this, enemy, damage); + } + if (!wasEnemy || enemy.alignment == Alignment.ENEMY) { + if (hero.buff(HolyWeapon.HolyWepBuff.class) != null) { + int dmg = hero.subClass == HeroSubClass.PALADIN ? 6 : 2; + enemy.damage(Math.round(dmg * Weapon.Enchantment.genericProcChanceMultiplier(this)), HolyWeapon.INSTANCE); + } + } return damage; } }