Browse Source

combat manager error tracking

lakebane-recovery
FatBoy-DOTC 5 days ago
parent
commit
956ff11574
  1. 23
      src/engine/gameManager/CombatManager.java

23
src/engine/gameManager/CombatManager.java

@ -1009,23 +1009,17 @@ public enum CombatManager {
//handle damage shields //handle damage shields
if (ac.isAlive() && tarAc != null && tarAc.isAlive()) if (ac.isAlive() && tarAc != null && tarAc.isAlive())
try {
handleDamageShields(ac, tarAc, damage); handleDamageShields(ac, tarAc, damage);
}catch(Exception e){
//handle mob hate values Logger.error(e.getMessage());
if(target.getObjectType().equals(GameObjectType.Mob) && ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
Mob mobTarget = (Mob)target;
if(mobTarget.hate_values.containsKey((PlayerCharacter) ac)){
mobTarget.hate_values.put((PlayerCharacter) ac,mobTarget.hate_values.get((PlayerCharacter) ac) + damage);
}else{
mobTarget.hate_values.put((PlayerCharacter) ac, damage);
}
} }
} else { } else {
// Apply Weapon power effect if any. // Apply Weapon power effect if any.
// don't try to apply twice if dual wielding. // don't try to apply twice if dual wielding.
try {
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || wb.isTwoHanded())) { if (ac.getObjectType().equals(GameObjectType.PlayerCharacter) && (mainHand || wb.isTwoHanded())) {
dpj = ((PlayerCharacter) ac).getWeaponPower(); dpj = ((PlayerCharacter) ac).getWeaponPower();
@ -1060,10 +1054,15 @@ public enum CombatManager {
((PlayerCharacter) ac).setWeaponPower(null); ((PlayerCharacter) ac).setWeaponPower(null);
} }
} }
}catch(Exception e) {
Logger.error(e.getMessage());
}
try {
if (target.getObjectType() == GameObjectType.Mob) if (target.getObjectType() == GameObjectType.Mob)
((Mob) target).handleDirectAggro(ac); ((Mob) target).handleDirectAggro(ac);
}catch(Exception e){
Logger.error(e.getMessage());
}
errorTrack = 17; errorTrack = 17;
//miss, Send miss message //miss, Send miss message

Loading…
Cancel
Save