@Override public void lookAtCards(Ability source, String titleSuffix, Cards cards, Game game) { game.getState().getLookedAt(this.playerId).add(CardUtil.createObjectRealtedWindowTitle(source, game, titleSuffix), cards); game.fireUpdatePlayersEvent(); }
@Override public void revealCards(Ability source, String titleSuffix, Cards cards, Game game, boolean postToLog) { if (cards == null || cards.isEmpty()) { return; } if (postToLog) { game.getState().getRevealed().add(CardUtil.createObjectRealtedWindowTitle(source, game, titleSuffix), cards); } else { game.getState().getRevealed().update(CardUtil.createObjectRealtedWindowTitle(source, game, titleSuffix), cards); } if (postToLog && !game.isSimulation()) { StringBuilder sb = new StringBuilder(getLogName()).append(" reveals "); int current = 0, last = cards.size(); for (Card card : cards.getCards(game)) { current++; sb.append(GameLog.getColoredObjectName(card)); if (current < last) { sb.append(", "); } } game.informPlayers(sb.toString()); } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { Card card = player.getLibrary().getFromTop(game); if (card != null) { player.moveCardsToExile(card, source, game, true, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, null)); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } Card card = player.getLibrary().getFromTop(game); if (card == null) { return false; } return player.moveCardsToExile( card, source, game, true, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, null) ); } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.shuffleLibrary(source, game); Card card = controller.getLibrary().getFromTop(game); if (card != null) { UUID exileId = UUID.randomUUID(); controller.moveCardsToExile(card, source, game, true, exileId, CardUtil.createObjectRealtedWindowTitle(source, game, null)); ContinuousEffect effect = new MindsDesireCastFromExileEffect(); effect.setTargetPointer(new FixedTargets(game.getExile().getExileZone(exileId).getCards(game), game)); game.addEffect(effect, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, "<this card may be played the turn it was exiled>")); game.addEffect(new OraclesVaultPlayEffect(new MageObjectReference(card, game)), source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)); ContinuousEffect effect = new ElkinBottleCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { if (controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, "<this card may be played the turn it was exiled>"))) { ContinuousEffect effect = new PropheticFlamespeakerCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, amount.calculate(game, source, this))); if (!cards.isEmpty()) { controller.moveCardsToExile(cards.getCards(game), source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, "")); ContinuousEffect effect = new FlamesOfRemembranceMayPlayExiledEffect(); effect.setTargetPointer(new FixedTargets(cards, game)); game.addEffect(effect, source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Cards toExile = new CardsImpl(controller.getLibrary().getTopCards(game, 7)); UUID exileId = CardUtil.getCardExileZoneId(game, source); controller.moveCardsToExile(toExile.getCards(game), source, game, false, exileId, CardUtil.createObjectRealtedWindowTitle(source, game, null)); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null) { for (Card card : exileZone.getCards(game)) { if (card != null) { card.setFaceDown(true, game); } } } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) { Library library = controller.getLibrary(); Card card = library.getFromTop(game); if (card != null) { controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, " <this card may be played the turn it was exiled>")); game.addEffect(new OraclesVaultPlayForFreeEffect(new MageObjectReference(card, game)), source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); if (opponent != null) { Card card; do { card = opponent.getLibrary().getFromTop(game); if (card != null) { opponent.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)); } } while (card != null && card.isLand()); if (card != null) { ContinuousEffect effect = new StolenGoodsCastFromExileEffect(); effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); game.addEffect(effect, source); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Library library = controller.getLibrary(); if (library.hasCards()) { Card card = library.getFromTop(game); if (card != null && controller.moveCardsToExile(card, source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)) && (card.isInstant() || card.isSorcery())) { ContinuousEffect effect = new NivixAerieOfTheFiremindCanCastEffect(); effect.setTargetPointer(new FixedTarget(card.getId())); game.addEffect(effect, source); } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { Card card = controller.getLibrary().getFromTop(game); if (card != null && controller.moveCardsToExile(card, source, game, false, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, null))) { card.setFaceDown(true, game); Effect returnToHandEffect = new ReturnToHandTargetEffect(); returnToHandEffect.setText("put that face down card into your hand"); returnToHandEffect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game))); game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(returnToHandEffect, TargetController.YOU), source); return true; } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } Cards cards = new CardsImpl(controller.getLibrary().getTopCards(game, 4)); if (!cards.isEmpty()) { TargetCard target1 = new TargetCard(Zone.LIBRARY, filter1); if (controller.choose(Outcome.Detriment, cards, target1, game)) { Card card = cards.get(target1.getFirstTarget(), game); if (card != null) { cards.remove(card); controller.moveCardsToExile(card, source, game, false, CardUtil.getCardExileZoneId(game, source), CardUtil.createObjectRealtedWindowTitle(source, game, "(Imprint)")); card.setFaceDown(true, game); Permanent permanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (permanent != null) { permanent.imprint(card.getId(), game); } } target1.clearChosen(); } controller.putCardsOnBottomOfLibrary(cards, game, source, true); } return true; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (controller != null && player != null) { if (player.getLibrary().hasCards()) { Choice cardChoice = new ChoiceImpl(); cardChoice.setChoices(CardRepository.instance.getNames()); cardChoice.setMessage("Name a card"); if (!player.choose(Outcome.DrawCard, cardChoice, game)) { return false; } String cardName = cardChoice.getChoice(); game.informPlayers(CardUtil.createObjectRealtedWindowTitle(source, game, null) + ", player: " + player.getLogName() + ", named: [" + cardName + ']'); Card card = player.getLibrary().getFromTop(game); if (card != null) { Cards cards = new CardsImpl(card); player.revealCards(source, cards, game); if (CardUtil.haveSameNames(card.getName(), cardName)) { player.moveCards(cards, Zone.HAND, source, game); } else { player.moveCards(cards, Zone.GRAVEYARD, source, game); } } } return true; } return false; }
if (controller != null && sourceObject != null) { controller.moveCardsToExile(controller.getLibrary().getTopCards(game, 8), source, game, true, source.getSourceId(), CardUtil.createObjectRealtedWindowTitle(source, game, null)); ExileZone auguryExileZone = game.getExile().getExileZone(source.getSourceId()); if (auguryExileZone == null) {