added "blockable" targetchooser, a targetchooser which shows the cards considered "blockable" by source.

corrected an error in ability$! parsing that prevents transforms to use it in newability[

added "block" keyword. and ability.
This commit is contained in:
omegablast2002@yahoo.com
2012-04-02 13:32:50 +00:00
parent 4dfacaa409
commit b705158e13
5 changed files with 110 additions and 1 deletions
+21 -1
View File
@@ -1012,13 +1012,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
}
found = s.find("ability$!");
if (found != string::npos && storedString.empty())
if (found != string::npos && storedAbilityString.empty())
{
size_t real_end = s.find("!$", found);
size_t sIndex = found + 9;
storedAbilityString.append(s.substr(sIndex, real_end - sIndex).c_str());
s.erase(sIndex, real_end - sIndex);
}
else
{
found = unchangedS.find("ability$!");//did find it in a changed s, try unchanged.
if (found != string::npos && storedAbilityString.empty())
{
size_t real_end = unchangedS.find("!$", found);
size_t sIndex = found + 9;
storedAbilityString.append(unchangedS.substr(sIndex, real_end - sIndex).c_str());
unchangedS.erase(sIndex, real_end - sIndex);
}
}
found = s.find("and!(");
if (found != string::npos && found + 6 != ')' && storedAndAbility.empty())
@@ -2756,6 +2767,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
observer->connectRule = true;
return NULL;
}
//standard block
found = s.find("block");
if (found != string::npos)
{
MTGAbility * a = NEW AABlock(observer, id, card, target);
a->oneShot = 1;
return a;
}
//create an association between cards.
found = s.find("connect");
if (found != string::npos)