Menu

Submission for Gempalm Incinerator

37

Comment

Adapted from Sparksmith

Config

name=Gempalm Incinerator
image=http://mtgimage.com/card/gempalm%20incinerator.jpg
value=2.500
rarity=U
type=Creature
subtype=Goblin
cost={2}{R}
pt=2/1
ability=Cycling {1}{R}
timing=main
requires_groovy_code
oracle=Cycling {1}{R}. When you cycle Gempalm Incinerator, you may have it deal X damage to target creature, where X is the number of Goblins on the battlefield.

Script

[
    new MagicWhenCycleTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicCard card) {
            final int X = card.getGame().getNrOfPermanents(MagicSubType.Goblin);
            return new MagicEvent(
                card,
                MagicTargetChoice.NEG_TARGET_CREATURE,
                new MagicDamageTargetPicker(X),
                this,
                "When you cycle SN, you may have it deal X damage to target creature\$, "+
                "where X is the number of Goblins on the battlefield."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game,{
                final int X = game.getNrOfPermanents(MagicSubType.Goblin);
                final MagicDamage damage=new MagicDamage(event.getSource(),it,X);
                game.doAction(new MagicDealDamageAction(damage));
            });
        }
    }
]
Pushed