Fixed primitives, fixed a random crash in ActionStack.cpp, added a way to search wallpaers in theme folder before to search them in the default folder, improved the keyword to retrieve the highest power and toughness of creatures in play, now it's possibile to use "pwr:" and "ths:" instead of "power:" and "toughness:", so it's possibile to use this keyword in variable{} construct too.

This commit is contained in:
Vittorio Alfieri
2021-01-27 11:16:41 +01:00
parent dd844fc25e
commit 024e015dfc
4 changed files with 54 additions and 208 deletions

View File

@@ -303,7 +303,7 @@ void WParsedInt::init(string s, Spell * spell, MTGCardInstance * card)
SAFE_DELETE(counter);
}
}
else if (s.find("convertedcost:") != string::npos || s.find("power:") != string::npos || s.find("toughness:") != string::npos)
else if (s.find("convertedcost:") != string::npos || s.find("power:") != string::npos || s.find("pwr:") != string::npos || s.find("toughness:") != string::npos || s.find("ths:") != string::npos)
{
bool powerCheck = false;
bool toughnessCheck = false;
@@ -314,11 +314,18 @@ void WParsedInt::init(string s, Spell * spell, MTGCardInstance * card)
costCheck = true;
else
{
size_t pos = s.find("pwr:");
if(pos != string::npos)
s.replace(pos, 4, "power:");
convertedType = parseBetween(s,"power:",":");
if(convertedType.size())
if(convertedType.size()){
powerCheck = true;
}
else
{
size_t pos = s.find("ths:");
if(pos != string::npos)
s.replace(pos, 4, "toughness:");
convertedType = parseBetween(s,"toughness:",":");
if(convertedType.size())
toughnessCheck = true;