Browse Source

pet debugging

lakebane-master
FatBoy-DOTC 10 months ago
parent
commit
d6dd61e9c5
  1. 18
      src/engine/gameManager/CombatManager.java

18
src/engine/gameManager/CombatManager.java

@ -528,7 +528,7 @@ public enum CombatManager {
float atr; float atr;
int minDamage, maxDamage; int minDamage, maxDamage;
int errorTrack = 0; int errorTrack = 0;
int subTrack = 0;
try { try {
if (ac == null) if (ac == null)
@ -824,31 +824,39 @@ public enum CombatManager {
if (tarAc.isSit()) if (tarAc.isSit())
damage *= 2.5f; //increase damage if sitting damage *= 2.5f; //increase damage if sitting
subTrack = 1;
if (tarAc.getObjectType() == GameObjectType.Mob) { if (tarAc.getObjectType() == GameObjectType.Mob) {
Mob mobTarget = (Mob) tarAc; Mob mobTarget = (Mob) tarAc;
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) { if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) {
subTrack = 2;
if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) { if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) {
subTrack = 3;
float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID()); float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID());
mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue); mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue);
} else { } else {
mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage); mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage);
} }
subTrack = 4;
} }
mobTarget.handleDirectAggro(ac); mobTarget.handleDirectAggro(ac);
} }
if (tarAc.getHealth() > 0) if (tarAc.getHealth() > 0)
d = tarAc.modifyHealth(-damage, ac, false); d = tarAc.modifyHealth(-damage, ac, false);
subTrack = 5;
} else if (target.getObjectType().equals(GameObjectType.Building)) { } else if (target.getObjectType().equals(GameObjectType.Building)) {
subTrack = 6;
if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) { if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) {
ac.setCombatTarget(null); ac.setCombatTarget(null);
subTrack = 7;
return; return;
} }
subTrack = 8;
if (target.getHealth() > 0) if (target.getHealth() > 0)
d = ((Building) target).modifyHealth(-damage, ac); d = ((Building) target).modifyHealth(-damage, ac);
subTrack = 9;
} }
errorTrack = 13; errorTrack = 13;
@ -949,7 +957,7 @@ public enum CombatManager {
ac.cancelOnAttack(); ac.cancelOnAttack();
} catch (Exception e) { } catch (Exception e) {
Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e); Logger.error(ac.getName() + ' ' + "ErrorTrack: " + errorTrack + " ErrorSubTrack = " + subTrack + e);
Logger.error(e.getMessage()); Logger.error(e.getMessage());
} }
} }

Loading…
Cancel
Save