fixed Covetous Urge (now it put all cards in same exile window, fixed wrong AI);

This commit is contained in:
Oleg Agafonov 2020-01-13 14:26:39 +04:00
parent f15d5d34f1
commit 7a1e62ec34

View file

@ -70,24 +70,25 @@ class CovetousUrgeEffect extends OneShotEffect {
return false; return false;
} }
player.revealCards(source, player.getHand(), game); player.revealCards(source, player.getHand(), game);
if (!controller.chooseUse(outcome, "Choose a nonland card to exile?", source, game)) {
return false; 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
TargetCard target;
if (player.getGraveyard().isEmpty() || controller.chooseUse(outcome,
"Exile a nonland card from " + player.getName() + "'s hand or graveyard", "Exile a nonland card from " + player.getName() + "'s hand or graveyard",
"", "Hand", "Graveyard", source, game)) { "", "Hand", "Graveyard", source, game)) {
if (player.getHand().isEmpty()) { if (player.getHand().isEmpty()) {
return true; return true;
} }
target = new TargetCard(Zone.HAND, StaticFilters.FILTER_CARD_A_NON_LAND); 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 { } else {
target = new TargetCard(Zone.GRAVEYARD, StaticFilters.FILTER_CARD_A_NON_LAND); 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()); 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; return false;
} }
if (card.getSpellAbility() == null) { if (card.getSpellAbility() == null) {