From 3e1a79c248f787133717d9736d7cf053eb9900fe Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 2 Sep 2023 15:11:17 -0400 Subject: [PATCH] AI info dev command updated. --- src/engine/devcmd/cmds/aiInfoCmd.java | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/engine/devcmd/cmds/aiInfoCmd.java b/src/engine/devcmd/cmds/aiInfoCmd.java index c728d595..3fae7a64 100644 --- a/src/engine/devcmd/cmds/aiInfoCmd.java +++ b/src/engine/devcmd/cmds/aiInfoCmd.java @@ -9,6 +9,7 @@ package engine.devcmd.cmds; +import engine.Enum; import engine.Enum.GameObjectType; import engine.devcmd.AbstractDevCmd; import engine.gameManager.PowersManager; @@ -17,6 +18,7 @@ import engine.objects.Mob; import engine.objects.PlayerCharacter; import engine.powers.RunePowerEntry; +import java.util.ArrayList; import java.util.Map; @@ -58,6 +60,8 @@ public class aiInfoCmd extends AbstractDevCmd { Mob mob = (Mob) target; output = "Mob AI Information:" + newline; output += mob.getName() + newline; + output += mob.agentType.toString() + newline; + if (mob.behaviourType != null) { output += "BehaviourType: " + mob.behaviourType.toString() + newline; if (mob.behaviourType.BehaviourHelperType != null) { @@ -91,7 +95,26 @@ public class aiInfoCmd extends AbstractDevCmd { output += "Powers:" + newline; - for (RunePowerEntry runePowerEntry : PowersManager.getPowersForRune(mob.getMobBaseID())) + ArrayList powerEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.getMobBaseID())); + + // Additional powers may come from the contract ID. This is to support + // powers for player guards irrespective of the mobbase used. + + if (mob.isPlayerGuard()) { + + ArrayList contractEntries = new ArrayList<>(); + + if (mob.contract != null) + contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID)); + + if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) + contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID)); + + powerEntries.addAll(contractEntries); + + } + + for (RunePowerEntry runePowerEntry : powerEntries) output += PowersManager.getPowerByToken(runePowerEntry.token).getName() + newline; throwbackInfo(playerCharacter, output);