mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Etali, Primal Storm - fixed AI game freeze (#5023);
This commit is contained in:
parent
a20adef1c9
commit
0daf20bbc8
1 changed files with 12 additions and 7 deletions
|
@ -97,6 +97,7 @@ class EtaliPrimalStormEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// cast the possible cards without paying the mana
|
||||
Cards cardsToCast = new CardsImpl();
|
||||
cardsToCast.addAll(currentExiledCards);
|
||||
|
@ -105,17 +106,21 @@ class EtaliPrimalStormEffect extends OneShotEffect {
|
|||
if (!controller.chooseUse(Outcome.PlayForFree, "Cast a" + (alreadyCast ? "nother" : "") + " card exiled with " + sourceObject.getLogName() + " without paying its mana cost?", source, game)) {
|
||||
break;
|
||||
}
|
||||
|
||||
TargetCard targetCard = new TargetCard(1, Zone.EXILED, new FilterCard("nonland card to cast for free"));
|
||||
if (controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) {
|
||||
alreadyCast = true;
|
||||
Card card = game.getCard(targetCard.getFirstTarget());
|
||||
if (card != null) {
|
||||
if (controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
||||
cardsToCast.remove(card);
|
||||
} else {
|
||||
if (!controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) {
|
||||
break;
|
||||
}
|
||||
|
||||
alreadyCast = true;
|
||||
Card card = game.getCard(targetCard.getFirstTarget());
|
||||
if (card != null) {
|
||||
if (!controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayer(controller, "You're not able to cast " + card.getIdName() + " or you canceled the casting.");
|
||||
}
|
||||
}
|
||||
cardsToCast.remove(card);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue