support some cards discarded by opponent

This commit is contained in:
Anthony Calosa
2017-03-16 10:58:27 +08:00
parent c73d08187b
commit 44cb0d995e
9 changed files with 227 additions and 372 deletions

View File

@@ -552,6 +552,18 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
return 0;
}
check = restriction[i].find("discardbyopponent");
if(check != string::npos)
{
bool matchOpponent = false;
if(card->discarderOwner)
if(card->controller()->opponent() == card->discarderOwner)
matchOpponent = true;
if(!matchOpponent)
return 0;
}
check = restriction[i].find("copiedacard");
if(check != string::npos)
{