diff --git a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java index c9853a17c9..3fb47b66b5 100644 --- a/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java +++ b/Mage.Sets/src/mage/sets/shadowmoor/PuppeteerClique.java @@ -69,7 +69,6 @@ public class PuppeteerClique extends CardImpl { this.subtype.add("Faerie"); this.subtype.add("Wizard"); - this.color.setBlack(true); this.power = new MageInt(3); this.toughness = new MageInt(2); @@ -115,7 +114,7 @@ class PuppeteerCliqueEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean result = false; - Card card = game.getCard(source.getFirstTarget()); + Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { Player you = game.getPlayer(source.getControllerId()); if (you != null) { @@ -125,7 +124,7 @@ class PuppeteerCliqueEffect extends OneShotEffect { ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom); hasteEffect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(hasteEffect, source); - ExileTargetEffect exileEffect = new ExileTargetEffect(new StringBuilder("exile ").append(permanent.getName()).toString()); + ExileTargetEffect exileEffect = new ExileTargetEffect("exile " + permanent.getLogName()); exileEffect.setTargetPointer(new FixedTarget(card.getId())); DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect, TargetController.YOU); delayedAbility.setSourceId(source.getSourceId()); diff --git a/Mage/src/mage/filter/FilterCard.java b/Mage/src/mage/filter/FilterCard.java index 3d58f08202..97cb529a05 100644 --- a/Mage/src/mage/filter/FilterCard.java +++ b/Mage/src/mage/filter/FilterCard.java @@ -95,7 +95,6 @@ public class FilterCard extends FilterObject { if (!this.match(card, game)) { return false; } - return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(card, sourceId, playerId), game); } diff --git a/Mage/src/mage/target/common/TargetCardInOpponentsGraveyard.java b/Mage/src/mage/target/common/TargetCardInOpponentsGraveyard.java index faa1ab2d90..202572c0b5 100644 --- a/Mage/src/mage/target/common/TargetCardInOpponentsGraveyard.java +++ b/Mage/src/mage/target/common/TargetCardInOpponentsGraveyard.java @@ -8,6 +8,8 @@ import mage.game.Game; import mage.target.TargetCard; import java.util.UUID; +import mage.game.events.GameEvent; +import mage.players.Player; public class TargetCardInOpponentsGraveyard extends TargetCard { @@ -52,9 +54,37 @@ public class TargetCardInOpponentsGraveyard extends TargetCard { @Override public boolean canChoose(UUID sourceControllerId, Game game) { - return true; + return canChoose(null, sourceControllerId, game); + } + + /** + * Checks if there are enough {@link Card} that can be chosen. + * + * @param sourceId - the target event source + * @param sourceControllerId - controller of the target event source + * @param game + * @return - true if enough valid {@link Card} exist + */ + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + int possibleTargets = 0; + for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) { + if (!playerId.equals(sourceControllerId)) { + Player player = game.getPlayer(playerId); + if (player != null) { + for (Card card : player.getGraveyard().getCards(filter, sourceId, sourceControllerId, game)) { + if (sourceId == null || isNotTarget() || !game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.TARGET, card.getId(), sourceId, sourceControllerId))) { + possibleTargets++; + if (possibleTargets >= this.minNumberOfTargets) { + return true; + } + } + } + } + } + } + return false; } - @Override public TargetCardInOpponentsGraveyard copy() { return new TargetCardInOpponentsGraveyard(this);