From 8d2c6492500c7e693f136c296e934efad62aa12a Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 10 Feb 2019 17:05:35 +0400 Subject: [PATCH] * Epic Experiment - fixed infinite AI choose to cast wrong card (#5023); --- Mage.Sets/src/mage/cards/e/EpicExperiment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/e/EpicExperiment.java b/Mage.Sets/src/mage/cards/e/EpicExperiment.java index f7358be404..ed85156345 100644 --- a/Mage.Sets/src/mage/cards/e/EpicExperiment.java +++ b/Mage.Sets/src/mage/cards/e/EpicExperiment.java @@ -80,12 +80,15 @@ class EpicExperimentEffect extends OneShotEffect { if (controller.choose(Outcome.PlayForFree, cardsToCast, targetCard, game)) { 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.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game))) { 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