Added specific life cost. if we use {l}{l}{l} to pay 3 life, and you have 2 life, you cannot afford to pay the cost but instead the game allows it. if we use specific life cost like: {l:3}, the restriction works.

This commit is contained in:
Anthony Calosa
2014-11-27 14:38:55 +08:00
parent 92d52a78be
commit 4f41248978

View File

@@ -159,10 +159,19 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
{ //Mill to exile yourself as a cost (Library 2 Exile)
manaCost->addExtraCost(NEW MillExileCost(tc));
}
else
else if (value == "l")
{ //Life cost
manaCost->addExtraCost(NEW LifeCost(tc));
}
else
{ //Specific Life cost
vector<string>valSplit = parseBetween(value,"l:"," ",false);
if (valSplit.size()) {
WParsedInt* lifetopay = NEW WParsedInt(valSplit[1], NULL, c);
manaCost->addExtraCost(NEW SpecificLifeCost(tc,lifetopay->getValue()));
SAFE_DELETE(lifetopay);
}
}
break;
case 'd': //DiscardRandom cost
if (value == "d")