Browse Source

Minions get marching orders from captain

feature-workorder
MagicBot 1 year ago
parent
commit
553010bb7b
  1. 18
      src/engine/mobileAI/MobAI.java

18
src/engine/mobileAI/MobAI.java

@ -278,12 +278,17 @@ public class MobAI { @@ -278,12 +278,17 @@ public class MobAI {
if (mob.lastPatrolPointIndex > mob.patrolPoints.size() - 1)
mob.lastPatrolPointIndex = 0;
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex);
// Minions are given marching orders by the captain if he is alive
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
mob.destination = mob.destination.add(Formation.getOffset(2, mob.minions.indexOf(mob.getObjectUUID()) + 3));
mob.lastPatrolPointIndex += 1;
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION) && mob.guardCaptain.isAlive()) {
Mob captain = (Mob) mob.guardCaptain;
mob.destination = captain.destination.add(Formation.getOffset(2, mob.guardCaptain.minions.indexOf(mob.getObjectUUID()) + 3));
;
mob.lastPatrolPointIndex = captain.lastPatrolPointIndex;
} else {
mob.destination = mob.patrolPoints.get(mob.lastPatrolPointIndex);
mob.lastPatrolPointIndex += 1;
}
MovementUtilities.aiMove(mob, mob.destination, true);
@ -731,9 +736,8 @@ public class MobAI { @@ -731,9 +736,8 @@ public class MobAI {
if (mob.getCombatTarget() == null) {
if (!mob.isMoving())
Patrol(mob);
else {
else
mob.stopPatrolTime = System.currentTimeMillis();
}
} else {
chaseTarget(mob);
}

Loading…
Cancel
Save