This commit is contained in:
Jeff Wadsworth 2023-11-22 10:22:34 -06:00
parent a4073a83c6
commit c7007a3de3

View file

@ -135,7 +135,6 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("choose: " + outcome.toString() + ':' + target.toString()); log.debug("choose: " + outcome.toString() + ':' + target.toString());
} }
// controller hints: // controller hints:
// - target.getTargetController(), this.getId() -- player that must makes choices (must be same with this.getId) // - target.getTargetController(), this.getId() -- player that must makes choices (must be same with this.getId)
// - target.getAbilityController(), abilityControllerId -- affected player/controller for all actions/filters // - target.getAbilityController(), abilityControllerId -- affected player/controller for all actions/filters
@ -525,6 +524,26 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return target.isChosen(); return target.isChosen();
} }
if (target.getOriginalTarget() instanceof TargetCard
&& (target.getZone() == Zone.COMMAND)) { // Hellkite Courser
List<Card> cardsInCommandZone = new ArrayList<>();
for (Player player : game.getPlayers().values()) {
for (Card card : game.getCommanderCardsFromCommandZone(player, CommanderCardType.COMMANDER_OR_OATHBREAKER)) {
if (target.canTarget(abilityControllerId, card.getId(), null, game)) {
cardsInCommandZone.add(card);
}
}
}
while (!target.isChosen() && !cardsInCommandZone.isEmpty()) {
Card pick = pickTarget(abilityControllerId, cardsInCommandZone, outcome, target, null, game);
if (pick != null) {
target.addTarget(pick.getId(), null, game);
cardsInCommandZone.remove(pick);
}
}
return target.isChosen();
}
throw new IllegalStateException("Target wasn't handled in computer's choose method: " + target.getClass().getCanonicalName()); throw new IllegalStateException("Target wasn't handled in computer's choose method: " + target.getClass().getCanonicalName());
} //end of choose method } //end of choose method