mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
updated discard effect to prevent unnecessary choosing from an empty hand (fixes #7064)
This commit is contained in:
parent
91b9e123ab
commit
c6e4a309fe
1 changed files with 8 additions and 3 deletions
|
@ -89,9 +89,14 @@ public class DiscardEachPlayerEffect extends OneShotEffect {
|
|||
}
|
||||
int numberOfCardsToDiscard = Math.min(toDiscard, player.getHand().size());
|
||||
Cards cards = new CardsImpl();
|
||||
Target target = new TargetDiscard(numberOfCardsToDiscard, numberOfCardsToDiscard, StaticFilters.FILTER_CARD, playerId);
|
||||
if (numberOfCardsToDiscard > 0) {
|
||||
Target target = new TargetDiscard(
|
||||
numberOfCardsToDiscard, numberOfCardsToDiscard,
|
||||
StaticFilters.FILTER_CARD, playerId
|
||||
);
|
||||
player.chooseTarget(outcome, target, source, game);
|
||||
cards.addAll(target.getTargets());
|
||||
}
|
||||
cardsToDiscard.put(playerId, cards);
|
||||
}
|
||||
if (randomDiscard) {
|
||||
|
|
Loading…
Reference in a new issue