- added counters to parser. They can be used as an effect, not a cost!!! counter(p/t,n) where n is the number of counters. if n is ommitted, it is 1, if it is negative, it means "remove" counter
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-07-21 11:10:30 +00:00
parent 678acc0c7a
commit 7f93e03c9f
6 changed files with 98 additions and 41 deletions
+13 -10
View File
@@ -128,6 +128,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell
//Parses a string and returns the corresponding MTGAbility object
// Returns NULL if parsing failed
MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated){
@@ -497,25 +498,27 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
}
return NULL;
}
/*
//counter
found = s.find("counter(");
if (found != string::npos){
int end = s.find(")", found);
string spt = s.substr(9,end - 1);
found+=8;
int nb = 1;
size_t end = s.find(")", found);
size_t separator = s.find(",", found);
if (separator != string::npos){
nb = atoi(s.substr(found,separator-found).c_str());
end = separator;
}
string spt = s.substr(found,end-found);
int power, toughness;
if ( parsePowerToughness(spt,&power, &toughness)){
if(tc){
//TODO
}else{
return NEW ACounters(id,card,target,power,toughness);
}
return NEW AACounter(id,card,target,power,toughness,nb);
}
return NULL;
}
*/
//Change Power/Toughness
@@ -783,7 +786,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
magicText = "";
}
MTGAbility * a = parseMagicLine(line, result, spell, card);
MTGAbility * a = parseMagicLine(line, result, spell, card);
if (dryMode){
result = abilityEfficiency(a, card->controller(),MODE_PUTINTOPLAY);
SAFE_DELETE(a);