Fixed/added primitives, added keyword to alter devotion count, added keyword to target cards with flashback cost, added "duplicatecounters(single)" keyword to add a counter of a specific kind already present on a permanent or a player.

This commit is contained in:
Vittorio Alfieri
2021-01-07 18:56:47 +01:00
parent 4c00dfb3b6
commit eaaa4d783b
13 changed files with 249 additions and 105 deletions

View File

@@ -3488,7 +3488,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//set surveil offset controller (eg. Enhanced Surveillance)
//set surveil offset of a player (eg. Enhanced Surveillance)
vector<string> splitSurveilOffset = parseBetween(s, "altersurvoffset:", " ", false);
if (splitSurveilOffset.size())
{
@@ -3499,6 +3499,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//set devotion offset of a player (eg. Altar of the Pantheon)
vector<string> splitDevotionOffset = parseBetween(s, "alterdevoffset:", " ", false);
if (splitDevotionOffset.size())
{
int devotionOffset = atoi(splitDevotionOffset[1].c_str());
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AAAlterDevotionOffset(observer, id, card, t, devotionOffset, NULL, who);
a->oneShot = 1;
return a;
}
//prevent next damage
vector<string> splitPrevent = parseBetween(s, "prevent:", " ", false);
if (splitPrevent.size())
@@ -3916,6 +3927,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
string counterString = splitDuplicateCounters[1];
if(counterString.find("all") != string::npos)
((AADuplicateCounters*)a)->allcounters = true;
else if(counterString.find("single") != string::npos)
((AADuplicateCounters*)a)->single = true;
return a;
}
//remove single counter of any type