diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index a95643059..c00d527df 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -538,6 +538,7 @@ protected: Player * controller; public: + MTGAbility * andAbility; string menutext; ManaCost * output; int tap; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5259a2f10..b3453eb74 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -3832,6 +3832,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG a->oneShot = 1; if(newName.size()) ((AManaProducer*)a)->menutext = newName; + if(storedAndAbility.size()) + { + string stored = storedAndAbility; + storedAndAbility.clear(); + ((AManaProducer*)a)->andAbility = parseMagicLine(stored, id, spell, card); + } return a; } @@ -6473,6 +6479,7 @@ AManaProducer::AManaProducer(GameObserver* observer, int id, MTGCardInstance * c Producing = producing; menutext = ""; DoesntEmpty = doesntEmpty; + andAbility = NULL; } int AManaProducer::isReactingToClick(MTGCardInstance * _card, ManaCost * mana) @@ -6512,6 +6519,20 @@ int AManaProducer::resolve() player->getManaPool()->add(output, source); if(DoesntEmpty) player->doesntEmpty->add(output); + if(andAbility) + { + MTGAbility * andAbilityClone = andAbility->clone(); + andAbilityClone->target = source; + if(andAbility->oneShot) + { + andAbilityClone->resolve(); + SAFE_DELETE(andAbilityClone); + } + else + { + andAbilityClone->addToGame(); + } + } return 1; }