From a741bb34823a25c58b45b97773a64b4fdddb152b Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 27 Mar 2024 17:36:43 -0500 Subject: [PATCH] remove ItemBase from PlayerCharacter --- src/engine/objects/PlayerCharacter.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/engine/objects/PlayerCharacter.java b/src/engine/objects/PlayerCharacter.java index 7b2cadfe..8218d390 100644 --- a/src/engine/objects/PlayerCharacter.java +++ b/src/engine/objects/PlayerCharacter.java @@ -1358,10 +1358,10 @@ public class PlayerCharacter extends AbstractCharacter { public static float getDexPenalty(Item armor) { if (armor == null) return 0f; - ItemBase ab = armor.getItemBase(); + ItemTemplate ab = armor.template; if (ab == null) return 0f; - return ab.getDexPenalty(); + return ab.item_bulk_factor; } public static void InitializeSkillsOnLoad(PlayerCharacter pc) { @@ -2817,11 +2817,11 @@ public class PlayerCharacter extends AbstractCharacter { if (item == null) return false; - ItemBase ib = item.getItemBase(); + ItemTemplate ib = item.template; if (ib != null) { if ((item.template.item_type.equals(ItemType.WEAPON)) - && (item.template.item_skill_used.equals(type) || ib.getMastery().equals(type))) + && (item.template.item_skill_used.equals(type) || ib.item_skill_mastery_used.equals(type))) return true; return (item.template.item_type.equals(ItemType.ARMOR)) @@ -3769,17 +3769,17 @@ public class PlayerCharacter extends AbstractCharacter { ConcurrentHashMap equipped = this.charItemManager.getEquipped(); Item off = equipped.get(EquipSlotType.LHELD); Item main = equipped.get(EquipSlotType.RHELD); - ItemBase wbMain = null; - ItemBase wbOff = null; + ItemTemplate wbMain = null; + ItemTemplate wbOff = null; if (main != null) - wbMain = main.getItemBase(); + wbMain = main.template; if (off != null) - wbOff = off.getItemBase(); + wbOff = off.template; //set block if block found this.bonuses.setBool(ModType.Block, SourceType.NONE, false); if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501)) - if (off != null && off.getItemBase() != null && ItemTemplate.isShield(off)) + if (off != null && off.template != null && ItemTemplate.isShield(off)) this.bonuses.setBool(ModType.Block, SourceType.NONE, true); //set dodge if rogue @@ -3792,8 +3792,8 @@ public class PlayerCharacter extends AbstractCharacter { this.bonuses.setBool(ModType.Parry, SourceType.NONE, false); if ((this.baseClass != null && this.baseClass.getObjectUUID() == 2500) || (this.promotionClass != null && this.promotionClass.getObjectUUID() == 2520)) - if (wbMain == null || wbMain.getRange() < MBServerStatics.RANGED_WEAPON_RANGE) - if (wbOff == null || wbOff.getRange() < MBServerStatics.RANGED_WEAPON_RANGE) + if (wbMain == null || wbMain.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE) + if (wbOff == null || wbOff.item_weapon_max_range < MBServerStatics.RANGED_WEAPON_RANGE) this.bonuses.setBool(ModType.Parry, SourceType.NONE, true); }