mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
fixed Covetous Urge (now it put all cards in same exile window, fixed wrong AI);
This commit is contained in:
parent
f15d5d34f1
commit
7a1e62ec34
1 changed files with 9 additions and 8 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue