Added new decks for AI, improved "genrand", "altercost" and "changecost" keywords in order to allow the usage of a variable instead of a simple number (e.g. "altercost(colorless, -phandcount)").

This commit is contained in:
Vittorio Alfieri
2021-09-26 12:22:28 +02:00
parent 8ae7439978
commit 9e3caa635d
27 changed files with 1194 additions and 7 deletions

View File

@@ -735,7 +735,8 @@ void WParsedInt::init(string s, Spell * spell, MTGCardInstance * card)
}
else if (s.find("genrand") != string::npos) //Return a random value between 0 and a specific number (minus 1);
{
intValue = std::rand() % atoi(s.substr(7).c_str());
WParsedInt * value = NEW WParsedInt(s.substr(7).c_str(), NULL, card);
intValue = std::rand() % value->getValue();
}
else if (s == "manacost") //Return the converted manacost
{