target2.setRequired(true);
player.choose(revealed, target2, game);
Card card = revealed.get(target2.getFirstTarget(), game);
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
revealed.remove(card);
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null)
permanent.setTapped(true);
card = revealed.getCards(game).iterator().next();
card.moveToZone(Zone.HAND, source.getId(), game, false);
}
else if (target.getTargets().size() == 1) {
Card card = revealed.getCards(game).iterator().next();
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
Permanent permanent = game.getPermanent(card.getId());
if (permanent != null)
permanent.setTapped(true);
}
player.shuffleLibrary(game);
}
return true;