v3.0.0: fixed trinity applying enchants to thrown weapons

This commit is contained in:
Evan Debenham
2025-02-10 14:08:36 -05:00
parent 28c157928f
commit c0d18d2cfd

View File

@@ -64,6 +64,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Projec
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Shocking;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Unstable; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Unstable;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Vampiric;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RunicBlade; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.RunicBlade;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Scimitar;
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog; import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
@@ -123,9 +124,8 @@ abstract public class Weapon extends KindOfWeapon {
boolean becameAlly = false; boolean becameAlly = false;
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) {
//TODO body form
Enchantment trinityEnchant = null; Enchantment trinityEnchant = null;
if (Dungeon.hero.buff(BodyForm.BodyFormBuff.class) != null){ if (Dungeon.hero.buff(BodyForm.BodyFormBuff.class) != null && this instanceof MeleeWeapon){
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;