Menu

Submission for Misfortune

194

Config

name=Misfortune
image=http://mtgimage.com/card/misfortune.jpg
value=2.500
rarity=R
type=Sorcery
cost={1}{B}{R}{G}
timing=main
requires_groovy_code
oracle=An opponent chooses one — • You put a +1/+1 counter on each creature you control and gain 4 life. • You put a -1/-1 counter on each creature that player controls and Misfortune deals 4 damage to him or her.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                cardOnStack.getOpponent(),
                new MagicOrChoice(
                    MagicTargetChoice.NONE,
                    MagicTargetChoice.NONE
                ),
                this,
                "Choose one\$ - your opponent puts a +1/+1 counter on each creature he or she controls and gains 4 life; " +
                "or your opponent puts a -1/-1 counter on each creature you control and SN deals 4 damage to you."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isMode(1)) {
                final Collection<MagicPermanent> targets = event.getPlayer().getOpponent().filterPermanents(MagicTargetFilterFactory.CREATURE);
                for (final MagicPermanent creature : targets) {         
                game.doAction(new MagicChangeCountersAction(creature, MagicCounterType.PlusOne, 1));
                }
                game.doAction(new MagicChangeLifeAction(event.getPlayer().getOpponent(), 4));
            } else if (event.isMode(2)) {
                final Collection<MagicPermanent> targets = event.getPlayer().filterPermanents(MagicTargetFilterFactory.CREATURE);
                for (final MagicPermanent creature : targets) {         
                game.doAction(new MagicChangeCountersAction(creature, MagicCounterType.MinusOne, 1));
                }
                game.doAction(new MagicDealDamageAction(event.getSource(), event.getPlayer(), 4));
            }
        }
    }
]
Pushed