diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index 0d5483411..9524cedb5 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -1411,7 +1411,7 @@ int AIPlayerBaka::computeActions() } else { - if (nextCardToPlay->sunburst < nextCardToPlay->getManaCost()->getConvertedCost()) + if (nextCardToPlay->sunburst < nextCardToPlay->getManaCost()->getConvertedCost() || nextCardToPlay->getManaCost()->hasX()) { nextCardToPlay->getManaCost()->add(i, 1); nextCardToPlay->getManaCost()->remove(0, 1); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 77b34e4c2..fe930e4ed 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1567,7 +1567,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG size_t end = s.find("]", start); string s1 = s.substr(start + 1, end - start - 1); int phase = Constants::MTG_PHASE_UPKEEP; - + for (int i = 0; i < Constants::NB_MTG_PHASES; i++) + { + if (s1.find(Constants::MTGPhaseCodeNames[i]) != string::npos) + { + phase = i; + } + } if (s1.find("combatends") != string::npos) { phase = Constants::MTG_PHASE_COMBATEND; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 0224bf160..399e18f4a 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -81,7 +81,7 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana) } else { - if (card->sunburst < card->getManaCost()->getConvertedCost()) + if (card->sunburst < card->getManaCost()->getConvertedCost() || card->getManaCost()->hasX()) { card->getManaCost()->add(i, 1); card->getManaCost()->remove(0, 1);