Menu

Submission for Esper Charm

167

Config

name=Esper Charm
image=http://mtgimage.com/card/esper%20charm.jpg
value=2.500
rarity=U
type=Instant
cost={W}{U}{B}
timing=removal
requires_groovy_code
oracle=Choose one — • Destroy target enchantment. • Draw two cards. • Target player discards two cards.

Script

def EFFECT1 = MagicRuleEventAction.create("Destroy target enchantment.");

def EFFECT2 = MagicRuleEventAction.create("Draw two cards.");

def EFFECT3 = MagicRuleEventAction.create("Target player discards two cards.");

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                new MagicOrChoice(
                    MagicTargetChoice.Negative("target enchantment"),
                    MagicTargetChoice.NONE,
                    MagicTargetChoice.NEG_TARGET_PLAYER
                ),
                this,
                "Choose one\$ - destroy target enchantment; " +
                "or draw two cards; " +
                "or target player discards two cards." 
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isMode(1)) {
                game.addEvent(EFFECT1.getEvent(event.getSource()));
            } else if (event.isMode(2)) {
                game.addEvent(EFFECT2.getEvent(event.getSource()));
            } else if (event.isMode(3)) {
                game.addEvent(EFFECT3.getEvent(event.getSource()));
            }
        }
    }
]
Pushed