From 4a15f88a43efcc4093233bc27911dfb17c84f2d3 Mon Sep 17 00:00:00 2001 From: Jeff Wadsworth Date: Tue, 5 Apr 2022 15:21:15 -0500 Subject: [PATCH] - Fixed #8819 --- .../mage/cards/t/TameshiRealityArchitect.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/t/TameshiRealityArchitect.java b/Mage.Sets/src/mage/cards/t/TameshiRealityArchitect.java index ae70ac99bd..4e804b0c9a 100644 --- a/Mage.Sets/src/mage/cards/t/TameshiRealityArchitect.java +++ b/Mage.Sets/src/mage/cards/t/TameshiRealityArchitect.java @@ -17,12 +17,13 @@ import mage.filter.common.FilterArtifactOrEnchantmentCard; import mage.filter.predicate.mageobject.ManaValuePredicate; import mage.game.Game; import mage.game.events.GameEvent; -import mage.game.events.ZoneChangeEvent; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetControlledPermanent; import mage.target.targetadjustment.TargetAdjuster; import java.util.UUID; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; /** * @author TheElk801 @@ -44,8 +45,8 @@ public final class TameshiRealityArchitect extends CardImpl { // {X}{W}, Return a land you control to its owner's hand: Return target artifact or enchantment card with mana value X or less from your graveyard to the battlefield. Activate only as a sorcery. Ability ability = new ActivateAsSorceryActivatedAbility( new ReturnFromGraveyardToBattlefieldTargetEffect() - .setText("return target artifact or enchantment card with " + - "mana value X or less from your graveyard to the battlefield"), + .setText("return target artifact or enchantment card with " + + "mana value X or less from your graveyard to the battlefield"), new ManaCostsImpl<>("{X}{W}") ); ability.addCost(new ReturnToHandChosenControlledPermanentCost( @@ -98,6 +99,13 @@ class TameshiRealityArchitectTriggeredAbility extends ZoneChangeTriggeredAbility @Override public boolean checkTrigger(GameEvent event, Game game) { - return super.checkTrigger(event, game) && !((ZoneChangeEvent) event).getTarget().isCreature(game); + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanentMovedToHand = game.getPermanentOrLKIBattlefield(zEvent.getTargetId()); + if (permanentMovedToHand != null + && fromZone == zEvent.getFromZone() + && toZone == zEvent.getToZone()) { + return !permanentMovedToHand.isCreature(game); + } + return false; } }