v3.0.0: fixed holy ward not preventing some glyph functionality
This commit is contained in:
@@ -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
|
||||||
|
|||||||
+5
-3
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user