add gravecast restriction
if gravecast then do something -> translates when this card was cast from a graveyard
This commit is contained in:
@@ -4389,7 +4389,7 @@ AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTG
|
|||||||
if (_target)
|
if (_target)
|
||||||
target = _target;
|
target = _target;
|
||||||
andAbility = NULL;
|
andAbility = NULL;
|
||||||
if(destination.size() && !named.size() && source->controller()->isAI())
|
if(destination.size() && !named.size())
|
||||||
{
|
{
|
||||||
if(destination.find("library") != string::npos)
|
if(destination.find("library") != string::npos)
|
||||||
named = "Put in Library";
|
named = "Put in Library";
|
||||||
|
|||||||
@@ -314,6 +314,21 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
check = restriction[i].find("gravecast");
|
||||||
|
if(check != string::npos)
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++)
|
||||||
|
{
|
||||||
|
MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k];
|
||||||
|
if(stackCard->next && stackCard->next == card && (card->previousZone == card->controller()->game->graveyard||card->previousZone == card->controller()->opponent()->game->graveyard))
|
||||||
|
count++;
|
||||||
|
if(stackCard == card && (card->previousZone == card->controller()->game->graveyard||card->previousZone == card->controller()->opponent()->game->graveyard))
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if(!count)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
check = restriction[i].find("rebound");
|
check = restriction[i].find("rebound");
|
||||||
if(check != string::npos)
|
if(check != string::npos)
|
||||||
{
|
{
|
||||||
@@ -321,9 +336,9 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
|||||||
for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++)
|
for(unsigned int k = 0; k < player->game->stack->cardsSeenThisTurn.size(); k++)
|
||||||
{
|
{
|
||||||
MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k];
|
MTGCardInstance * stackCard = player->game->stack->cardsSeenThisTurn[k];
|
||||||
if(stackCard->next && stackCard->next == card && card->previousZone == card->controller()->game->hand)
|
if(stackCard->next && stackCard->next == card && (card->previousZone == card->controller()->game->hand||card->previousZone == card->controller()->opponent()->game->hand))
|
||||||
count++;
|
count++;
|
||||||
if(stackCard == card && card->previousZone == card->controller()->game->hand)
|
if(stackCard == card && (card->previousZone == card->controller()->game->hand||card->previousZone == card->controller()->opponent()->game->hand))
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
if(!count)
|
if(!count)
|
||||||
|
|||||||
Reference in New Issue
Block a user