unearth rule
This commit is contained in:
@@ -1028,26 +1028,6 @@ void GameObserver::gameStateBasedEffects()
|
|||||||
c->ProvokeTarget = NULL;
|
c->ProvokeTarget = NULL;
|
||||||
c->Provoker = NULL;
|
c->Provoker = NULL;
|
||||||
}
|
}
|
||||||
for (int jj = z->nb_cards - 1; jj >= 0; jj--)
|
|
||||||
{
|
|
||||||
MTGCardInstance * c = z->cards[jj];
|
|
||||||
|
|
||||||
if(c && !c->isPhased)
|
|
||||||
{
|
|
||||||
if (c->has(Constants::TREASON))
|
|
||||||
{
|
|
||||||
MTGCardInstance * beforeCard = c;
|
|
||||||
p->game->putInZone(c, c->currentZone, c->owner->game->graveyard);
|
|
||||||
WEvent * e = NEW WEventCardSacrifice(beforeCard,c);
|
|
||||||
receiveEvent(e);
|
|
||||||
}
|
|
||||||
if (c->has(Constants::UNEARTH))
|
|
||||||
{
|
|
||||||
p->game->putInZone(c, c->currentZone, c->owner->game->exile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
MTGGameZone * f = p->game->graveyard;
|
MTGGameZone * f = p->game->graveyard;
|
||||||
for (int k = 0; k < f->nb_cards; k++)
|
for (int k = 0; k < f->nb_cards; k++)
|
||||||
|
|||||||
@@ -2531,7 +2531,11 @@ int MTGMomirRule::reactToClick(MTGCardInstance * card_to_discard, int cardId)
|
|||||||
tokCreate = af.parseMagicLine(abi,game->mLayers->actionLayer()->getMaxId(),NULL, card->clone());
|
tokCreate = af.parseMagicLine(abi,game->mLayers->actionLayer()->getMaxId(),NULL, card->clone());
|
||||||
tokCreate->aType = MTGAbility::FORCED_TOKEN_CREATOR;
|
tokCreate->aType = MTGAbility::FORCED_TOKEN_CREATOR;
|
||||||
if(tokCreate)
|
if(tokCreate)
|
||||||
|
{
|
||||||
|
if(tokCreate->source)
|
||||||
|
tokCreate->source->owner = player;
|
||||||
tokCreate->fireAbility();
|
tokCreate->fireAbility();
|
||||||
|
}
|
||||||
|
|
||||||
alreadyplayed = 1;
|
alreadyplayed = 1;
|
||||||
textAlpha = 255;
|
textAlpha = 255;
|
||||||
@@ -3281,6 +3285,39 @@ int MTGUnearthRule::receiveEvent(WEvent * event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (WEventPhaseChange* pe = dynamic_cast<WEventPhaseChange*>(event))
|
||||||
|
{
|
||||||
|
if (MTG_PHASE_ENDOFTURN == pe->from->id)
|
||||||
|
{
|
||||||
|
bool found = false;
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * p = game->players[i];
|
||||||
|
MTGGameZone * z = game->players[i]->game->inPlay;
|
||||||
|
|
||||||
|
for (int j = z->nb_cards - 1; j >= 0; j--)
|
||||||
|
{
|
||||||
|
MTGCardInstance * c = z->cards[j];
|
||||||
|
if(c && c->has(Constants::UNEARTH) && !c->isPhased)
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
c->controller()->game->putInZone(c, c->currentZone, c->owner->game->exile);
|
||||||
|
}
|
||||||
|
else if(c && c->has(Constants::TREASON) && !c->isPhased)
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
MTGCardInstance * beforeCard = c;
|
||||||
|
c->controller()->game->putInZone(c, c->currentZone, c->owner->game->graveyard);
|
||||||
|
WEvent * e = NEW WEventCardSacrifice(beforeCard,c);
|
||||||
|
game->receiveEvent(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(found)
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user