diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index d9cae6a3b..a197aa5d0 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -45,6 +45,7 @@ lifeforce.txt living_lands.txt lord_of_the_pit.txt lord_of_the_pit2.txt +orcish_lumberjack.txt paralysis.txt paralysis2.txt resurrection.txt diff --git a/projects/mtg/bin/Res/test/orcish_lumberjack.txt b/projects/mtg/bin/Res/test/orcish_lumberjack.txt new file mode 100644 index 000000000..9ea01e22b --- /dev/null +++ b/projects/mtg/bin/Res/test/orcish_lumberjack.txt @@ -0,0 +1,18 @@ +#Testing Sacrifice with orcish lumberjack (Sacrifice a forest to add 3 green mana) +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:2646,2747 +[PLAYER2] +[DO] +2646 +choice 0 +2747 +[ASSERT] +FIRSTMAIN +[PLAYER1] +inplay:2646 +graveyard:2747 +manapool:{G}{G}{G} +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 9b3f89b21..c64239197 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -643,6 +643,7 @@ class AManaProducer: public MTGAbility{ public: AManaProducer(int id, MTGCardInstance * card, ManaCost * _output, ManaCost * _cost = NULL ):MTGAbility(id, card){ LOG("==Creating ManaProducer Object"); + if (!_cost) OutputDebugString("NO COST???\n"); cost = _cost; output=_output; x1 = 10; @@ -722,9 +723,22 @@ class AManaProducer: public MTGAbility{ int reactToClick(MTGCardInstance * _card){ if (!isReactingToClick( _card)) return 0; + OutputDebugString("React To click 1\n"); + if (cost){ + cost->setExtraCostsAction(this, _card); + OutputDebugString("React To click 2\n"); + if (!cost->isExtraPaymentSet()){ + OutputDebugString("React To click 3\n"); + + GameObserver::GetInstance()->waitForExtraPayment = cost->extraCosts; + return 0; + } + GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost); + cost->doPayExtra(); + } source->tapped = 1; currentlyTapping++; - if (cost) GameObserver::GetInstance()->currentlyActing()->getManaPool()->pay(cost); + animation = 1.f; CardGui * cardg = game->mLayers->playLayer()->getByCard(source); if (cardg){ diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index cbf7e8a1b..1b259a14d 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -512,9 +512,9 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ if (dryMode) return BAKA_EFFECT_GOOD; ManaCost * input = ManaCost::parseManaCost(s.substr(0,found)); ManaCost * output = ManaCost::parseManaCost(s.substr(found)); - if (input->getConvertedCost() || doTap){ + if (!input->isNull() || doTap){ SAFE_DELETE(cost); //erk - if (!input->getConvertedCost()){ + if (input->isNull()){ SAFE_DELETE(input); } MTGAbility * a = NEW AManaProducer(id, target, output, input);