Browse Source

Modification to minion retaliate.

combat-2
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 {
if (target.getObjectType() == GameObjectType.Mob) { if (target.getObjectType() == GameObjectType.Mob) {
Mob retaliater = (Mob) target; Mob attackedMobile = (Mob) target;
if (retaliater.getCombatTarget() != null && !retaliater.isSiege()) if (attackedMobile.getCombatTarget() != null && !attackedMobile.isSiege())
return;
if (attacker.getObjectType() == GameObjectType.Mob && retaliater.isSiege())
return; return;
//handle minion informing his captain of the attack //handle minion informing his captain of the attack
@ -1327,10 +1324,11 @@ public enum CombatManager {
Mob mob = (Mob) attacker; Mob mob = (Mob) attacker;
if (mob.agentType.equals(AIAgentType.GUARDMINION) && mob.guardCaptain != null && mob.guardCaptain.isAlive()) if (mob.agentType.equals(AIAgentType.GUARDMINION) && mob.guardCaptain != null && mob.guardCaptain.isAlive())
if (mob.guardCaptain.combatTarget == null) 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 {
} }
public final void setCombatTarget(final AbstractWorldObject value) { public final void setCombatTarget(final AbstractWorldObject value) {
if(this.getObjectTypeMask() == 2050) {//MOB? if(this.getObjectTypeMask() == 2050) {//MOB?
if (value == null) { if (value == null) {
if (this.isCombat()) { if (this.isCombat()) {
@ -1127,7 +1128,6 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
this.combatTarget = value; this.combatTarget = value;
} }
public final ConcurrentHashMap<String, JobContainer> getTimers() { public final ConcurrentHashMap<String, JobContainer> getTimers() {

Loading…
Cancel
Save