Browse Source

combat problem chasing

lakebane-master
FatBoy-DOTC 8 months ago
parent
commit
ce542ce319
  1. 14
      src/engine/gameManager/CombatManager.java

14
src/engine/gameManager/CombatManager.java

@ -821,25 +821,25 @@ public enum CombatManager { @@ -821,25 +821,25 @@ public enum CombatManager {
//Subtract Damage from target's health
if (tarAc != null) {
if (tarAc.isSit())
damage *= 2.5f; //increase damage if sitting
if (tarAc.getObjectType() == GameObjectType.Mob) {
Mob mobTarget = (Mob) tarAc;
if (ac.getObjectType().equals(GameObjectType.PlayerCharacter)) {
if(((Mob) tarAc).playerAgroMap.containsKey(ac.getObjectUUID())) {
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), ((Mob) tarAc).playerAgroMap.get(ac.getObjectUUID()) + damage);
if (mobTarget.playerAgroMap.containsKey(ac.getObjectUUID())) {
float hateValue = damage + mobTarget.playerAgroMap.get(ac.getObjectUUID());
mobTarget.playerAgroMap.put(ac.getObjectUUID(), hateValue);
} else {
((Mob) tarAc).playerAgroMap.put(ac.getObjectUUID(), damage);
mobTarget.playerAgroMap.put(ac.getObjectUUID(), damage);
}
}
((Mob) tarAc).handleDirectAggro(ac);
mobTarget.handleDirectAggro(ac);
}
if (tarAc.getHealth() > 0)
d = tarAc.modifyHealth(-damage, ac, false);
} else if (target.getObjectType().equals(GameObjectType.Building)) {
if (BuildingManager.getBuildingFromCache(target.getObjectUUID()) == null) {
@ -950,7 +950,7 @@ public enum CombatManager { @@ -950,7 +950,7 @@ public enum CombatManager {
} catch (Exception e) {
Logger.error(ac.getName() + ' ' + errorTrack + ' ' + e);
e.printStackTrace();
Logger.error(e.getMessage());
}
}

Loading…
Cancel
Save