This commit is contained in:
Alex W. Jackson 2022-08-22 12:38:08 -04:00 committed by GitHub
parent aea8c82728
commit 54896b3564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 17 deletions

View file

@ -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));

View file

@ -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) {