Menu

Submission for Worldgorger Dragon

154

Config

name=Worldgorger Dragon
image=http://mtgimage.com/card/worldgorger%20dragon.jpg
value=2.500
rarity=R
type=Creature
subtype=Nightmare,Dragon
cost={3}{R}{R}{R}
pt=7/7
ability=Flying; trample
timing=main
requires_groovy_code
oracle=Flying, trample. When Worldgorger Dragon enters the battlefield, exile all other permanents you control. When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control.

Script

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                this,
                "Exile all other permanents you control."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicTargetFilter<MagicPermanent> permanents =
                new MagicOtherPermanentTargetFilter(
                MagicTargetFilterFactory.PERMANENT_YOU_CONTROL,event.getPermanent());
            final Collection<MagicPermanent> targets=
                game.filterPermanents(permanents);
            for (final MagicPermanent target : targets) {
                game.doAction(new MagicExileLinkAction(
                    event.getPermanent(),
                    target
                ));
        }
    }
},
    new MagicWhenLeavesPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicRemoveFromPlayAction act) {
            return new MagicEvent(
                permanent,
                this,
                "Return the exiled cards to the battlefield under their owners' control."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicReturnLinkedExileAction(
                event.getPermanent(),
                MagicLocationType.Play,
                event.getPlayer()
            ));
        }
    }
]
Pushed