From f28fbafd5c7c7bd146e20958cbff9aff18bfb37d Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 20 Aug 2014 10:38:59 +0400 Subject: [PATCH] Fixed Genesis Hydra not allowing to cancel choosing nonland permanent --- .../src/mage/sets/magic2015/GenesisHydra.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java index f57e564a9f..97838e4d21 100644 --- a/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java +++ b/Mage.Sets/src/mage/sets/magic2015/GenesisHydra.java @@ -27,7 +27,6 @@ */ package mage.sets.magic2015; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.SpellAbility; @@ -55,6 +54,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.TargetCard; +import java.util.UUID; + /** @@ -165,14 +166,20 @@ class GenesisHydraPutOntoBattlefieldEffect extends OneShotEffect { filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, count + 1)); TargetCard target1 = new TargetCard(Zone.LIBRARY, filter); - if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0 - && controller.choose(Outcome.PutCardInPlay, cards, target1, game)) { - Card card = cards.get(target1.getFirstTarget(), game); - if (card != null) { - cards.remove(card); - controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + target1.setRequired(false); + if (cards.count(filter, controller.getId(), source.getSourceId(), game) > 0) { + if (controller.choose(Outcome.PutCardInPlay, cards, target1, game)) { + Card card = cards.get(target1.getFirstTarget(), game); + if (card != null) { + cards.remove(card); + controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId()); + } + target1.clearChosen(); + } else { + game.informPlayers(controller.getName() + " didn't choose anything"); } - target1.clearChosen(); + } else { + game.informPlayers("No nonland permanent card with converted mana cost " + count + " or less to choose."); } while (cards.size() > 0) { Card card = cards.get(cards.iterator().next(), game);