* Fixed that Fall of the Thran allowed AI to get back dragons (fixes #4848).

This commit is contained in:
LevelX2 2018-04-24 23:22:29 +02:00
parent e54980f6ae
commit 242e55dcd4
2 changed files with 4 additions and 3 deletions

View file

@ -53,6 +53,7 @@ import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.*;
@ -390,7 +391,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (target.getOriginalTarget() instanceof TargetCardInYourGraveyard
|| target.getOriginalTarget() instanceof TargetCardInASingleGraveyard) {
List<UUID> alreadyTargetted = target.getTargets();
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards(game));
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards((FilterCard) target.getFilter(), game));
while (!cards.isEmpty()) {
Card card = pickTarget(cards, outcome, target, null, game);
if (card != null && alreadyTargetted != null && !alreadyTargetted.contains(card.getId())) {
@ -726,7 +727,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return false;
}
if (target.getOriginalTarget() instanceof TargetCardInYourGraveyard) {
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards(game));
List<Card> cards = new ArrayList<>(game.getPlayer(abilityControllerId).getGraveyard().getCards((FilterCard) target.getFilter(), game));
while (!target.isChosen() && !cards.isEmpty()) {
Card card = pickTarget(cards, outcome, target, source, game);
if (card != null) {

View file

@ -70,7 +70,7 @@ public final class StaticFilters {
static {
FILTER_CARD_CREATURE_YOUR_GRAVEYARD.setLockedFilter(true);
}
public static final FilterCard FILTER_CARD_LAND = new FilterLandCard();
public static final FilterLandCard FILTER_CARD_LAND = new FilterLandCard();
static {
FILTER_CARD_LAND.setLockedFilter(true);