Added / fixed primitives from NEO set, updated missing cards by sets list, improved "removesinglecountertype" ability (added "all" option to remove a specific amount of each kind of counter on a target).

This commit is contained in:
Vittorio Alfieri
2023-06-21 18:31:50 +02:00
parent 1458b4a872
commit 797514521e
8 changed files with 725 additions and 149 deletions
+13 -1
View File
@@ -4851,12 +4851,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if (splitRemoveSpecificCounters.size())
{
int nb = 0;
WParsedInt* parser = NEW WParsedInt(splitRemoveSpecificCounters[1], card);
bool allcounters = false;
string counterString = splitRemoveSpecificCounters[1];
if(counterString.find("all") != string::npos){
allcounters = true;
size_t pos = counterString.find(",all");
if(pos != string::npos)
counterString.replace(pos, 4, "");
pos = counterString.find("all,");
if(pos != string::npos)
counterString.replace(pos, 4, "");
}
WParsedInt* parser = NEW WParsedInt(counterString, card);
if(parser){
nb = parser->intValue;
SAFE_DELETE(parser);
}
MTGAbility * a = NEW AARemoveSingleCounter(observer, id, card, target, NULL, nb);
((AARemoveSingleCounter*)a)->allcounters = allcounters;
a->oneShot = 1;
a->canBeInterrupted = false;
return a;