public FarWanderings(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); // Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. // Threshold - If seven or more cards are in your graveyard, instead search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library. Effect effect = new ConditionalOneShotEffect( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 3, StaticFilters.FILTER_CARD_BASIC_LAND), true, true), new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_BASIC_LAND), true, true), new CardsInControllerGraveCondition(7), "Search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library.<br/><br/><i>Threshold</i> — If seven or more cards are in your graveyard, instead search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library."); this.getSpellAbility().addEffect(effect); }
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) { super(target, outcome); this.tapped = tapped; this.forceShuffle = forceShuffle; setText(); }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); FilterCard filter = new FilterPermanentCard(); filter.add(new NamePredicate(permanent.getName())); return new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)).apply(game, source); } }
public OneWithNature(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}"); this.subtype.add(SubType.AURA); // Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.PutLandInPlay)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); // Whenever enchanted creature deals combat damage to a player, you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library. ability = new DealsDamageToAPlayerAttachedTriggeredAbility( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, Outcome.PutLandInPlay) .setText("you may search your library for a basic land card, put that card onto the battlefield tapped, then shuffle your library."), "enchanted creature", true, false, true, TargetController.ANY); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { for (Effect sourceEffect : source.getEffects()) { if (sourceEffect instanceof SearchLibraryPutInPlayEffect) { Cards foundCards = new CardsImpl(((SearchLibraryPutInPlayEffect) sourceEffect).getTargets()); if (!foundCards.isEmpty()) { FixedTargets fixedTargets = new FixedTargets(foundCards, game); UntapTargetEffect untapEffect = new UntapTargetEffect(); untapEffect.setTargetPointer(fixedTargets); untapEffect.apply(game, source); BecomesCreatureTargetEffect becomesCreatureEffect = new BecomesCreatureTargetEffect(new HuntingWildsToken(), false, true, Duration.Custom); becomesCreatureEffect.setTargetPointer(fixedTargets); game.addEffect(becomesCreatureEffect, source); } return true; } } return false; } }
public NaturalConnection(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}"); // Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND); this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(target, true)); }
@Override public boolean apply(Game game, Ability source) { boolean result = false; int destroyedCreatures = 0; for (Target target : source.getTargets()) { if (target instanceof TargetPermanent) { Permanent targetPermanent = game.getPermanent(target.getFirstTarget()); if (targetPermanent != null) { if (targetPermanent.destroy(source.getSourceId(), game, false)) { destroyedCreatures++; } } } } if (destroyedCreatures > 0) { new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(destroyedCreatures, filterForest), true, true).apply(game, source); } return result; } }
public FontOfFertility(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); // {1}{G}, Sacrifice Font of Fertility: Search your library for a basic land card, put it onto the battlefield tapped, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, true, true, Outcome.PutLandInPlay), new ManaCostsImpl("{1}{G}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); }
@Override public boolean apply(Game game, Ability source) { Permanent creature = game.getPermanent(source.getFirstTarget()); if (creature == null) { return false; } FilterCard filter = new FilterCard("a card named " + creature.getName()); filter.add(new NamePredicate(creature.getName())); return new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)).apply(game, source); } }
public NaturesLore(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); // Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, true)); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourcePermanent != null && player != null) { int newConvertedCost = sourcePermanent.getCounters(game).getCount("age"); FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); filter.add(new ConvertedManaCostPredicate(ComparisonType.EQUAL_TO, newConvertedCost)); filter.add(new CardTypePredicate(CardType.CREATURE)); TargetCardInLibrary target = new TargetCardInLibrary(filter); return new SearchLibraryPutInPlayEffect(target).apply(game, source); } return false; } }
public SpoilsOfVictory(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{G}"); // Search your library for a Plains, Island, Swamp, Mountain, or Forest card and put that card onto the battlefield. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), false, Outcome.PutLandInPlay)); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if(player != null) { if(player.chooseUse(Outcome.BoostCreature, "Do you want to to pay {1}{G}?", source, game)) { Cost cost = new ManaCostsImpl("{1}{G}"); if(cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { FilterCard filter = new FilterCard("card named Llanowar Sentinel"); filter.add(new NamePredicate("Llanowar Sentinel")); new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, filter), false, true).apply(game, source); } return true; } } return false; } }
public CircuitousRoute(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); // Search your library for up to two basic lands and/or Gates and put them onto the battlefield tapped. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect( new TargetCardInLibrary(0, 2, filter), true )); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { int numberOfLands = 0; int ownLands = game.getBattlefield().countAll(new FilterLandPermanent(), controller.getId(), game); for (UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)) { if (!playerId.equals(controller.getId())) { if (game.getBattlefield().countAll(new FilterLandPermanent(), playerId, game) > ownLands + 1) { numberOfLands++; } } } game.informPlayers("Surveyor's Scope: X = " + numberOfLands); // 10/17/2013 If no players control at least two more lands than you when the ability resolves, you'll still search and shuffle your library. return new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, numberOfLands, StaticFilters.FILTER_CARD_BASIC_LAND)).apply(game, source); } return false; } }
public ThreeVisits(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); // Search your library for a Forest card and put that card onto the battlefield. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter))); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.BoostCreature, "Do you want to to pay {X}?", source, game)) { int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source); Cost cost = new GenericManaCost(costX); if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { FilterCard filter = new FilterCard("Equipment card with converted mana cost " + costX + " or less"); filter.add(new SubtypePredicate(SubType.EQUIPMENT)); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, costX + 1)); new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, filter), false, true).apply(game, source); return true; } } return false; } }
public PrimalGrowth(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{G}"); // Kicker-Sacrifice a creature. this.addAbility(new KickerAbility(new SacrificeTargetCost(new TargetControlledCreaturePermanent(FILTER_CONTROLLED_CREATURE_SHORT_TEXT)))); // Search your library for a basic land card, put that card onto the battlefield, then shuffle your library. If Primal Growth was kicked, instead search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LAND), false, true), new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 1, StaticFilters.FILTER_CARD_BASIC_LAND), false, true), KickedCondition.instance, "Search your library for a basic land card, put that card onto the battlefield, then shuffle your library. If this spell was kicked, instead search your library for up to two basic land cards, put them onto the battlefield, then shuffle your library")); }
public RangersPath(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{G}"); // Search your library for up to two Forest cards and put them onto the battlefield tapped. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(0, 2, filter), true)); }
public FlagstonesOfTrokair(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); addSuperType(SuperType.LEGENDARY); // {tap}: Add {W}. this.addAbility(new WhiteManaAbility()); // When Flagstones of Trokair is put into a graveyard from the battlefield, you may search your library for a Plains card and put it onto the battlefield tapped. If you do, shuffle your library. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(FILTER), true, false), true, false)); }