diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 2f311cd7e..fac5555ba 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1028,26 +1028,6 @@ void GameObserver::gameStateBasedEffects() c->ProvokeTarget = 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; for (int k = 0; k < f->nb_cards; k++) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index a4930645c..b8bebb5f5 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -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->aType = MTGAbility::FORCED_TOKEN_CREATOR; if(tokCreate) + { + if(tokCreate->source) + tokCreate->source->owner = player; tokCreate->fireAbility(); + } alreadyplayed = 1; textAlpha = 255; @@ -3281,6 +3285,39 @@ int MTGUnearthRule::receiveEvent(WEvent * event) } } } + else if (WEventPhaseChange* pe = dynamic_cast(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; }