public CardsImpl(Collection<UUID> cardIds) { if (cardIds != null) { this.addAll(cardIds); } }
public CardsImpl(final CardsImpl cards) { this.addAll(cards); this.ownerId = cards.ownerId; }
@Override public boolean apply(Game game, Ability source) { for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { CardsImpl libraryCards = new CardsImpl(); libraryCards.addAll(player.getLibrary().getCards(game)); player.moveCards(libraryCards, Zone.HAND, source, game); } } return true; }
if (player != null) { CardsImpl cards = new CardsImpl(); cards.addAll(player.getLibrary().getTopCards(game, permanentsCount.get(player.getId()))); player.revealCards(sourceObject.getIdName() + " (" + player.getName() + ')', cards, game); cardsRevealed.put(player.getId(), cards);
game.loadCards(cardsToLoad, controller.getId()); CardsImpl cards = new CardsImpl(); cards.addAll(boosterPack); if (controller.choose(Outcome.Benefit, cards, targetCard, game)) { Card card = game.getCard(targetCard.getFirstTarget());
cardsToKeep.addAll(cards);
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { CardsImpl cards = new CardsImpl(); cards.addAll(player.getLibrary().getTopCards(game, 2)); Player you = game.getPlayer(source.getControllerId()); if (you != null) { TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCard()); if (you.choose(Outcome.Benefit, cards, target, game)) { Card card = player.getLibrary().getCard(target.getFirstTarget(), game); card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, 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; } }
TargetCard targetCard = new TargetCard(Zone.HAND, new FilterCard()); CardsImpl cards = new CardsImpl(); cards.addAll(shellGamePile); if (opponent.choose(Outcome.Sacrifice, cards, targetCard, game)) { Card card = game.getCard(targetCard.getFirstTarget());
@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; }
cards.addAll(controller.getLibrary().getTopCards(game, libSize)); controller.revealCards(sourceObject.getIdName(), cards, game);
cards.addAll(controller.getLibrary().getTopCards(game, amount)); controller.revealCards(sourceObject.getIdName(), cards, game); Set<Card> cardsList = cards.getCards(game);
cardsToKeep.addAll(cards); TargetCard targetDiscard = new TargetCard(2, Zone.LIBRARY, new FilterCard("cards to put in graveyard")); if (opponent.choose(Outcome.Discard, cards, targetDiscard, game)) {