added",once" tag for phaseaction, to denote that the effect is only to happen once before forcedestroy is declared.

auto=@movedTo(graveyard) from(this|battlefield):phaseaction[endofturn,once] token(Bird,Creature Bird,4/4,red,flying)
This commit is contained in:
omegablast2002@yahoo.com
2011-04-25 14:48:03 +00:00
parent cf46404ed1
commit 9de076db75
3 changed files with 37 additions and 11 deletions
+29 -4
View File
@@ -1142,11 +1142,26 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
found = s.find("phaseactionmulti");
if (found != string::npos)
{
size_t start = s.find("[");
size_t start = s.find("[");
size_t end = s.find("]", start);
string s1 = s.substr(start + 1, end - start - 1);
int phase = Constants::MTG_PHASE_UPKEEP;
for (int i = 0; i < Constants::NB_MTG_PHASES; i++)
{
if (s1.find(Constants::MTGPhaseCodeNames[i]) != string::npos)
{
phase = i;
}
}
bool opponentturn = true,myturn = true;
if(s1.find("my") != string::npos)
{
opponentturn = false;
}
if(s1.find("opponent") != string::npos)
{
myturn = false;
}
if (s1.find("combatends") != string::npos)
{
phase = Constants::MTG_PHASE_COMBATEND;
@@ -1173,13 +1188,18 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{
next = false;
}
bool once = false;
if (s1.find(",once") != string::npos)
{
once = true;
}
string sAbility = s.substr(end + 1);
MTGCardInstance * _target = NULL;
if (spell)
_target = spell->getNextCardTarget();
if(!_target)
_target = target;
return NEW APhaseActionGeneric(id, card,_target,sAbility, restrictions, phase,sourceinPlay,next);
return NEW APhaseActionGeneric(id, card,_target, sAbility, restrictions, phase,sourceinPlay,next,myturn,opponentturn,once);
}
//Multiple abilities for ONE cost
@@ -1660,13 +1680,18 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{
next = false;
}
bool once = false;
if (s1.find(",once") != string::npos)
{
once = true;
}
string sAbility = s.substr(end + 1);
MTGCardInstance * _target = NULL;
if (spell)
_target = spell->getNextCardTarget();
if(!_target)
_target = target;
return NEW APhaseActionGeneric(id, card,_target, sAbility, restrictions, phase,sourceinPlay,next,myturn,opponentturn);
return NEW APhaseActionGeneric(id, card,_target, sAbility, restrictions, phase,sourceinPlay,next,myturn,opponentturn,once);
}
//Upkeep Cost