change plandtype & olandtype parsing

This commit is contained in:
Anthony Calosa
2016-08-19 23:34:01 +08:00
parent 8d7b9293b5
commit 60411027ca
6 changed files with 127 additions and 46 deletions

View File

@@ -3449,6 +3449,35 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
//Mana Producer
found = s.find("add");
if (found != string::npos)
{
bool doesntEmptyTilueot = s.find("doesntempty") != string::npos;
ManaCost * output = ManaCost::parseManaCost(s.substr(found),NULL,card);
Targetable * t = spell ? spell->getNextTarget() : NULL;
if(output->getConvertedCost() > 0)
{
if(output->hasColor(Constants::MTG_COLOR_ARTIFACT)||output->hasColor(Constants::MTG_COLOR_WASTE))
card->canproduceC = 1;
if(output->hasColor(Constants::MTG_COLOR_GREEN))
card->canproduceG = 1;
if(output->hasColor(Constants::MTG_COLOR_BLUE))
card->canproduceU = 1;
if(output->hasColor(Constants::MTG_COLOR_RED))
card->canproduceR = 1;
if(output->hasColor(Constants::MTG_COLOR_BLACK))
card->canproduceB = 1;
if(output->hasColor(Constants::MTG_COLOR_WHITE))
card->canproduceW = 1;
}
MTGAbility * a = NEW AManaProducer(observer, id, card, t, output, NULL, who,s.substr(found),doesntEmptyTilueot);
a->oneShot = 1;
if(newName.size())
((AManaProducer*)a)->menutext = newName;
return a;
}
//another mana producer exempted for canproduce
found = s.find("out");
if (found != string::npos)
{
bool doesntEmptyTilueot = s.find("doesntempty") != string::npos;
ManaCost * output = ManaCost::parseManaCost(s.substr(found),NULL,card);