Menu

Submission for Decree of Pain

111

Config

name=Decree of Pain
image=http://mtgimage.com/card/decree%20of%20pain.jpg
value=2.500
rarity=R
type=Sorcery
cost={6}{B}{B}
ability=Cycling {3}{B}{B};\
        When you cycle SN, all creatures get -2/-2 until end of turn.
timing=main
requires_groovy_code
oracle=Destroy all creatures. They can't be regenerated. Draw a card for each creature destroyed this way. Cycling {3}{B}{B}. When you cycle Decree of Pain, all creatures get -2/-2 until end of turn.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                this,
                "Destroy all creatures. They can't be regenerated. Draw a card for each creature destroyed this way."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
                final Collection<MagicPermanent> targets=
                    game.filterPermanents(MagicTargetFilterFactory.CREATURE);
		final MagicDestroyAction destroy = new MagicDestroyAction(targets);         
	        for (final MagicPermanent target : targets) {
                game.doAction(MagicChangeStateAction.Set(target,MagicPermanentState.CannotBeRegenerated));
        }
                game.doAction(destroy); 
                game.doAction(new MagicDrawAction(event.getPlayer(),destroy.getNumDestroyed()));
        }
    }
]
Pushed