Refactor isTwoHanded()

This commit is contained in:
2024-03-10 16:21:23 -04:00
parent 32d9322189
commit 56b89b7080
4 changed files with 18 additions and 14 deletions
+8 -5
View File
@@ -595,7 +595,9 @@ public enum CombatManager {
// Apply Weapon power effect if any. don't try to apply twice if
// dual wielding. Perform after passive test for sync purposes.
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || wb.isTwoHanded())) {
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID());
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) {
dpj = ((PlayerCharacter) attacker).getWeaponPower();
@@ -811,7 +813,8 @@ public enum CombatManager {
// Apply Weapon power effect if any.
// don't try to apply twice if dual wielding.
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || wb.isTwoHanded())) {
ItemTemplate template = ItemTemplate.itemTemplates.get(wb.getUUID());
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || ItemTemplate.isTwoHanded(template))) {
dpj = ((PlayerCharacter) attacker).getWeaponPower();
if (dpj != null) {
@@ -1046,7 +1049,7 @@ public enum CombatManager {
return 75;
else if (required.equals("Sword")) {
if (wb.isTwoHanded())
if (ItemTemplate.isTwoHanded(template))
return 105;
else
return 98;
@@ -1056,7 +1059,7 @@ public enum CombatManager {
} else if (required.equals("Spear")) {
return 92;
} else if (required.equals("Hammer") || required.equals("Axe")) {
if (wb.isTwoHanded()) {
if (ItemTemplate.isTwoHanded(template)) {
return 105;
} else if (mastery.equals("Throwing")) {
return 115;
@@ -1073,7 +1076,7 @@ public enum CombatManager {
return 110;
} else if (required.equals("Bow")) {
return 109;
} else if (wb.isTwoHanded()) {
} else if (ItemTemplate.isTwoHanded(template)) {
return 105;
} else {
return 100;