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

Loading…
Cancel
Save