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:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user