Menu

Submission for Skred

97

Config

name=Skred
image=http://mtgimage.com/card/skred.jpg
value=2.500
rarity=C
type=Instant
cost={R}
timing=removal
requires_groovy_code
oracle=Skred deals damage to target creature equal to the number of snow permanents you control.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_CREATURE,
                this,
                "SN deals damage equal to the number of snow permanents PN controls to target creature\$."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount = event.getPlayer().getNrOfPermanents(MagicType.Snow);
            event.processTargetPermanent(game, {
                final MagicDamage damage = new MagicDamage(
                    event.getSource(),
                    it,
                    amount
                );
                game.doAction(new MagicDealDamageAction(damage));
            });
        }
    }
]
Pushed