Browse Source

Contract support added to mobile ai when gathering powers.

feature-workorder
MagicBot 1 year ago
parent
commit
58b427b977
  1. 28
      src/engine/mobileAI/MobAI.java

28
src/engine/mobileAI/MobAI.java

@ -323,13 +323,17 @@ public class MobAI {
return false; return false;
} }
if (PowersManager.getPowersForRune(mob.getMobBaseID()).isEmpty()) // Mobile has no powers defined.
if (PowersManager.getPowersForRune(mob.getMobBaseID()).isEmpty() &&
PowersManager.getPowersForRune(mob.contractUUID).isEmpty())
return false; return false;
if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) { if (!mob.canSee((PlayerCharacter) mob.getCombatTarget())) {
mob.setCombatTarget(null); mob.setCombatTarget(null);
return false; return false;
} }
if (mob.nextCastTime == 0) if (mob.nextCastTime == 0)
mob.nextCastTime = System.currentTimeMillis(); mob.nextCastTime = System.currentTimeMillis();
@ -360,6 +364,17 @@ public class MobAI {
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID())); powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID()));
purgeEntries = new ArrayList<>(); purgeEntries = new ArrayList<>();
// Fallback to contract is nothing in mobbase. This is to support player guards.
if (powerEntries.isEmpty()) {
if (mob.contract != null)
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
}
// If player has this effect on them currently then remove // If player has this effect on them currently then remove
// this token from our list. // this token from our list.
@ -444,6 +459,17 @@ public class MobAI {
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID())); powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID()));
purgeEntries = new ArrayList<>(); purgeEntries = new ArrayList<>();
// Fallback to contract is nothing in mobbase. This is to support player guards.
if (powerEntries.isEmpty()) {
if (mob.contract != null)
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
}
// If player has this effect on them currently then remove // If player has this effect on them currently then remove
// this token from our list. // this token from our list.

Loading…
Cancel
Save