diff --git a/src/engine/mobileAI/MobAI.java b/src/engine/mobileAI/MobAI.java index 7b3c9ce1..4123c536 100644 --- a/src/engine/mobileAI/MobAI.java +++ b/src/engine/mobileAI/MobAI.java @@ -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 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 { 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 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