Browse Source

Modification to minion retaliate.

feature-workorder
MagicBot 1 year ago
parent
commit
ff36d8f3db
  1. 12
      src/engine/gameManager/CombatManager.java
  2. 2
      src/engine/objects/AbstractCharacter.java

12
src/engine/gameManager/CombatManager.java

@ -1314,12 +1314,9 @@ public enum CombatManager { @@ -1314,12 +1314,9 @@ public enum CombatManager {
if (target.getObjectType() == GameObjectType.Mob) {
Mob retaliater = (Mob) target;
Mob attackedMobile = (Mob) target;
if (retaliater.getCombatTarget() != null && !retaliater.isSiege())
return;
if (attacker.getObjectType() == GameObjectType.Mob && retaliater.isSiege())
if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege())
return;
//handle minion informing his captain of the attack
@ -1327,10 +1324,11 @@ public enum CombatManager { @@ -1327,10 +1324,11 @@ public enum CombatManager {
Mob mob = (Mob) attacker;
if (mob.agentType.equals(AIAgentType.GUARDMINION) && mob.guardCaptain != null && mob.guardCaptain.isAlive())
if (mob.guardCaptain.combatTarget == null)
mob.guardCaptain.combatTarget = attacker;
mob.guardCaptain.setCombatTarget(attacker);
}
retaliater.setCombatTarget(attacker);
attackedMobile.setCombatTarget(attacker);
}
}

2
src/engine/objects/AbstractCharacter.java

@ -1107,6 +1107,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1107,6 +1107,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
}
public final void setCombatTarget(final AbstractWorldObject value) {
if(this.getObjectTypeMask() == 2050) {//MOB?
if (value == null) {
if (this.isCombat()) {
@ -1127,7 +1128,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -1127,7 +1128,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
this.combatTarget = value;
}
public final ConcurrentHashMap<String, JobContainer> getTimers() {

Loading…
Cancel
Save