v3.1.0: fixed body form only granting enchants/glyphs if one exists

This commit is contained in:
Evan Debenham
2025-05-15 11:20:09 -04:00
parent 57a1285905
commit 96ba257882
2 changed files with 13 additions and 11 deletions

View File

@@ -739,11 +739,10 @@ public class Armor extends EquipableItem {
} }
public boolean hasGlyph(Class<?extends Glyph> type, Char owner) { public boolean hasGlyph(Class<?extends Glyph> type, Char owner) {
if (glyph == null){ if (owner.buff(MagicImmune.class) != null) {
return false; return false;
} else if (owner.buff(MagicImmune.class) != null) { } else if (glyph != null
return false; && !glyph.curse()
} else if (!glyph.curse()
&& owner instanceof Hero && owner instanceof Hero
&& isEquipped((Hero) owner) && isEquipped((Hero) owner)
&& owner.buff(HolyWard.HolyArmBuff.class) != null && owner.buff(HolyWard.HolyArmBuff.class) != null
@@ -753,8 +752,10 @@ public class Armor extends EquipableItem {
&& owner.buff(BodyForm.BodyFormBuff.class).glyph() != null && owner.buff(BodyForm.BodyFormBuff.class).glyph() != null
&& owner.buff(BodyForm.BodyFormBuff.class).glyph().getClass().equals(type)){ && owner.buff(BodyForm.BodyFormBuff.class).glyph().getClass().equals(type)){
return true; return true;
} else { } else if (glyph != null) {
return glyph.getClass() == type; return glyph.getClass() == type;
} else {
return false;
} }
} }

View File

@@ -325,7 +325,7 @@ abstract public class Weapon extends KindOfWeapon {
reach += 2; reach += 2;
} }
if (hasEnchant(Projecting.class, owner)){ if (hasEnchant(Projecting.class, owner)){
return reach + Math.round(enchantment.procChanceMultiplier(owner)); return reach + Math.round(Enchantment.genericProcChanceMultiplier(owner));
} else { } else {
return reach; return reach;
} }
@@ -449,11 +449,10 @@ 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 (enchantment == null){ if (owner.buff(MagicImmune.class) != null) {
return false; return false;
} else if (owner.buff(MagicImmune.class) != null) { } else if (enchantment != null
return false; && !enchantment.curse()
} else if (!enchantment.curse()
&& owner instanceof Hero && owner instanceof Hero
&& isEquipped((Hero) owner) && isEquipped((Hero) owner)
&& owner.buff(HolyWeapon.HolyWepBuff.class) != null && owner.buff(HolyWeapon.HolyWepBuff.class) != null
@@ -463,8 +462,10 @@ abstract public class Weapon extends KindOfWeapon {
&& owner.buff(BodyForm.BodyFormBuff.class).enchant() != null && owner.buff(BodyForm.BodyFormBuff.class).enchant() != null
&& owner.buff(BodyForm.BodyFormBuff.class).enchant().getClass().equals(type)){ && owner.buff(BodyForm.BodyFormBuff.class).enchant().getClass().equals(type)){
return true; return true;
} else { } else if (enchantment != null) {
return enchantment.getClass() == type; return enchantment.getClass() == type;
} else {
return false;
} }
} }