Equipment slot refactor started.

This commit is contained in:
2024-03-08 12:19:57 -05:00
parent 7d1d8891ff
commit d8d017669a
15 changed files with 163 additions and 443 deletions
+15 -15
View File
@@ -1141,17 +1141,17 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
this.rangeHandTwo = 6.5f;
this.speedHandTwo = 20;
if(this.equip.get(MBServerStatics.SLOT_MAINHAND) != null){
if (this.equip.get(EquipSlotType.RHELD) != null) {
//has mainhand weapon to calculate
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), true);
}
if(this.equip.get(MBServerStatics.SLOT_OFFHAND) != null && !this.equip.get(MBServerStatics.SLOT_OFFHAND).getItemBase().isShield()){
if (this.equip.get(EquipSlotType.LHELD) != null && !this.equip.get(EquipSlotType.LHELD).getItemBase().isShield()) {
//has offhand weapon to calculate
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_OFFHAND), false);
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false);
}
try {
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_MAINHAND), true);
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.RHELD), true);
} catch (Exception e) {
this.atrHandOne = (short) this.mobBase.getAttackRating();
@@ -1163,7 +1163,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
}
try {
calculateAtrDamageForWeapon(this.equip.get(MBServerStatics.SLOT_OFFHAND), false);
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false);
} catch (Exception e) {
@@ -1177,13 +1177,13 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
try {
float defense = this.mobBase.getDefenseRating();
defense += getShieldDefense(equip.get(MBServerStatics.SLOT_OFFHAND));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_HELMET));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_CHEST));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_ARMS));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_GLOVES));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_LEGGINGS));
defense += getArmorDefense(equip.get(MBServerStatics.SLOT_FEET));
defense += getShieldDefense(equip.get(EquipSlotType.LHELD));
defense += getArmorDefense(equip.get(EquipSlotType.HELM));
defense += getArmorDefense(equip.get(EquipSlotType.CHEST));
defense += getArmorDefense(equip.get(EquipSlotType.UPARM));
defense += getArmorDefense(equip.get(EquipSlotType.HANDS));
defense += getArmorDefense(equip.get(EquipSlotType.LEGS));
defense += getArmorDefense(equip.get(EquipSlotType.FEET));
defense += getWeaponDefense(equip);
// TODO add error log here
@@ -1220,14 +1220,14 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
private float getWeaponDefense(HashMap<Integer, MobEquipment> equipped) {
MobEquipment weapon = equipped.get(MBServerStatics.SLOT_MAINHAND);
MobEquipment weapon = equipped.get(EquipSlotType.RHELD);
ItemBase wb = null;
CharacterSkill skill, mastery;
float val = 0;
boolean unarmed = false;
if (weapon == null) {
weapon = equipped.get(MBServerStatics.SLOT_OFFHAND);
weapon = equipped.get(EquipSlotType.LHELD);
if (weapon == null)
unarmed = true;