Browse Source

Itembase refactor work

combat-2
MagicBot 8 months ago
parent
commit
ee9b64285e
  1. 28
      src/engine/gameManager/NPCManager.java

28
src/engine/gameManager/NPCManager.java

@ -300,26 +300,28 @@ public enum NPCManager { @@ -300,26 +300,28 @@ public enum NPCManager {
}else{
if (guard.equip.containsKey(Enum.EquipSlotType.RHELD)) {
//has main hand weapon
ItemBase weapon = guard.equip.get(Enum.EquipSlotType.RHELD).getItemBase();
if (weapon.isStrBased())
MobEquipment weapon = guard.equip.get(Enum.EquipSlotType.RHELD);
if (weapon.template.item_primary_attr.equals(Enum.AttributeType.Strength))
primaryStat = guard.getStatStrCurrent();
else
primaryStat = guard.getStatDexCurrent();
guard.minDamageHandOne = (int) ((guard.mobBase.getDamageMin() + weapon.getMinDamage()) * rankModifier) + primaryStat;
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax() + weapon.getMaxDamage()) * rankModifier) + primaryStat;
guard.speedHandOne = weapon.getSpeed();
guard.rangeHandOne = weapon.getRange();
guard.minDamageHandOne = (int) ((guard.mobBase.getDamageMin() + weapon.template.item_weapon_damage.values().iterator().next()[0]) * rankModifier) + primaryStat;
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax() + weapon.template.item_weapon_damage.values().iterator().next()[1]) * rankModifier) + primaryStat;
guard.speedHandOne = weapon.template.item_weapon_wepspeed;
guard.rangeHandOne = weapon.template.item_weapon_max_range;
} else if (guard.equip.containsKey(Enum.EquipSlotType.LHELD) && !ItemTemplate.isShield(guard.equip.get(Enum.EquipSlotType.LHELD).template)) {
//has off hand weapon
ItemBase weapon = guard.equip.get(Enum.EquipSlotType.LHELD).getItemBase();
if (weapon.isStrBased())
MobEquipment weapon = guard.equip.get(Enum.EquipSlotType.LHELD);
if (weapon.template.item_primary_attr.equals(Enum.AttributeType.Strength))
primaryStat = guard.getStatStrCurrent();
else
primaryStat = guard.getStatDexCurrent();
guard.minDamageHandTwo = (int) ((guard.mobBase.getDamageMin() + weapon.getMinDamage()) * rankModifier) + primaryStat;
guard.maxDamageHandTwo = (int) ((guard.mobBase.getDamageMax() + weapon.getMaxDamage()) * rankModifier) + primaryStat;
guard.speedHandTwo = weapon.getSpeed();
guard.rangeHandTwo = weapon.getRange();
guard.minDamageHandOne = (int) ((guard.mobBase.getDamageMin() + weapon.template.item_weapon_damage.values().iterator().next()[0]) * rankModifier) + primaryStat;
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax() + weapon.template.item_weapon_damage.values().iterator().next()[1]) * rankModifier) + primaryStat;
guard.speedHandOne = weapon.template.item_weapon_wepspeed;
guard.rangeHandOne = weapon.template.item_weapon_max_range;
} else {
primaryStat = guard.getStatStrCurrent();
guard.minDamageHandOne = (int)((guard.mobBase.getDamageMin()) * rankModifier) + primaryStat;
@ -338,7 +340,7 @@ public enum NPCManager { @@ -338,7 +340,7 @@ public enum NPCManager {
int armorDefense = 0;
for(MobEquipment equipped : guard.equip.values())
if (equipped.template.item_type.equals(Enum.ItemType.ARMOR) || ItemTemplate.isShield(equipped.template))
armorDefense += equipped.getItemBase().getDefense();
armorDefense += equipped.template.item_defense_rating;
guard.defenseRating = dexterity + baseDef + armorDefense;
}

Loading…
Cancel
Save