mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Fixed #11426
This commit is contained in:
parent
a4073a83c6
commit
c7007a3de3
1 changed files with 23 additions and 4 deletions
|
|
@ -135,7 +135,6 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
if (log.isDebugEnabled()) {
|
||||
log.debug("choose: " + outcome.toString() + ':' + target.toString());
|
||||
}
|
||||
|
||||
// controller hints:
|
||||
// - 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
|
||||
|
|
@ -525,6 +524,26 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
|||
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());
|
||||
} //end of choose method
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue