Added restriction "during my turn", "during opponent turn".

Added variable "controllerturn", "opponentturn" -> returns integer value if its your turn then 1 if not then 0.

ex. use

restriction=during my turn
otherrestriction=during opponent turn
auto=this(variable{controllerturn}) lord(creature|mybattlefield) 8/0
auto=this(variable{opponentturn}) lord(creature|mybattlefield) 0/8
This commit is contained in:
anthonycalosa@gmail.com
2013-01-18 04:41:24 +00:00
parent fda7166752
commit e67084afb9
2 changed files with 24 additions and 0 deletions

View File

@@ -344,6 +344,18 @@ private:
{
intValue = target->controller()->handsize;
}
else if (s == "controllerturn")//intvalue = 1 if its your turn this(variable{controllerturn})
{
intValue = 0;
if ( target->controller() == target->getObserver()->currentPlayer)
intValue = 1;
}
else if (s == "opponentturn")//intvalue = 1 if its your turn this(variable{opponentturn})
{
intValue = 0;
if ( target->controller()->opponent() == target->getObserver()->currentPlayer)
intValue = 1;
}
else if (s == "phandcount")
{
intValue = target->controller()->game->hand->nb_cards;

View File

@@ -356,6 +356,18 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
if(cPhase < MTG_PHASE_COMBATBEGIN ||cPhase > MTG_PHASE_COMBATEND )
return 0;
}
check = restriction[i].find("during my turn");
if(check != string::npos)
{
if(player != observer->currentPlayer)
return 0;
}
check = restriction[i].find("during opponent turn");
if(check != string::npos)
{
if(player == observer->currentPlayer)
return 0;
}
check = restriction[i].find("control snow land");
if(check != string::npos)
{