return new SearchLibraryPutInPlayEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
for (UUID cardId: (List<UUID>)target.getTargets()) {
Card card = player.getLibrary().remove(cardId, game);
if (card != null) {
if (card.putOntoBattlefield(game, Zone.HAND, source.getId(), source.getControllerId())) {
if (tapped) {
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null)
permanent.setTapped(true);
}
}
}
}
player.shuffleLibrary(game);
return true;
}
}
return false;
}