From 7a1e62ec348a65f09f76a8efa26a1ed6b9a32272 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Mon, 13 Jan 2020 14:26:39 +0400 Subject: [PATCH] fixed Covetous Urge (now it put all cards in same exile window, fixed wrong AI); --- Mage.Sets/src/mage/cards/c/CovetousUrge.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/CovetousUrge.java b/Mage.Sets/src/mage/cards/c/CovetousUrge.java index 8a485fd2ed..f92effd19e 100644 --- a/Mage.Sets/src/mage/cards/c/CovetousUrge.java +++ b/Mage.Sets/src/mage/cards/c/CovetousUrge.java @@ -70,24 +70,25 @@ class CovetousUrgeEffect extends OneShotEffect { return false; } player.revealCards(source, player.getHand(), game); - if (!controller.chooseUse(outcome, "Choose a nonland card to exile?", source, game)) { - return false; - } - TargetCard target; - if (player.getGraveyard().isEmpty() || controller.chooseUse(outcome, + + TargetCard target; // TODO: fix skip exile on wrong place (see Nicol Bolas, Dragon-God) + if (player.getGraveyard().isEmpty() || controller.chooseUse(Outcome.Benefit, // AI must use hand first "Exile a nonland card from " + player.getName() + "'s hand or graveyard", "", "Hand", "Graveyard", source, game)) { if (player.getHand().isEmpty()) { return true; } target = new TargetCard(Zone.HAND, StaticFilters.FILTER_CARD_A_NON_LAND); - controller.choose(outcome, player.getHand(), target, game); + controller.choose(Outcome.Exile, player.getHand(), target, game); } else { target = new TargetCard(Zone.GRAVEYARD, StaticFilters.FILTER_CARD_A_NON_LAND); - controller.choose(outcome, player.getGraveyard(), target, game); + controller.choose(Outcome.Exile, player.getGraveyard(), target, game); } + + // use same player's zone for all Covetous Urge instances + UUID exileZone = CardUtil.getExileZoneId(controller.getId() + " - Covetous Urge", game); Card card = game.getCard(target.getFirstTarget()); - if (card == null || !controller.moveCards(card, Zone.EXILED, source, game)) { + if (card == null || !controller.moveCardsToExile(card, source, game, true, exileZone, "Covetous Urge - can cast with any mana")) { return false; } if (card.getSpellAbility() == null) {