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;
|
Player * controller;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
MTGAbility * andAbility;
|
||||||
string menutext;
|
string menutext;
|
||||||
ManaCost * output;
|
ManaCost * output;
|
||||||
int tap;
|
int tap;
|
||||||
|
|||||||
@@ -3832,6 +3832,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
if(newName.size())
|
if(newName.size())
|
||||||
((AManaProducer*)a)->menutext = newName;
|
((AManaProducer*)a)->menutext = newName;
|
||||||
|
if(storedAndAbility.size())
|
||||||
|
{
|
||||||
|
string stored = storedAndAbility;
|
||||||
|
storedAndAbility.clear();
|
||||||
|
((AManaProducer*)a)->andAbility = parseMagicLine(stored, id, spell, card);
|
||||||
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6473,6 +6479,7 @@ AManaProducer::AManaProducer(GameObserver* observer, int id, MTGCardInstance * c
|
|||||||
Producing = producing;
|
Producing = producing;
|
||||||
menutext = "";
|
menutext = "";
|
||||||
DoesntEmpty = doesntEmpty;
|
DoesntEmpty = doesntEmpty;
|
||||||
|
andAbility = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AManaProducer::isReactingToClick(MTGCardInstance * _card, ManaCost * mana)
|
int AManaProducer::isReactingToClick(MTGCardInstance * _card, ManaCost * mana)
|
||||||
@@ -6512,6 +6519,20 @@ int AManaProducer::resolve()
|
|||||||
player->getManaPool()->add(output, source);
|
player->getManaPool()->add(output, source);
|
||||||
if(DoesntEmpty)
|
if(DoesntEmpty)
|
||||||
player->doesntEmpty->add(output);
|
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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user