v3.1.0: mirror images now benefit from body form and holy weapon when hero is unarmed

This commit is contained in:
Evan Debenham
2025-03-27 14:09:15 -04:00
parent 911581f150
commit 8e519303c5

View File

@@ -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;
}
}