@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); } }
@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; } }
@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); } }
@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; } }
@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; } }
@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; } }
@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; } }