Refactored isShield and removed equipflag.

This commit is contained in:
2024-03-09 11:26:19 -05:00
parent 658b442b36
commit 6f028ab8c8
9 changed files with 65 additions and 61 deletions
+8 -9
View File
@@ -1141,14 +1141,13 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
this.rangeHandTwo = 6.5f;
this.speedHandTwo = 20;
if (this.equip.get(EquipSlotType.RHELD) != null) {
//has mainhand weapon to calculate
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), true);
}
if (this.equip.get(EquipSlotType.LHELD) != null && !this.equip.get(EquipSlotType.LHELD).getItemBase().isShield()) {
//has offhand weapon to calculate
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false);
}
if (this.equip.get(EquipSlotType.RHELD) != null)
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), true); //has mainhand weapon to calculate
if (this.equip.get(EquipSlotType.LHELD) != null && !ItemTemplate.isShield(this.equip.get(EquipSlotType.LHELD).template))
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.LHELD), false); //has offhand weapon to calculate
try {
calculateAtrDamageForWeapon(this.equip.get(EquipSlotType.RHELD), true);
@@ -1264,7 +1263,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
ItemBase ab = shield.getItemBase();
if (ab == null || !ab.isShield())
if (!ItemTemplate.isShield(shield.template))
return 0;
CharacterSkill blockSkill = this.skills.get("Block");