added "twice" and "thrice" variables.

example usage:

auto=life:thriceX
auto=@damaged(player):life:twicethatmuch
auto=life:twicetype:creature:mybattlefield

so to code cards like Debt to the Deathless

[card]
name=Debt to the Deathless
auto=@lifeloss(opponent):life:thatmuch controller
auto=life:-twiceX opponent
text=Each opponent loses two times X life. You gain life equal to the life lost this way.
mana={X}{W}{W}{B}{B}
type=Sorcery
[/card]
This commit is contained in:
anthonycalosa@gmail.com
2013-05-07 07:27:45 +00:00
parent a7e9fe6699
commit 07fdf735f5
+18
View File
@@ -62,6 +62,8 @@ private:
intValue = 0; intValue = 0;
bool halfup = false; bool halfup = false;
bool halfdown = false; bool halfdown = false;
bool twice = false;
bool thrice = false;
if (!target) target = card; if (!target) target = card;
int multiplier = 1; int multiplier = 1;
if (s[0] == '-') if (s[0] == '-')
@@ -98,6 +100,18 @@ private:
size_t hD = s.find("halfdown"); size_t hD = s.find("halfdown");
s.erase(hD,hD + 8); s.erase(hD,hD + 8);
} }
if(s.find("twice") != string::npos)
{
twice = true;
size_t tXX = s.find("twice");
s.erase(tXX,tXX + 5);
}
if(s.find("thrice") != string::npos)
{
thrice = true;
size_t tXXX = s.find("thrice");
s.erase(tXXX,tXXX + 6);
}
if(s == "prex") if(s == "prex")
{ {
ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost()); ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost());
@@ -389,6 +403,10 @@ private:
} }
if(halfdown) if(halfdown)
intValue = intValue/2; intValue = intValue/2;
if(twice)
intValue = intValue*2;
if(thrice)
intValue = intValue*3;
} }
intValue *= multiplier; intValue *= multiplier;
} }