Menu

Submission for Golgari Charm

221

Config

name=Golgari Charm
image=http://mtgimage.com/card/golgari%20charm.jpg
value=2.500
rarity=U
type=Instant
cost={B}{G}
timing=removal
requires_groovy_code
oracle=Choose one — • All creatures get -1/-1 until end of turn. • Destroy target enchantment. • Regenerate each creature you control.

Script

def EFFECT1 = MagicRuleEventAction.create("All creatures get -1/-1 until end of turn.");

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

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                new MagicOrChoice(
                    MagicTargetChoice.NONE,
                    MagicTargetChoice.NEG_TARGET_ENCHANTMENT,
                    MagicTargetChoice.NONE
                ),
                this,
                "Choose one\$ - all creatures get -1/-1 until end of turn; " +
                "or destroy target enchantment; " +
                "or regenerate each creature you control.\$" 
            );
        }
        @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)) {
            final Collection<MagicPermanent> targets=
            game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE_YOU_CONTROL);
            for (final MagicPermanent permanent : targets) {
                game.doAction(new MagicRegenerateAction(permanent));
                }
            }
        }
    }
]
Pushed