From 54896b356431f25a991daa3a652e3148b641651a Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Mon, 22 Aug 2022 12:38:08 -0400 Subject: [PATCH] Fix #9357 (#9359) --- .../src/mage/cards/e/EmrakulTheAeonsTorn.java | 4 ++-- .../abilities/keyword/ProtectionAbility.java | 19 ++++--------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Mage.Sets/src/mage/cards/e/EmrakulTheAeonsTorn.java b/Mage.Sets/src/mage/cards/e/EmrakulTheAeonsTorn.java index e7f02061781..1bee2846a1c 100644 --- a/Mage.Sets/src/mage/cards/e/EmrakulTheAeonsTorn.java +++ b/Mage.Sets/src/mage/cards/e/EmrakulTheAeonsTorn.java @@ -16,7 +16,7 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.SuperType; -import mage.filter.FilterStackObject; +import mage.filter.FilterSpell; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorlessPredicate; @@ -25,7 +25,7 @@ import mage.filter.predicate.mageobject.ColorlessPredicate; */ public final class EmrakulTheAeonsTorn extends CardImpl { - private static final FilterStackObject filter = new FilterStackObject("spells that are one or more colors"); + private static final FilterSpell filter = new FilterSpell("spells that are one or more colors"); static { filter.add(Predicates.not(ColorlessPredicate.instance)); diff --git a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java index 835f133f7cd..ecb7bd20ff6 100644 --- a/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/ProtectionAbility.java @@ -95,23 +95,12 @@ public class ProtectionAbility extends StaticAbility { } if (filter instanceof FilterSpell) { - if (source instanceof Spell) { + // Problem here is that for the check if a player can play a Spell, the source + // object is still a card and not a spell yet. + if (source instanceof Spell || game.inCheckPlayableState() && source.isInstantOrSorcery(game)) { return !filter.match(source, game); } - // Problem here is that for the check if a player can play a Spell, the source - // object is still a card and not a spell yet. So return only if the source object can't be a spell - // otherwise the following FilterObject check will be applied - if (source instanceof StackObject - || !source.isInstantOrSorcery(game)) { - return true; - } - } - - // Emrakul, the Aeons Torn - if (filter instanceof FilterStackObject) { - if (filter.match(source, game)) { - return !source.isInstantOrSorcery(game); - } + return true; } if (filter instanceof FilterObject) {