Browse Source

Contract power handling now additive.

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

28
src/engine/mobileAI/MobAI.java

@ -364,15 +364,21 @@ public class MobAI { @@ -364,15 +364,21 @@ public class MobAI {
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID()));
purgeEntries = new ArrayList<>();
// Fallback to contract is nothing in mobbase. This is to support player guards.
// Additional powers may come from the contract ID. This is to support
// powers for player guards irrespective of the mobbase used.
if (powerEntries.isEmpty()) {
if (mob.isPlayerGuard()) {
ArrayList<RunePowerEntry> contractEntries = new ArrayList<>();
if (mob.contract != null)
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
powerEntries.addAll(contractEntries);
}
// If player has this effect on them currently then remove
@ -459,15 +465,21 @@ public class MobAI { @@ -459,15 +465,21 @@ public class MobAI {
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID()));
purgeEntries = new ArrayList<>();
// Fallback to contract is nothing in mobbase. This is to support player guards.
// Additional powers may come from the contract ID. This is to support
// powers for player guards irrespective of the mobbase used.
if (powerEntries.isEmpty()) {
if (mob.isPlayerGuard()) {
ArrayList<RunePowerEntry> contractEntries = new ArrayList<>();
if (mob.contract != null)
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
powerEntries.addAll(contractEntries);
}
// If player has this effect on them currently then remove

Loading…
Cancel
Save