added support for "prevent next [number] damage" to player/creature.

This commit is contained in:
omegablast2002@yahoo.com
2010-08-28 19:50:26 +00:00
parent 33d0577366
commit 98d908f403
13 changed files with 99 additions and 19 deletions
+20
View File
@@ -811,6 +811,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
a->oneShot = 1;
return a;
}
//prevent next damage
found = s.find("prevent:");
if (found != string::npos){
size_t start = s.find(":",found);
size_t end = s.find(" ",start);
int preventing;
if (end != string::npos){
preventing = atoi(s.substr(start+1,end-start-1).c_str());
}else{
preventing = atoi(s.substr(start+1).c_str());
}
Targetable * t = NULL;
if (spell) t = spell->getNextPlayerTarget();
MTGAbility * a = NEW AADamagePrevent (id, card, t,preventing,NULL,0,who);
a->oneShot = 1;
return a;
}
//set life total
found = s.find("lifeset");
if (found != string::npos){
@@ -999,6 +1017,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
MTGAbility * a = NEW ABloodThirst(id,card,target,amount);
return a;}
//ManaRedux
found = s.find("colorless:");
if (found != string::npos){