support andability in mana producer
so cards that parse mana abilities can be read (reflecting pool. etc.. fixes issue #700 but we need to update the code from add{mana} && do something to add{mana} and!( do something)! )
This commit is contained in:
@@ -538,6 +538,7 @@ protected:
|
||||
Player * controller;
|
||||
|
||||
public:
|
||||
MTGAbility * andAbility;
|
||||
string menutext;
|
||||
ManaCost * output;
|
||||
int tap;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user