@Override public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set<UUID> possibleTargets = new HashSet<>(); Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = sourceId; ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { possibleTargets.addAll(exile); } } return possibleTargets; }
@Override public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set<UUID> possibleTargets = new HashSet<>(); Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = CardUtil.getCardExileZoneId(game, sourceId); ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { possibleTargets.addAll(exile); } } return possibleTargets; }
@Override public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { Set<UUID> possibleTargets = new HashSet<>(); Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = CardUtil.getCardExileZoneId(game, sourceId); ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { possibleTargets.addAll(exile); } } return possibleTargets; }
@Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = sourceId; ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { return true; } } return false; }
@Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = CardUtil.getCardExileZoneId(game, sourceId); ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { return true; } } return false; }
@Override public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { Card sourceCard = game.getCard(sourceId); if (sourceCard != null) { UUID exileId = CardUtil.getCardExileZoneId(game, sourceId); ExileZone exile = game.getExile().getExileZone(exileId); if (exile != null && !exile.isEmpty()) { return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { MageObject sourceObject = game.getObject(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); if (sourceObject != null && controller != null) { HashSet<Card> toExile = new HashSet<>(); toExile.addAll(game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), source.getSourceId(), game)); controller.moveCardsToExile(toExile, source, game, true, source.getSourceId(), sourceObject.getIdName()); ExileZone exile = game.getExile().getExileZone(source.getSourceId()); if (exile != null && !exile.isEmpty()) { // Create delayed triggered ability AtTheBeginOfNextEndStepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new PlanarGuideReturnFromExileEffect()); game.addDelayedTriggeredAbility(delayedAbility, source); return true; } return true; } return false; }
while (!exileZone.isEmpty()) { Card card = exileZone.getRandom(game); ManaCosts manaCosts = null;
@Override public boolean apply(Game game, Ability source) { ExileZone zone = game.getExile().getExileZone(source.getSourceId()); if (zone == null || zone.isEmpty()) { return false; } Card reboundCard = zone.get(source.getSourceId(), game); Player player = game.getPlayer(source.getControllerId()); if (player != null && reboundCard != null) { SpellAbility ability = reboundCard.getSpellAbility(); player.cast(ability, game, true, new MageObjectReference(source.getSourceObject(game), game)); zone.remove(reboundCard.getId()); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); if (zone == null || zone.isEmpty()) { return true;
if (exileZones != null && sourceObject != null) { for (ExileZone exileZone : game.getExile().getExileZones()) { if (!exileZone.isEmpty()) { cards.addAll(exileZone.getCards(game));
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { if (permanent.moveToExile(source.getSourceId(), "Long Road Home", source.getSourceId(), game)) { ExileZone exile = game.getExile().getExileZone(source.getSourceId()); // only if permanent is in exile (tokens would be stop to exist) if (exile != null && !exile.isEmpty()) { Card card = game.getCard(permanent.getId()); if (card != null) { //create delayed triggered ability game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility( new LongRoadHomeReturnFromExileEffect(new MageObjectReference(card, game))), source); } } return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { if (permanent.moveToExile(source.getSourceId(), "Otherworldly Journey", source.getSourceId(), game)) { ExileZone exile = game.getExile().getExileZone(source.getSourceId()); // only if permanent is in exile (tokens would be stop to exist) if (exile != null && !exile.isEmpty()) { Card card = game.getCard(permanent.getId()); if (card != null) { //create delayed triggered ability DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OtherworldlyJourneyReturnFromExileEffect(new MageObjectReference(card, game))); game.addDelayedTriggeredAbility(delayedAbility, source); } } return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && permanent != null && sourceObject != null) { if (controller.moveCardsToExile(permanent, source, game, true, source.getSourceId(), sourceObject.getIdName())) { controller.drawCards(permanent.getPower().getValue(), game); ExileZone exile = game.getExile().getExileZone(source.getSourceId()); // only if permanent is in exile (tokens would be stop to exist) if (exile != null && !exile.isEmpty()) { //create delayed triggered ability Effect effect = new VanishIntoMemoryReturnFromExileEffect(); effect.setTargetPointer(new FixedTargets(exile, game)); game.addDelayedTriggeredAbility(new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(effect), source); } return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { String cardName = (String) this.getValue("cardName"); ExileZone searchTheCityExileZone = game.getExile().getExileZone(source.getSourceId()); if (cardName != null && searchTheCityExileZone != null) { for (Card card : searchTheCityExileZone.getCards(game)) { if (CardUtil.haveSameNames(card.getName(), cardName)) { if (card.moveToZone(Zone.HAND, source.getSourceId(), game, true)) { game.informPlayers("Search the City: put " + card.getName() + " into owner's hand"); } searchTheCityExileZone.remove(card); if (searchTheCityExileZone.isEmpty()) { Permanent permanent = game.getPermanent(source.getSourceId()); if (permanent != null) { permanent.sacrifice(source.getSourceId(), game); // extra turn game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false)); } } 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) { UUID exileZoneId = CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()); Cards cardsToHand = null; if (game.getExile().getExileZone(exileZoneId) != null && !game.getExile().getExileZone(exileZoneId).isEmpty()) { cardsToHand = new CardsImpl(game.getExile().getExileZone(exileZoneId)); } for (Card card : controller.getHand().getCards(game)) { card.setFaceDown(true, game); } controller.moveCardsToExile(controller.getHand().getCards(game), source, game, false, exileZoneId, sourceObject.getIdName()); if (cardsToHand != null) { controller.moveCards(cardsToHand.getCards(game), Zone.HAND, source, game, false, true, false, null); } if (game.getExile().getExileZone(exileZoneId) != null) { for (Card card : game.getExile().getExileZone(exileZoneId).getCards(game)) { card.setFaceDown(true, game); } } return true; } return false; } }