v3.2.0: fixed body form working on all weapon wielders

This commit is contained in:
Evan Debenham
2025-07-28 14:30:55 -04:00
parent 250be7e9c1
commit 72f5786e6d

View File

@@ -32,9 +32,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.cleric.AscendedForm;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.duelist.ElementalStrike;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.rogue.ShadowClone;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.BodyForm; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.BodyForm;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.HolyWeapon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.Smite; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.spells.Smite;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.MirrorImage;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag; import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
@@ -128,7 +130,9 @@ abstract public class Weapon extends KindOfWeapon {
boolean wasAlly = defender.alignment == Char.Alignment.ALLY; boolean wasAlly = defender.alignment == Char.Alignment.ALLY;
if (attacker.buff(MagicImmune.class) == null) { if (attacker.buff(MagicImmune.class) == null) {
Enchantment trinityEnchant = null; Enchantment trinityEnchant = null;
if (Dungeon.hero.buff(BodyForm.BodyFormBuff.class) != null && this instanceof MeleeWeapon){ //only when it's the hero or a char that uses the hero's weapon
if (Dungeon.hero.buff(BodyForm.BodyFormBuff.class) != null && this instanceof MeleeWeapon
&& (attacker == Dungeon.hero || attacker instanceof MirrorImage || attacker instanceof ShadowClone.ShadowAlly)){
trinityEnchant = Dungeon.hero.buff(BodyForm.BodyFormBuff.class).enchant(); trinityEnchant = Dungeon.hero.buff(BodyForm.BodyFormBuff.class).enchant();
if (enchantment != null && trinityEnchant != null && trinityEnchant.getClass() == enchantment.getClass()){ if (enchantment != null && trinityEnchant != null && trinityEnchant.getClass() == enchantment.getClass()){
trinityEnchant = null; trinityEnchant = null;