Browse Source

mob drop aggro check

lakebane
FatBoy-DOTC 5 days ago
parent
commit
1bb99127c4
  1. 6
      src/engine/mobileAI/MobAI.java
  2. 2
      src/engine/mobileAI/utilities/MovementUtilities.java

6
src/engine/mobileAI/MobAI.java

@ -9,7 +9,6 @@
package engine.mobileAI; package engine.mobileAI;
import engine.Enum; import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.gameManager.*; import engine.gameManager.*;
import engine.math.Vector3f; import engine.math.Vector3f;
@ -19,7 +18,6 @@ import engine.mobileAI.utilities.CombatUtilities;
import engine.mobileAI.utilities.MovementUtilities; import engine.mobileAI.utilities.MovementUtilities;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.PerformActionMsg; import engine.net.client.msg.PerformActionMsg;
import engine.net.client.msg.PowerProjectileMsg;
import engine.net.client.msg.UpdateStateMsg; import engine.net.client.msg.UpdateStateMsg;
import engine.objects.*; import engine.objects.*;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;
@ -110,7 +108,7 @@ public class MobAI {
if (mob.BehaviourType.callsForHelp) if (mob.BehaviourType.callsForHelp)
MobCallForHelp(mob); MobCallForHelp(mob);
if (!MovementUtilities.inRangeDropAggro(mob, target)) { if (MovementUtilities.outOfAggroRange(mob, target)) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
} }
@ -918,7 +916,7 @@ public class MobAI {
if(!mob.isCombat()) if(!mob.isCombat())
enterCombat(mob); enterCombat(mob);
if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && !MovementUtilities.inRangeDropAggro(mob, (PlayerCharacter) mob.getCombatTarget()) && mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal()) { if (mob.getCombatTarget().getObjectType().equals(Enum.GameObjectType.PlayerCharacter) && MovementUtilities.outOfAggroRange(mob, (PlayerCharacter) mob.getCombatTarget()) && mob.BehaviourType.ordinal() != Enum.MobBehaviourType.Pet1.ordinal()) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return; return;
} }

2
src/engine/mobileAI/utilities/MovementUtilities.java

@ -98,7 +98,7 @@ public class MovementUtilities {
} }
public static boolean inRangeDropAggro(Mob agent, AbstractCharacter target) { public static boolean outOfAggroRange(Mob agent, AbstractCharacter target) {
Vector3fImmutable sl = agent.getLoc(); Vector3fImmutable sl = agent.getLoc();
Vector3fImmutable tl = target.getLoc(); Vector3fImmutable tl = target.getLoc();

Loading…
Cancel
Save