added basic support for "X plus one", "X plus two" & "X plus three".

example:

[card]
name=AEther Burst
target=<plusonetype:AEther Burst:graveyard>creature|battlefield
auto=moveto(ownerhand)
text=Return up to X target creatures to their owners' hands, where X is one plus the number of cards named AEther Burst in all graveyards as you cast AEther Burst.
mana={1}{U}
type=Instant
[/card] 

[card]
name=Vitalizing Cascade
auto=life:Xplusthree
text=You gain X plus 3 life.
mana={X}{G}{W}
type=Instant
[/card]
This commit is contained in:
anthonycalosa@gmail.com
2013-05-17 02:09:48 +00:00
parent c286aa02a6
commit 4f915b38c8

View File

@@ -64,6 +64,9 @@ private:
bool halfdown = false;
bool twice = false;
bool thrice = false;
bool plusone = false;
bool plustwo = false;
bool plusthree = false;
if (!target) target = card;
int multiplier = 1;
if (s[0] == '-')
@@ -112,6 +115,24 @@ private:
size_t tXXX = s.find("thrice");
s.erase(tXXX,tXXX + 6);
}
if(s.find("plusone") != string::npos)
{
plusone = true;
size_t pOne = s.find("plusone");
s.erase(pOne,pOne + 7);
}
if(s.find("plustwo") != string::npos)
{
plustwo = true;
size_t pTwo = s.find("plustwo");
s.erase(pTwo,pTwo + 7);
}
if(s.find("plusthree") != string::npos)
{
plusthree = true;
size_t pThree = s.find("plusthree");
s.erase(pThree,pThree + 9);
}
if(s == "prex")
{
ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost());
@@ -407,6 +428,21 @@ private:
intValue = intValue*2;
if(thrice)
intValue = intValue*3;
if(plusone)
intValue = intValue+1;
if(plustwo)
intValue = intValue+2;
if(plusthree)
intValue = intValue+3;
}
else
{
if(plusone)
intValue = intValue+1;
if(plustwo)
intValue = intValue+2;
if(plusthree)
intValue = intValue+3;
}
intValue *= multiplier;
}