* Fixed a bug that the AI did not handle to target a card in its hand (e.g. Chrome Mox).

This commit is contained in:
LevelX2 2015-10-22 01:00:17 +02:00
parent 1758b62f58
commit ae69986aef
3 changed files with 30 additions and 20 deletions

View file

@ -322,9 +322,10 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return target.isChosen();
}
if (target instanceof TargetCardInHand) {
if (target instanceof TargetCardInHand
|| (target.getZone().equals(Zone.HAND) && (target instanceof TargetCard))) {
List<Card> cards = new ArrayList<>();
for (UUID cardId : ((TargetCardInHand) target).possibleTargets(sourceId, this.getId(), game)) {
for (UUID cardId : target.possibleTargets(sourceId, this.getId(), game)) {
Card card = game.getCard(cardId);
if (card != null) {
cards.add(card);