public CardsImpl(Card card) { if (card != null) { this.add(card.getId()); } }
@Override public void addAll(List<Card> cards) { for (Card card : cards) { add(card.getId()); } }
public CardsImpl(Set<Card> cards) { for (Card card : cards) { this.add(card.getId()); } }
@Override public void addAll(Set<Card> cards) { for (Card card : cards) { add(card.getId()); } }
@Override public void add(Card card) { this.add(card.getId()); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(getTargetPointer().getFirst(game, source)); if (controller == null) { return false; } CardsImpl toGraveyard = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { if (card != null) { toGraveyard.add(card); if (card.isLand()) { break; } } } controller.revealCards(source, toGraveyard, game); controller.moveCards(toGraveyard, Zone.GRAVEYARD, source, game); return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards("Etherwrought Page", cards, game); if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", source, game)) { return controller.moveCards(card, Zone.GRAVEYARD, source, game); } return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && controller.getLibrary().hasCards()) { CardsImpl cards = new CardsImpl(); for (Card card : controller.getLibrary().getCards(game)) { cards.add(card); if (!card.isLand()) { break; } } controller.revealCards(source, cards, game); controller.moveCards(cards, Zone.HAND, source, game); 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) { if (!controller.getHand().isEmpty()) { CardsImpl randomCard = new CardsImpl(); Card card = controller.getHand().getRandom(game); randomCard.add(card); controller.revealCards(sourceObject.getIdName(), randomCard, game); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards("Think Tank", cards, game); if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", source, game)) { return controller.moveCards(card, Zone.GRAVEYARD, source, game); } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { if (controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards("Rummaging Wizard", cards, game); if (controller.chooseUse(Outcome.Neutral, "Do you wish to put the card into your graveyard?", source, game)) { return controller.moveCards(card, Zone.GRAVEYARD, source, game); } } } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); if(targetPlayer != null && controller != null) { if(targetPlayer.getLibrary().hasCards()) { // reveal the top card of target player's library. Card topCard = targetPlayer.getLibrary().getFromTop(game); CardsImpl reveal = new CardsImpl(); reveal.add(topCard); targetPlayer.revealCards(source, reveal, game); // You gain life equal to that card's converted mana cost. if (topCard != null) { controller.gainLife(topCard.getConvertedManaCost(), game, source); } } 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 (sourceObject == null || controller == null) { return false; } if (controller.getLibrary().hasCards()) { CardsImpl cards = new CardsImpl(); Card card = controller.getLibrary().getFromTop(game); if (card == null) { return false; } cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); if (card.isLand()) { return controller.moveCards(card, Zone.BATTLEFIELD, source, game); } else { controller.moveCards(card, Zone.HAND, source, game); } } return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject == null || controller == null) { return false; } if (controller.getLibrary().hasCards()) { CardsImpl cards = new CardsImpl(); Card card = controller.getLibrary().getFromTop(game); if (card == null) { return false; } cards.add(card); controller.revealCards(sourceObject.getName(), cards, game); if (card.isLand()) { controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null); } else { controller.drawCards(1, game); } } return true; } }
@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) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards(sourceObject.getIdName(), cards, game); if (card.isSnow()) { if (controller.chooseUse(outcome, "Reveal " + card.getLogName() + " and put it into your hand?", source, game)) { controller.moveCards(card, Zone.HAND, source, game); controller.revealCards(sourceObject.getIdName(), cards, 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 (sourceObject != null && controller != null && controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards(sourceObject.getName(), cards, game); if (card.isCreature()) { if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) { controller.moveCards(card, Zone.HAND, source, game); controller.revealCards(sourceObject.getIdName(), cards, 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 (sourceObject != null && controller != null && controller.getLibrary().hasCards()) { Card card = controller.getLibrary().getFromTop(game); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); controller.lookAtCards(sourceObject.getIdName(), cards, game); if (!card.isCreature() && !card.isLand()) { if (controller.chooseUse(outcome, "Reveal " + card.getLogName() + " and put it into your hand?", source, game)) { controller.moveCards(card, Zone.HAND, source, game); controller.revealCards(sourceObject.getIdName(), cards, game); } } return true; } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (sourceObject == null || targetPlayer == null || controller == null) { return false; } if (targetPlayer.getLibrary().hasCards()) { CardsImpl cards = new CardsImpl(); Card card = targetPlayer.getLibrary().getFromTop(game); if (card == null) { return false; } cards.add(card); targetPlayer.revealCards(sourceObject.getIdName(), cards, game); if (card.isLand()) { controller.gainLife(1, game, source.getSourceId()); } targetPlayer.shuffleLibrary(source, game); } return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (controller != null && sourcePermanent != null) { Spell spell = (Spell) game.getStack().getStackObject(targetPointer.getFirst(game, source)); if (spell != null) { Card topcard = controller.getLibrary().getFromTop(game); if (topcard != null) { CardsImpl cards = new CardsImpl(); cards.add(topcard); controller.revealCards(sourcePermanent.getName(), cards, game); if (topcard.getConvertedManaCost() == spell.getConvertedManaCost()) { return game.getStack().counter(spell.getId(), source.getSourceId(), game); } } return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (player != null && controller != null && sourceObject != null) { TargetCard targetCard = new TargetCard(Zone.ALL, new FilterNonlandCard()); targetCard.setRequired(false); if (controller.choose(Outcome.Discard, player.getHand(), targetCard, game)) { Card card = game.getCard(targetCard.getFirstTarget()); if (card != null) { CardsImpl cards = new CardsImpl(); cards.add(card); player.revealCards(sourceObject.getIdName(), cards, game); player.putCardsOnBottomOfLibrary(cards, game, source, true); player.drawCards(1, game); } } return true; } return false; }