mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Epic Experiment - fixed infinite AI choose to cast wrong card (#5023);
This commit is contained in:
parent
dc693e645a
commit
8d2c649250
1 changed files with 6 additions and 3 deletions
|
@ -80,12 +80,15 @@ class EpicExperimentEffect extends OneShotEffect {
|
||||||
if (controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) {
|
if (controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) {
|
||||||
Card card = game.getCard(targetCard.getFirstTarget());
|
Card card = game.getCard(targetCard.getFirstTarget());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
if (controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
if (!controller.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) {
|
||||||
cardsToCast.remove(card);
|
|
||||||
} else {
|
|
||||||
game.informPlayer(controller, "You're not able to cast " + card.getIdName() + " or you canceled the casting.");
|
game.informPlayer(controller, "You're not able to cast " + card.getIdName() + " or you canceled the casting.");
|
||||||
}
|
}
|
||||||
|
cardsToCast.remove(card);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// move cards not cast to graveyard
|
// move cards not cast to graveyard
|
||||||
|
|
Loading…
Reference in a new issue