v3.0.0: fixed holy ward not preventing some glyph functionality

This commit is contained in:
Evan Debenham
2024-12-20 12:35:11 -05:00
parent b8aa706ac3
commit e1a138ed59
2 changed files with 14 additions and 4 deletions
@@ -679,7 +679,15 @@ public class Armor extends EquipableItem {
} }
public boolean hasGlyph(Class<?extends Glyph> type, Char owner) { public boolean hasGlyph(Class<?extends Glyph> type, Char owner) {
return glyph != null && glyph.getClass() == type && owner.buff(MagicImmune.class) == null; if (glyph == null){
return false;
} else if (owner.buff(MagicImmune.class) != null) {
return false;
} else if (!glyph.curse() && owner instanceof Hero && isEquipped((Hero) owner) && owner.buff(HolyWard.HolyArmBuff.class) != null){
return false;
} else {
return glyph.getClass() == type;
}
} }
//these are not used to process specific glyph effects, so magic immune doesn't affect them //these are not used to process specific glyph effects, so magic immune doesn't affect them
@@ -397,12 +397,14 @@ abstract public class Weapon extends KindOfWeapon {
} }
public boolean hasEnchant(Class<?extends Enchantment> type, Char owner) { public boolean hasEnchant(Class<?extends Enchantment> type, Char owner) {
if (owner.buff(MagicImmune.class) != null) { if (enchantment == null){
return false; return false;
} else if (owner instanceof Hero && isEquipped((Hero) owner) && owner.buff(HolyWeapon.HolyWepBuff.class) != null){ } else if (owner.buff(MagicImmune.class) != null) {
return false;
} else if (!enchantment.curse() && owner instanceof Hero && isEquipped((Hero) owner) && owner.buff(HolyWeapon.HolyWepBuff.class) != null){
return false; return false;
} else { } else {
return enchantment != null && enchantment.getClass() == type; return enchantment.getClass() == type;
} }
} }