From f264ac5032a746035b455d221f1d5ec6472bdbff Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 30 Jun 2019 11:20:35 +0400 Subject: [PATCH] [M20] fixed Flood of Tears --- Mage.Sets/src/mage/cards/f/FloodOfTears.java | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/f/FloodOfTears.java b/Mage.Sets/src/mage/cards/f/FloodOfTears.java index 72684580ff..875665d1db 100644 --- a/Mage.Sets/src/mage/cards/f/FloodOfTears.java +++ b/Mage.Sets/src/mage/cards/f/FloodOfTears.java @@ -27,7 +27,8 @@ public final class FloodOfTears extends CardImpl { public FloodOfTears(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{U}{U}"); - // Return all nonland permanents to their owners' hands. If you return four or more nontoken permanents you control this way, you may put a permanent card from your hand onto the battlefield. + // Return all nonland permanents to their owners' hands. If you return four or more nontoken permanents you control this way, + // you may put a permanent card from your hand onto the battlefield. this.getSpellAbility().addEffect(new FloodOfTearsEffect()); } @@ -45,7 +46,8 @@ class FloodOfTearsEffect extends OneShotEffect { FloodOfTearsEffect() { super(Outcome.Benefit); - staticText = ""; + staticText = "Return all nonland permanents to their owners' hands. If you return four or more nontoken permanents you control this way," + + " you may put a permanent card from your hand onto the battlefield."; } private FloodOfTearsEffect(final FloodOfTearsEffect effect) { @@ -67,12 +69,18 @@ class FloodOfTearsEffect extends OneShotEffect { StaticFilters.FILTER_PERMANENT_NON_LAND, source.getControllerId(), source.getSourceId(), game ); Cards cards = new CardsImpl(); - nonlands.stream().forEach(permanent -> cards.add(permanent)); - boolean putIntoPlay = nonlands.stream().filter(permanent -> !(permanent instanceof Token)).count() > 3; - player.moveCards(cards, Zone.HAND, source, game); - if (putIntoPlay) { - return new PutCardFromHandOntoBattlefieldEffect().apply(game, source); + if (cards.size() > 0) { + nonlands.stream().forEach(permanent -> cards.add(permanent)); + boolean putIntoPlay = nonlands.stream() + .filter(permanent -> permanent.isControlledBy(player.getId())) + .filter(permanent -> !(permanent instanceof Token)) + .count() > 3; + player.moveCards(cards, Zone.HAND, source, game); + if (putIntoPlay) { + new PutCardFromHandOntoBattlefieldEffect().apply(game, source); + } + return true; } - return true; + return false; } } \ No newline at end of file