From d6dd61e9c507d3ca0e38eec36b3b5df623ff705d Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Thu, 29 Feb 2024 20:06:03 -0600 Subject: [PATCH] pet debugging --- src/engine/gameManager/CombatManager.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/engine/gameManager/CombatManager.java b/src/engine/gameManager/CombatManager.java index e37ca1c5..bfe7a1dc 100644 --- a/src/engine/gameManager/CombatManager.java +++ b/src/engine/gameManager/CombatManager.java @@ -528,7 +528,7 @@ public enum CombatManager { float atr; int minDamage, maxDamage; int errorTrack = 0; - + int subTrack = 0; try { if (ac == null) @@ -824,31 +824,39 @@ public enum CombatManager { if (tarAc.isSit()) damage *= 2.5f; //increase damage if sitting + + subTrack = 1; + if (tarAc.getObjectType() == GameObjectType.Mob) { Mob mobTarget = (Mob) tarAc; if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) { + subTrack = 2; if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) { + subTrack = 3; float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID()); mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue); } else { mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage); } - + subTrack = 4; } mobTarget.handleDirectAggro(ac); } if (tarAc.getHealth() > 0) d = tarAc.modifyHealth(-damage, ac, false); + subTrack = 5; } else if (target.getObjectType().equals(GameObjectType.Building)) { - + subTrack = 6; if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { ac.setCombatTarget(null); + subTrack = 7; return; } - + subTrack = 8; if (target.getHealth() > 0) d = ((Building) target).modifyHealth(-damage, ac); + subTrack = 9; } errorTrack = 13; @@ -949,7 +957,7 @@ public enum CombatManager { ac.cancelOnAttack(); } catch (Exception e) { - Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e); + Logger.error(ac.getName() + ' ' + "ErrorTrack: " + errorTrack + " ErrorSubTrack = " + subTrack + e); Logger.error(e.getMessage()); } }