Browse Source

remove ItemBase from PlayerCharacter

combat-2
FatBoy-DOTC 8 months ago
parent
commit
a741bb3482
  1. 22
      src/engine/objects/PlayerCharacter.java

22
src/engine/objects/PlayerCharacter.java

@ -1358,10 +1358,10 @@ public class PlayerCharacter extends AbstractCharacter { @@ -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 { @@ -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 { @@ -3769,17 +3769,17 @@ public class PlayerCharacter extends AbstractCharacter {
ConcurrentHashMap<EquipSlotType, Item> 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 { @@ -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);
}

Loading…
Cancel
Save