@@ -68962,7 +68962,6 @@ toughness=1
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Mirror Gallery
|
name=Mirror Gallery
|
||||||
abilities=nolegend
|
|
||||||
auto=lord(*|battlefield) nolegend
|
auto=lord(*|battlefield) nolegend
|
||||||
text=The "legend rule" doesn't apply.
|
text=The "legend rule" doesn't apply.
|
||||||
mana={5}
|
mana={5}
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ class GameObserver{
|
|||||||
void Affinity();
|
void Affinity();
|
||||||
bool AffinityNeedsUpdate;
|
bool AffinityNeedsUpdate;
|
||||||
void addObserver(MTGAbility * observer);
|
void addObserver(MTGAbility * observer);
|
||||||
|
void checkLegendary(MTGCardInstance * card);
|
||||||
|
map<MTGCardInstance *,bool> cards;
|
||||||
bool removeObserver(ActionElement * observer);
|
bool removeObserver(ActionElement * observer);
|
||||||
void startGame(GameType, Rules * rules);
|
void startGame(GameType, Rules * rules);
|
||||||
void untapPhase();
|
void untapPhase();
|
||||||
|
|||||||
@@ -434,7 +434,6 @@ public:
|
|||||||
int added(MTGCardInstance * card);
|
int added(MTGCardInstance * card);
|
||||||
int removed(MTGCardInstance * card);
|
int removed(MTGCardInstance * card);
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
void checkLegendary(MTGCardInstance * card);
|
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
virtual MTGLegendRule * clone() const;
|
virtual MTGLegendRule * clone() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -897,6 +897,13 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
int nbcards = z->nb_cards;
|
int nbcards = z->nb_cards;
|
||||||
//------------------------------
|
//------------------------------
|
||||||
p->nomaxhandsize = (z->hasAbility(Constants::NOMAXHAND));
|
p->nomaxhandsize = (z->hasAbility(Constants::NOMAXHAND));
|
||||||
|
//legendary
|
||||||
|
for (int cl = 0; cl < nbcards; cl++)
|
||||||
|
{
|
||||||
|
MTGCardInstance * c = z->cards[cl];
|
||||||
|
if(!c->isPhased && c->hasType(Subtypes::TYPE_LEGENDARY) && !c->has(Constants::NOLEGEND))
|
||||||
|
checkLegendary(c);
|
||||||
|
}
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
//handle end of turn effects while we're at it.//
|
//handle end of turn effects while we're at it.//
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
@@ -1020,6 +1027,43 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameObserver::checkLegendary(MTGCardInstance * card)
|
||||||
|
{
|
||||||
|
map<MTGCardInstance *, bool>::iterator it;
|
||||||
|
int destroy = 0;
|
||||||
|
|
||||||
|
vector<MTGCardInstance*>oldCards;
|
||||||
|
for (it = cards.begin(); it != cards.end(); it++)
|
||||||
|
{
|
||||||
|
MTGCardInstance * comparison = (*it).first;
|
||||||
|
if (comparison != card && comparison->controller() == card->controller() && !(comparison->getName().compare(card->getName())))
|
||||||
|
{
|
||||||
|
oldCards.push_back(comparison);
|
||||||
|
destroy = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(destroy)
|
||||||
|
{
|
||||||
|
vector<MTGAbility*>selection;
|
||||||
|
MultiAbility * multi = NEW MultiAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card, NULL);
|
||||||
|
for(unsigned int i = 0;i < oldCards.size();i++)
|
||||||
|
{
|
||||||
|
AAMover *a = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
|
||||||
|
a->oneShot = true;
|
||||||
|
multi->Add(a);
|
||||||
|
}
|
||||||
|
multi->oneShot = 1;
|
||||||
|
MTGAbility * a1 = multi;
|
||||||
|
selection.push_back(a1);
|
||||||
|
AAMover *b = NEW AAMover(this, this->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
|
||||||
|
b->oneShot = true;
|
||||||
|
MTGAbility * b1 = b;
|
||||||
|
selection.push_back(b1);
|
||||||
|
MTGAbility * menuChoice = NEW MenuAbility(this, this->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
|
||||||
|
menuChoice->addToGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GameObserver::enchantmentStatus()
|
void GameObserver::enchantmentStatus()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
|
|||||||
@@ -3187,7 +3187,7 @@ int MTGLegendRule::canBeInList(MTGCardInstance * card)
|
|||||||
return 0;
|
return 0;
|
||||||
if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card))
|
if (card->hasType(Subtypes::TYPE_LEGENDARY) && card->controller()->game->inPlay->hasCard(card))
|
||||||
{
|
{
|
||||||
if(card->has(Constants::NOLEGEND)||card->controller()->game->inPlay->hasAbility(Constants::NOLEGEND)||card->controller()->opponent()->game->inPlay->hasAbility(Constants::NOLEGEND))
|
if(card->has(Constants::NOLEGEND)||card->controller()->opponent()->inPlay()->hasName("Mirror Gallery")||card->controller()->inPlay()->hasName("Mirror Gallery"))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
@@ -3196,22 +3196,6 @@ int MTGLegendRule::canBeInList(MTGCardInstance * card)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int MTGLegendRule::added(MTGCardInstance * card)
|
int MTGLegendRule::added(MTGCardInstance * card)
|
||||||
{
|
|
||||||
checkLegendary(card);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MTGLegendRule::removed(MTGCardInstance *)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MTGLegendRule::testDestroy()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MTGLegendRule::checkLegendary(MTGCardInstance * card)
|
|
||||||
{
|
{
|
||||||
map<MTGCardInstance *, bool>::iterator it;
|
map<MTGCardInstance *, bool>::iterator it;
|
||||||
int destroy = 0;
|
int destroy = 0;
|
||||||
@@ -3246,6 +3230,17 @@ void MTGLegendRule::checkLegendary(MTGCardInstance * card)
|
|||||||
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
|
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
|
||||||
menuChoice->addToGame();
|
menuChoice->addToGame();
|
||||||
}
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MTGLegendRule::removed(MTGCardInstance *)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MTGLegendRule::testDestroy()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ostream& MTGLegendRule::toString(ostream& out) const
|
ostream& MTGLegendRule::toString(ostream& out) const
|
||||||
|
|||||||
Reference in New Issue
Block a user