@Override public void remove(Card card) { if (card == null) { return; } this.remove(card.getId()); }
Permanent permanent = game.getPermanent(target.getFirstTarget()); if (permanent != null) { cards.remove(permanent); permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { CardsImpl toReveal = new CardsImpl(); Card toBattlefield = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); game.fireUpdatePlayersEvent(); if (card.isArtifact()) { toBattlefield = card; break; } } controller.revealCards(source, toReveal, game); controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game); int damage = toReveal.size(); toReveal.remove(toBattlefield); controller.putCardsOnBottomOfLibrary(toReveal, game, source, false); controller.damage(damage, source.getSourceId(), game, false, true); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller == null || sourceObject == null) { return false; } CardsImpl cards = new CardsImpl(); cards.addAll(controller.getLibrary().getTopCards(game, 1)); controller.revealCards(sourceObject.getIdName(), cards, game); Set<Card> cardsList = cards.getCards(game); Cards cardsToHand = new CardsImpl(); for (Card card : cardsList) { if (card.isCreature()) { cardsToHand.add(card); cards.remove(card); } } controller.moveCards(cardsToHand, Zone.HAND, source, game); return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { CardsImpl toReveal = new CardsImpl(); Card nonLandCard = null; for (Card card : controller.getLibrary().getCards(game)) { toReveal.add(card); if (!card.isLand() && card.getConvertedManaCost() < 4) { nonLandCard = card; break; } } controller.revealCards(source, toReveal, game); if (nonLandCard != null && controller.chooseUse(outcome, "Cast " + nonLandCard.getLogName() + "without paying its mana cost?", source, game)) { controller.cast(nonLandCard.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game)); toReveal.remove(nonLandCard); } controller.putCardsOnBottomOfLibrary(toReveal, game, source, false); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller == null || sourceObject == null) { return false; } CardsImpl cards = new CardsImpl(); cards.addAll(controller.getLibrary().getTopCards(game, amountCards.calculate(game, source, this))); controller.revealCards(sourceObject.getIdName(), cards, game); Set<Card> cardsList = cards.getCards(game); Cards cardsToHand = new CardsImpl(); for (Card card : cardsList) { if (filter.match(card, game)) { cardsToHand.add(card); cards.remove(card); } } controller.moveCards(cardsToHand, Zone.HAND, source, game); switch (zoneToPutRest) { case LIBRARY: { controller.putCardsOnBottomOfLibrary(cards, game, source, anyOrder); break; } default: controller.moveCards(cards, zoneToPutRest, source, game); } return true; }
Card card = cards.get(target.getFirstTarget(), game); if (card != null) { cards.remove(card); card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
cards.remove(card);
toReveal.remove(nonLandCard);
spellController.choose(Outcome.Copy, copiedCards, target, game); cardToCopy = copiedCards.get(target.getFirstTarget(), game); copiedCards.remove(cardToCopy);