public List<Card> getAllCards(Game game) { List<Card> cards = new ArrayList<>(); for (ExileZone exile : exileZones.values()) { cards.addAll(exile.getCards(game)); } return cards; }
@Override public boolean checkInterveningIfClause(Game game) { ExileZone exileZone = game.getExile().getExileZone(exileZoneId); return exileZone != null && !exileZone.getCards(game).isEmpty(); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (sourceObject != null && controller != null) { ExileZone exile = getExileIfPossible(game, source); if (exile != null) { return controller.moveCards(new LinkedHashSet<>(exile.getCards(game)), Zone.BATTLEFIELD, source, game, false, false, true, null); } } return false; }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && !game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)).getCards(game).isEmpty()) { if (controller.chooseUse(outcome, "Draw a card from the pile you exiled instead drawing from your library?", source, game)) { Card card = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)).getCards(game).iterator().next(); if (card != null) { controller.moveCards(card, Zone.HAND, source, game); } return true; } } return false; }
public ExileView(ExileZone exileZone, Game game) { this.name = exileZone.getName(); this.id = exileZone.getId(); for (Card card: exileZone.getCards(game)) { this.put(card.getId(), new CardView(card, game, false)); } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileZone exile = game.getExile().getExileZone(source.getSourceId()); if (exile != null) { controller.moveCards(exile.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID exileId = source.getSourceId(); ExileZone exileZone = game.getExile().getExileZone(exileId); if (exileZone != null) { return controller.moveCards(exileZone.getCards(game), Zone.GRAVEYARD, source, game); } } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(game.getActivePlayerId()); if (player != null) { Set<Card> cardsInExile = game.getExile().getExileZone(source.getSourceId()).getCards(game); if (cardsInExile != null) { player.moveCardsToGraveyardWithInfo(cardsInExile, source, game, Zone.EXILED); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { ExileZone exile = game.getExile().getExileZone(exileId); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && exile != null) { controller.moveCards(exile.getCards(new FilterCreatureCard(), game), Zone.BATTLEFIELD, source, game, false, false, this.byOwner, null); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); if (exZone != null) { return controller.moveCards(exZone.getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); if (exZone != null) { return controller.moveCards(exZone.getCards(game), Zone.GRAVEYARD, source, game, false, false, true, null); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID exileId = source.getSourceId(); Set<Card> cardsInExile = game.getExile().getExileZone(exileId).getCards(game); if (cardsInExile != null) { controller.moveCards(cardsInExile, 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) { ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); if (exZone != null) { return controller.moveCards(exZone.getCards(game), Zone.HAND, source, game); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { ExileZone exile = game.getExile().getExileZone(exileId); Player controller = game.getPlayer(source.getControllerId()); if (controller != null && exile != null) { switch (zone) { case LIBRARY: controller.putCardsOnTopOfLibrary(exile, game, source, false); break; default: controller.moveCards(exile.getCards(game), zone, source, game, tapped, false, true, null); } return true; } return false; }
@Override public final boolean apply(Game game, Ability source) { Player player = game.getPlayer(game.getActivePlayerId()); if (player != null) { FilterCard filter = new FilterCard(); filter.add(new OwnerIdPredicate(player.getId())); UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), 0); ExileZone exileZone = game.getExile().getExileZone(exileId); return (exileZone != null && !exileZone.getCards(filter, game).isEmpty()); } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { UUID exileId = CardUtil.getExileZoneId(game, source.getSourceId(), 0); Set<Card> cardsInExile = game.getExile().getExileZone(exileId).getCards(game); if (cardsInExile != null) { controller.moveCardsToGraveyardWithInfo(cardsInExile, source, game, Zone.EXILED); return true; } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.CAST_SPELL && game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (object != null) { ExileZone exileZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); if ((exileZone != null)) { for (Card card : exileZone.getCards(game)) { if (CardUtil.haveSameNames(card, object)) { return true; } } } } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(targetPointer.getFirst(game, source)); if (player != null) { ExileZone exZone = game.getExile().getExileZone(source.getSourceId()); if (exZone != null) { Cards exiledCards = new CardsImpl(exZone.getCards(game)); return player.moveCards(exiledCards.getRandom(game), Zone.BATTLEFIELD, source, 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) { int zoneChangeCounter = (sourceObject instanceof PermanentToken) ? source.getSourceObjectZoneChangeCounter() : source.getSourceObjectZoneChangeCounter() - 1; ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), zoneChangeCounter)); if (exile != null) { return controller.moveCards(exile.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null); } } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); if (controller != null && permanent != null) { UUID exileId = CardUtil.getCardExileZoneId(game, source); ExileZone exile = game.getExile().getExileZone(exileId); if (permanent.sacrifice(source.getSourceId(), game)) { controller.moveCards(exile.getCards(game), Zone.BATTLEFIELD, source, game); } return true; } return false; } }