mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* 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:
parent
607680b78a
commit
5dbd5401fa
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue