Browse Source

combat problem chasing

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

Loading…
Cancel
Save