corrected Prismatic omen issue,
added newability[whatever ability] to transforms classes.
this allows for transforms to also add activated or mtgabilities to cards it targets.
example Prismatic omen:
auto=lord(land|myBattlefield) transforms(plains forest mountain swamp island,newability[{t}:add{w}],newability[{t}:add{g}],newability[{t}:add{r}],newability[{t}:add{b}],newability[{t}:add{u}])
Issue: 573
This commit is contained in:
@@ -2527,7 +2527,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
bool newtoughnessfound = false;
|
||||
string newtoughness = "";
|
||||
vector <string> abilities = split(sabilities, ',');
|
||||
|
||||
bool newAbilityFound = false;
|
||||
vector<MTGAbility *> newAbilitiesList;
|
||||
|
||||
for(unsigned int j = 0;j < abilities.size();j++)
|
||||
{
|
||||
if(abilities[j].find("setpower=") != string::npos)
|
||||
@@ -2542,19 +2544,26 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
int toughnessstart = abilities[j].find("settoughness=");
|
||||
newtoughness = abilities[j].substr(toughnessstart + 13).c_str();
|
||||
}
|
||||
if(abilities[j].find("newability[") != string::npos)
|
||||
{
|
||||
newAbilityFound = true;
|
||||
size_t NewSkill = abilities[j].find("[");
|
||||
string newAbilities = abilities[j].substr(NewSkill + 1,abilities[j].find(']') - 1);
|
||||
newAbilitiesList.push_back(parseMagicLine(newAbilities, id, spell, card));
|
||||
}
|
||||
}
|
||||
MTGAbility * a;
|
||||
if (forceFOREVER)
|
||||
{
|
||||
a = NEW ATransformerFOREVER(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound);
|
||||
a = NEW ATransformerFOREVER(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound);
|
||||
}
|
||||
else if (forceUEOT)
|
||||
{
|
||||
a = NEW ATransformerUEOT(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound);
|
||||
a = NEW ATransformerUEOT(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound);
|
||||
}
|
||||
else
|
||||
{
|
||||
a = NEW ATransformer(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound);
|
||||
a = NEW ATransformer(id, card, target, stypes, sabilities,newpower,newpowerfound,newtoughness,newtoughnessfound,newAbilitiesList,newAbilityFound);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user