public MycosynthWellspring(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{2}"); // When Mycosynth Wellspring enters the battlefield or is put into a graveyard from the battlefield, // you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true), true)); this.addAbility(new DiesTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true), true)); }
@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 SearchLibraryPutInHandEffect(new TargetCardInLibrary(0,3, filter), true).apply(game, source); } }
public SearchLibraryPutInHandEffect(TargetCardInLibrary target, boolean revealCards, boolean forceShuffle, String rulePrefix) { super(target, Outcome.DrawCard); this.revealCards = revealCards; this.forceShuffle = forceShuffle; this.rulePrefix = rulePrefix; setText(); }
public SkyshroudSentinel(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.ELF); this.power = new MageInt(1); this.toughness = new MageInt(1); // When Skyshroud Sentinel enters the battlefield, you may search your library for up to three cards named Skyshroud Sentinel, reveal them, and put them into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 3, filter); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
@Override public boolean apply(Game game, Ability source) { int numYourLands = game.getBattlefield().countAll(new FilterLandPermanent(), source.getControllerId(), game); int numOpponentLands = game.getBattlefield().countAll(new FilterLandPermanent(), this.getTargetPointer().getFirst(game, source), game); new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, (numOpponentLands > numYourLands ? 2 : 1), filter), true).apply(game, source); return true; } }
public HowlingWolf(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); this.subtype.add(SubType.WOLF); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Howling Wolf enters the battlefield, you may search your library for up to three cards named Howling Wolf, reveal them, and put them into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 3, filter); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player == null) { return false; } int critterCount = player.getGraveyard().count(StaticFilters.FILTER_CARD_CREATURE, game); FilterCard filter = new FilterCard("a black card with converted mana cost less than or equal to " + critterCount); filter.add(new ColorPredicate(ObjectColor.BLACK)); filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, critterCount + 1)); return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true).apply(game, source); } }
public DiabolicTutor(UUID ownerId, CardSetInfo setInfo){ super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); TargetCardInLibrary target = new TargetCardInLibrary(); this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target)); }
public DemonicTutor(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); // Search your library for a card and put that card into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(); this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target)); }
public TimeOfNeed(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{G}"); // Search your library for a legendary creature card, reveal it, and put it into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(filter); this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target, true)); }
public LandTax(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); // At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library. this.addAbility(new ConditionalInterveningIfTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 3, StaticFilters.FILTER_CARD_BASIC_LAND), true), TargetController.YOU, true), new OpponentControlsMoreCondition(StaticFilters.FILTER_LANDS), "At the beginning of your upkeep, if an opponent controls more lands than you, you may search your library for up to three basic land cards, reveal them, and put them into your hand. If you do, shuffle your library" )); }
public SylvanRanger(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}"); this.subtype.add(SubType.ELF); this.subtype.add(SubType.SCOUT); this.power = new MageInt(1); this.toughness = new MageInt(1); // When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
public RangerOfEos(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(3); this.toughness = new MageInt(2); // When Ranger of Eos enters the battlefield, you may search your library for up to two creature cards with converted mana cost 1 or less, // reveal them, and put them into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(0, 2, filter); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
public TravelersAmulet(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); // {1}, Sacrifice Traveler's Amulet: Search your library for a basic land card, reveal it, and put it into your hand. Then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(target, true), new GenericManaCost(1)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); }
public DeadeyeQuartermaster(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.PIRATE); this.power = new MageInt(2); this.toughness = new MageInt(2); // When Deadeye Quartermaster enters the battlefield, you may search your library for an Equipment or a Vehicle card and put it into your hand. If you do, shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter); this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
public ElfhameSanctuary(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); // At the beginning of your upkeep, you may search your library for a basic land card, reveal that card, and put it into your hand. If you do, you skip your draw step this turn and shuffle your library. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND)), TargetController.YOU, true); ability.addEffect(new SkipDrawStepThisTurn()); this.addAbility(ability); }
public WelkinHawk(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.subtype.add(SubType.BIRD); this.power = new MageInt(1); this.toughness = new MageInt(1); // Flying this.addAbility(FlyingAbility.getInstance()); // When Welkin Hawk dies, you may search your library for a card named Welkin Hawk, reveal that card, put it into your hand, then shuffle your library. TargetCardInLibrary target = new TargetCardInLibrary(1, 1, filter); this.addAbility(new DiesTriggeredAbility(new SearchLibraryPutInHandEffect(target, true, true), true)); }
public EladamrisCall(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}{W}"); // Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, true)); }
public TotemGuideHartebeest(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); this.subtype.add(SubType.ANTELOPE); this.power = new MageInt(2); this.toughness = new MageInt(5); // When Totem-Guide Hartebeest enters the battlefield, you may search your library for an Aura card, reveal it, put it into your hand, then shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true, false), true)); }
public CateranSummons(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); // Search your library for a Mercenary card, reveal that card, and put it into your hand. Then shuffle your library. this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter), true)); }