Fix Watchers of the Dead bug when opponent has 1 card in graveyard

This commit is contained in:
Ryan McLeod 2017-04-16 14:16:56 -04:00
parent bf556c1a77
commit 8057b20cbf

View file

@ -34,10 +34,7 @@ import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ExileSourceCost; import mage.abilities.costs.common.ExileSourceCost;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card; import mage.cards.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Zone; import mage.constants.Zone;
@ -103,8 +100,9 @@ class WatchersOfTheDeadEffect extends OneShotEffect {
TargetCard target = new TargetCardInYourGraveyard(2, 2, new FilterCard()); TargetCard target = new TargetCardInYourGraveyard(2, 2, new FilterCard());
target.setNotTarget(true); target.setNotTarget(true);
Cards cardsInGraveyard = opponent.getGraveyard(); Cards cardsInGraveyard = opponent.getGraveyard();
opponent.choose(outcome, cardsInGraveyard, target, game);
if (!cardsInGraveyard.isEmpty()) { if (cardsInGraveyard.size() > 2) {
opponent.choose(outcome, cardsInGraveyard, target, game);
for (Card cardInGraveyard : cardsInGraveyard.getCards(game)) { for (Card cardInGraveyard : cardsInGraveyard.getCards(game)) {
if (!target.getTargets().contains(cardInGraveyard.getId())) { if (!target.getTargets().contains(cardInGraveyard.getId())) {
opponent.moveCardToExileWithInfo(cardInGraveyard, CardUtil.getCardExileZoneId(game, source.getId()), opponent.moveCardToExileWithInfo(cardInGraveyard, CardUtil.getCardExileZoneId(game, source.getId()),