1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00

Added for computer player missing handling of choosing TargetCardInGraveyard. This fixes issue .

This commit is contained in:
LevelX2 2013-02-06 15:41:00 +01:00
parent fcd24572dd
commit e96203b10b

View file

@ -285,7 +285,25 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
if (!target.isRequired())
return false;
}
return false;
if (target instanceof TargetCardInGraveyard) {
List<Card> cards = new ArrayList<Card>();
for (Player player: game.getPlayers().values()) {
for (Card card: player.getGraveyard().getCards(game)) {
if (target.canTarget(card.getId(), game)) {
cards.add(card);
}
}
}
for (Card card: cards) {
target.add(card.getId(), game);
if (target.isChosen()) {
return true;
}
}
return target.isChosen();
}
throw new IllegalStateException("Target wasn't handled. class:" + target.getClass().toString());
// return false;
}
@Override