mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
ExileAndReturnSourceEffect - check for other face being returned
* possible for transform using PutCards
This commit is contained in:
parent
b43ab76d60
commit
1bcbdd520e
1 changed files with 12 additions and 2 deletions
|
|
@ -2,11 +2,13 @@ package mage.abilities.effects.common;
|
||||||
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.Mode;
|
import mage.abilities.Mode;
|
||||||
import mage.constants.Pronoun;
|
|
||||||
import mage.abilities.effects.ContinuousEffect;
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.DoubleFacedCardHalf;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Pronoun;
|
||||||
import mage.constants.PutCards;
|
import mage.constants.PutCards;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -74,7 +76,15 @@ public class ExileAndReturnSourceEffect extends OneShotEffect {
|
||||||
returnUnderYourControl ? controller : game.getPlayer(permanent.getOwnerId()),
|
returnUnderYourControl ? controller : game.getPlayer(permanent.getOwnerId()),
|
||||||
permanent.getMainCard(), source, game, "card"
|
permanent.getMainCard(), source, game, "card"
|
||||||
);
|
);
|
||||||
if (additionalEffect == null || game.getPermanent(permanent.getId()) == null) {
|
Permanent newPermanent = game.getPermanent(permanent.getId());
|
||||||
|
if (newPermanent == null) {
|
||||||
|
// check if permanent returned with a new face (e.g., transform)
|
||||||
|
Card card = game.getCard(permanent.getId());
|
||||||
|
if (card instanceof DoubleFacedCardHalf) {
|
||||||
|
newPermanent = game.getPermanent(((DoubleFacedCardHalf) card).getOtherSide().getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (additionalEffect == null || newPermanent == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (additionalEffect instanceof ContinuousEffect) {
|
if (additionalEffect instanceof ContinuousEffect) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue