From 07fdf735f5695f857f6f9c99d2f700466aa3c600 Mon Sep 17 00:00:00 2001 From: "anthonycalosa@gmail.com" Date: Tue, 7 May 2013 07:27:45 +0000 Subject: [PATCH] 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] --- projects/mtg/include/AllAbilities.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 4df9cf46e..4150c2b8c 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -62,6 +62,8 @@ private: intValue = 0; bool halfup = false; bool halfdown = false; + bool twice = false; + bool thrice = false; if (!target) target = card; int multiplier = 1; if (s[0] == '-') @@ -98,6 +100,18 @@ private: size_t hD = s.find("halfdown"); 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") { ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost()); @@ -389,6 +403,10 @@ private: } if(halfdown) intValue = intValue/2; + if(twice) + intValue = intValue*2; + if(thrice) + intValue = intValue*3; } intValue *= multiplier; }