Support for KLD and AER

Kaladesh & Aether Revolt
This commit is contained in:
Anthony Calosa
2017-01-18 22:13:51 +08:00
parent d86b9119a4
commit d03ebdace8
14 changed files with 306 additions and 20 deletions

View File

@@ -329,6 +329,37 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
if(!count)
return 0;
}
check = restriction[i].find("revolt");
if(check != string::npos)
{
int count = 0;
for(unsigned int k = 0; k < player->game->hand->cardsSeenThisTurn.size(); k++)
{
MTGCardInstance * tCard = player->game->hand->cardsSeenThisTurn[k];
if(tCard && tCard->previousZone == card->controller()->game->battlefield)
count++;
}
for(unsigned int k = 0; k < player->game->exile->cardsSeenThisTurn.size(); k++)
{
MTGCardInstance * tCard = player->game->exile->cardsSeenThisTurn[k];
if(tCard && tCard->previousZone == card->controller()->game->battlefield)
count++;
}
for(unsigned int k = 0; k < player->game->library->cardsSeenThisTurn.size(); k++)
{
MTGCardInstance * tCard = player->game->library->cardsSeenThisTurn[k];
if(tCard && tCard->previousZone == card->controller()->game->battlefield)
count++;
}
for(unsigned int k = 0; k < player->game->graveyard->cardsSeenThisTurn.size(); k++)
{
MTGCardInstance * tCard = player->game->graveyard->cardsSeenThisTurn[k];
if(tCard && tCard->previousZone == card->controller()->game->battlefield)
count++;
}
if(!count)
return 0;
}
check = restriction[i].find("morbid");
if(check != string::npos)
{
@@ -2949,6 +2980,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//alter energy
vector<string> splitEnergy = parseBetween(s, "alterenergy:", " ", false);
if (splitEnergy.size())
{
int energy = atoi(splitEnergy[1].c_str());
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AAAlterEnergy(observer, id, card, t, energy, NULL, who);
a->oneShot = 1;
return a;
}
//prevent next damage
vector<string> splitPrevent = parseBetween(s, "prevent:", " ", false);
if (splitPrevent.size())