diff --git a/release/Magarena/scripts/Eyeblight_s_Ending.groovy b/release/Magarena/scripts/Eyeblight_s_Ending.groovy deleted file mode 100644 index d3da81a0c6..0000000000 --- a/release/Magarena/scripts/Eyeblight_s_Ending.groovy +++ /dev/null @@ -1,34 +0,0 @@ -def NON_ELF_CREATURE = new MagicPermanentFilterImpl() { - public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) { - return target.isCreature() && - !target.hasSubType(MagicSubType.Elf); - } -}; - -def TARGET_NON_ELF_CREATURE = new MagicTargetChoice( - NON_ELF_CREATURE, - MagicTargetHint.Negative, - "target non-Elf creature" -); - -[ - new MagicSpellCardEvent() { - @Override - public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) { - return new MagicEvent( - cardOnStack, - TARGET_NON_ELF_CREATURE, - MagicDestroyTargetPicker.Destroy, - this, - "Destroy target non-Elf creature\$." - ); - } - @Override - public void executeEvent(final MagicGame game, final MagicEvent event) { - event.processTargetPermanent(game, { - final MagicPermanent creature -> - game.doAction(new MagicDestroyAction(creature)); - }); - } - } -] diff --git a/release/Magarena/scripts/Eyeblight_s_Ending.txt b/release/Magarena/scripts/Eyeblight_s_Ending.txt index d1fb69ba5a..d5bc62c2b6 100644 --- a/release/Magarena/scripts/Eyeblight_s_Ending.txt +++ b/release/Magarena/scripts/Eyeblight_s_Ending.txt @@ -6,5 +6,5 @@ rarity=C type=Tribal,Instant subtype=Elf cost={2}{B} +effect=Destroy target non-Elf creature. timing=removal -requires_groovy_code diff --git a/src/magic/model/target/MagicTargetFilterFactory.java b/src/magic/model/target/MagicTargetFilterFactory.java index 7a6ee27d2b..ae743013fc 100644 --- a/src/magic/model/target/MagicTargetFilterFactory.java +++ b/src/magic/model/target/MagicTargetFilterFactory.java @@ -610,6 +610,13 @@ public class MagicTargetFilterFactory { } }; + public static final MagicPermanentFilterImpl NONELF_CREATURE = new MagicPermanentFilterImpl() { + public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) { + return target.isCreature() && + !target.hasSubType(MagicSubType.Elf); + } + }; + public static final MagicPermanentFilterImpl NONENCHANTMENT_CREATURE = new MagicPermanentFilterImpl() { public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) { return target.isCreature() && @@ -1588,6 +1595,7 @@ public class MagicTargetFilterFactory { single.put("non-Demon creature", NON_DEMON_CREATURE); single.put("non-Zombie creature", NONZOMBIE_CREATURE); single.put("non-Human creature", NONHUMAN_CREATURE); + single.put("non-Elf creature", NONELF_CREATURE); single.put("non-Vampire, non-Werewolf, non-Zombie creature", NONVAMPIRE_NONWEREWOLF_NONZOMBIE_CREATURE); single.put("Skeleton, Vampire, or Zombie", SKELETON_VAMPIRE_OR_ZOMBIE); single.put("noncreature", NONCREATURE);