add support for yawgmoth's agenda and other similar cards

This commit is contained in:
Anthony Calosa
2015-09-04 12:05:19 +08:00
parent cbb603818a
commit 5175f439a0
3 changed files with 14 additions and 2 deletions
+3 -1
View File
@@ -220,7 +220,9 @@ class Constants
NOLEGEND = 102, NOLEGEND = 102,
CANPLAYFROMGRAVEYARD = 103, CANPLAYFROMGRAVEYARD = 103,
TOKENIZER = 104, TOKENIZER = 104,
NB_BASIC_ABILITIES = 105, MYGRAVEEXILER = 105,
OPPGRAVEEXILER = 106,
NB_BASIC_ABILITIES = 107,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
+3 -1
View File
@@ -133,7 +133,9 @@ const char* Constants::MTGBasicAbilities[] = {
"lure", "lure",
"nolegend", "nolegend",
"canplayfromgraveyard", "canplayfromgraveyard",
"tokenizer"//parallel lives "tokenizer",//parallel lives,
"mygraveexiler",
"oppgraveexiler"
}; };
map<string,int> Constants::MTGBasicAbilitiesMap; map<string,int> Constants::MTGBasicAbilitiesMap;
+8
View File
@@ -321,6 +321,14 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
return card; //Error check return card; //Error check
int doCopy = 1; int doCopy = 1;
//Leyline of the Void, Yawgmoth's Agenda... effect...
for(int i = 0; i < 2; ++i)
{
if ((to == g->players[i]->game->graveyard) && (
g->players[i]->game->battlefield->hasAbility(Constants::MYGRAVEEXILER) ||
g->players[i]->opponent()->game->battlefield->hasAbility(Constants::OPPGRAVEEXILER)))
to = g->players[i]->game->exile;
}
//When a card is moved from inPlay to inPlay (controller change, for example), it is still the same object //When a card is moved from inPlay to inPlay (controller change, for example), it is still the same object
if ((to == g->players[0]->game->inPlay || to == g->players[1]->game->inPlay) && (from == g->players[0]->game->inPlay || from if ((to == g->players[0]->game->inPlay || to == g->players[1]->game->inPlay) && (from == g->players[0]->game->inPlay || from
== g->players[1]->game->inPlay)) == g->players[1]->game->inPlay))