@Override
public boolean surveil(int value, Ability source, Game game) {
GameEvent event = new GameEvent(GameEvent.EventType.SURVEIL, getId(), source == null ? null : source.getSourceId(), getId(), value, true);
if (game.replaceEvent(event)) {
return false;
}
game.informPlayers(getLogName() + " surveils " + event.getAmount());
Cards cards = new CardsImpl();
cards.addAll(getLibrary().getTopCards(game, event.getAmount()));
if (!cards.isEmpty()) {
String text;
if (cards.size() == 1) {
text = "card if you want to put it into your graveyard (Surveil)";
} else {
text = "cards you want to put into your graveyard (Surveil)";
}
TargetCard target = new TargetCard(0, cards.size(), Zone.LIBRARY, new FilterCard(text));
chooseTarget(Outcome.Benefit, cards, target, source, game);
moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game);
cards.removeAll(target.getTargets());
putCardsOnTopOfLibrary(cards, game, source, true);
}
game.fireEvent(new GameEvent(GameEvent.EventType.SURVEILED, getId(), source == null ? null : source.getSourceId(), getId(), event.getAmount(), true));
return true;
}