From ea285e673e8b3148e092c047d18667137ff63cce Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Tue, 1 Feb 2011 14:24:41 +0000 Subject: [PATCH] 2 changes here, first AManaProducer abilities will no longer use the stack as per MTG rules, for the most part this worked fine however genericactivedability does not use the reactto click put in place in the mana producer...so an ability which contained a cost other then just {t} was actually useing the stack instead in the fireability function. 2nd change is a bug fix, i noticed that cards which were mana producers which contained a cost but did not contain a {t}: would still tap at first i thought this was graphical, however after further reveiw i noticed that the card was indeed truely tapping...this was happening becuase amaproducer had a defualt of 1 for doTap/tap...and since genericactived ability does not go through the motions of setting the true manaproducers "doTap" which can be witnessed by stepping through the processes...it was defualting to a tap, even tho the cost might have just be {1}:add{ .... --- projects/mtg/include/MTGAbility.h | 2 +- projects/mtg/src/MTGAbility.cpp | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 11cb4d008..2da4acd19 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -409,7 +409,7 @@ class AManaProducer: public ActivatedAbilityTP{ public: ManaCost * output; int tap; - AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 1, int who = TargetChooser::UNSET ); + AManaProducer(int id, MTGCardInstance * card, Targetable * t, ManaCost * _output, ManaCost * _cost = NULL, int doTap = 0, int who = TargetChooser::UNSET ); int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL); int resolve(); int reactToClick(MTGCardInstance * _card); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 60c3cfac4..9324ef489 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -2503,7 +2503,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG Targetable * t = NULL; if (spell) t = spell->getNextTarget(); - MTGAbility * a = NEW AManaProducer(id, card, t, output, NULL, 1, who); + MTGAbility * a = NEW AManaProducer(id, card, t, output, NULL, doTap, who); a->oneShot = 1; return a; } @@ -3947,15 +3947,25 @@ int ActivatedAbility::reactToTargetClick(Targetable * object) abilityCost = previousManaPool->Diff(player->getManaPool()); delete previousManaPool; } + if(dynamic_cast (this)) + { + AManaProducer * amp = dynamic_cast (this); + needsTapping = amp->tap; + } if (needsTapping && source->isInPlay()) { + if (dynamic_cast (this)) + { + GameObserver *g = GameObserver::GetInstance(); + WEvent * e = NEW WEventCardTappedForMana(source, 0, 1); + g->receiveEvent(e); + } + source->tap(); + } if (dynamic_cast (this)) { - GameObserver *g = GameObserver::GetInstance(); - WEvent * e = NEW WEventCardTappedForMana(source, 0, 1); - g->receiveEvent(e); - } - source->tap(); + this->resolve(); + return 1; } fireAbility(); return 1;