use of mage.filter.common.FilterBasicLandCard in project mage by magefree.
the class OldGrowthDryadsEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Set<Player> playersThatSearched = new HashSet<>(1);
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player opponent = game.getPlayer(opponentId);
if (opponent != null && opponent.chooseUse(Outcome.PutLandInPlay, "Search your library for a basic land card and put it onto the battlefield tapped?", source, game)) {
TargetCardInLibrary target = new TargetCardInLibrary(new FilterBasicLandCard());
if (opponent.searchLibrary(target, source, game)) {
Card targetCard = opponent.getLibrary().getCard(target.getFirstTarget(), game);
if (targetCard != null) {
opponent.moveCards(targetCard, Zone.BATTLEFIELD, source, game, true, false, false, null);
playersThatSearched.add(opponent);
}
}
}
}
for (Player opponent : playersThatSearched) {
opponent.shuffleLibrary(source, game);
}
return true;
}
Aggregations