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{ ....
This commit is contained in:
omegablast2002@yahoo.com
2011-02-01 14:24:41 +00:00
parent b6dcb0dcd3
commit ea285e673e
2 changed files with 17 additions and 7 deletions

View File

@@ -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);

View File

@@ -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<AManaProducer *> (this))
{
AManaProducer * amp = dynamic_cast<AManaProducer *> (this);
needsTapping = amp->tap;
}
if (needsTapping && source->isInPlay())
{
if (dynamic_cast<AManaProducer *> (this))
{
GameObserver *g = GameObserver::GetInstance();
WEvent * e = NEW WEventCardTappedForMana(source, 0, 1);
g->receiveEvent(e);
}
source->tap();
}
if (dynamic_cast<AManaProducer *> (this))
{
GameObserver *g = GameObserver::GetInstance();
WEvent * e = NEW WEventCardTappedForMana(source, 0, 1);
g->receiveEvent(e);
}
source->tap();
this->resolve();
return 1;
}
fireAbility();
return 1;