Menu

Submission for Dread Cacodemon

79

Config

name=Dread Cacodemon
image=http://magiccards.info/scans/en/cmd/79.jpg
value=2.500
rarity=R
type=Creature
subtype=Demon
cost={7}{B}{B}{B}
pt=8/8
timing=main
requires_groovy_code
oracle=When Dread Cacodemon enters the battlefield, if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control.

Script

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return permanent.hasState(MagicPermanentState.CastFromHand) ?
                new MagicEvent(
                    permanent,
                    this,
                    "Destroy all creatures your opponents control, then tap all other creatures you control."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final Collection<MagicPermanent> targets = game.filterPermanents(event.getPlayer().getOpponent(),CREATURE_YOU_CONTROL);
                game.doAction(new MagicDestroyAction(targets));
            final Collection<MagicPermanent> targets2 = game.filterPermanents(
                event.getPlayer(),
                CREATURE_YOU_CONTROL.except(event.getPermanent())
                );
                for (final MagicPermanent creature : targets2) {                    game.doAction(new MagicTapAction(creature));
            } 
        }
    }
]
Pushed