* Dredge Ability - The effect is no longer active (e.g. for choosing the order of resolution) if not enough cards left in the library.

This commit is contained in:
LevelX2 2015-05-06 15:57:39 +02:00
parent 607680b78a
commit 5dbd5401fa

View file

@ -99,8 +99,9 @@ class DredgeEffect extends ReplacementEffectImpl {
if (player != null && player.getLibrary().size() >= amount
&& player.chooseUse(outcome, new StringBuilder("Dredge ").append(sourceCard.getName()).
append("? (").append(amount).append(" cards go from top of library to graveyard)").toString(), game)) {
if (!game.isSimulation())
if (!game.isSimulation()) {
game.informPlayers(new StringBuilder(player.getName()).append(" dreges ").append(sourceCard.getName()).toString());
}
Cards cardsToGrave = new CardsImpl();
cardsToGrave.addAll(player.getLibrary().getTopCards(game, amount));
player.moveCardsToGraveyardWithInfo(cardsToGrave, source, game, Zone.LIBRARY);
@ -118,6 +119,10 @@ class DredgeEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return event.getPlayerId().equals(source.getControllerId());
if (event.getPlayerId().equals(source.getControllerId())) {
Player controller = game.getPlayer(source.getControllerId());
return controller != null && controller.getLibrary().size() >= amount;
}
return false;
}
}