Menu

Submission for Forced March

136

Comment

Adapted from Gaze of Granite

Config

name=Forced March
image=http://mtgimage.com/card/forced%20march.jpg
value=2.500
rarity=R
type=Sorcery
cost={X}{B}{B}{B}
timing=main
requires_groovy_code
oracle=Destroy all creatures with converted mana cost X or less.

Script

[
    new MagicSpellCardEvent() {

        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            final int amount=payedCost.getX();
            return new MagicEvent(
                cardOnStack,
                amount,
                this,
                "Destroy all creatures with converted mana cost RN or less."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount=event.getRefInt();
            final Collection<MagicPermanent> targets=
                game.filterPermanents(
                    event.getSource().getController(),
                    new MagicCMCPermanentFilter(
                        MagicTargetFilterFactory.CREATURE,
                        Operator.LESS_THAN_OR_EQUAL,
                        amount
                    )
                );
            game.doAction(new MagicDestroyAction(targets));
        }
    }
]
Pushed