Added 2XM set, fixed card and planeswalkers primitives, fixed a crash on token creation, fixed prowess and mentor abilities, added new restrictions, improved Android downloader.

This commit is contained in:
valfieri
2020-08-08 19:46:07 +02:00
parent 52e3177ef2
commit 727d4579a0
11 changed files with 5147 additions and 2316 deletions

View File

@@ -803,6 +803,28 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
{
restriction.push_back("lastturn(*[-token]|opponentstack,opponentbattlefield)~lessthan~1");
}
check = restriction[i].find("control three or more lands with same name");
if(check != string::npos)
{
if(player != observer->currentPlayer)
return 0;
bool found = false;
for(unsigned int i = 0; i < observer->currentPlayer->game->inPlay->cards.size() && !found; i++){
if(observer->currentPlayer->game->inPlay->cards[i]->hasType("land")){
for(unsigned int j = i+1; j < observer->currentPlayer->game->inPlay->cards.size() && !found; j++){
if(observer->currentPlayer->game->inPlay->cards[j]->hasType("land") && observer->currentPlayer->game->inPlay->cards[j]->name == observer->currentPlayer->game->inPlay->cards[i]->name){
for(unsigned int k = j+1; k < observer->currentPlayer->game->inPlay->cards.size() && !found; k++){
if(observer->currentPlayer->game->inPlay->cards[k]->hasType("land") && observer->currentPlayer->game->inPlay->cards[k]->name == observer->currentPlayer->game->inPlay->cards[i]->name){
found = true;
}
}
}
}
}
}
if(!found)
return 0;
}
check = restriction[i].find("paid(");
if(check != string::npos)
{