Menu

Submission for Invoke the Firemind

31

Config

name=Invoke the Firemind
image=http://magiccards.info/scans/en/ddj/31.jpg
value=2.500
rarity=R
type=Sorcery
cost={X}{U}{U}{R}
timing=main
requires_groovy_code
oracle=Choose one — • Draw X cards. • Invoke the Firemind deals X damage to target creature or player.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                new MagicOrChoice(
                    MagicChoice.NONE,
                    MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER
                ),
                payedCost.getX(),
                this,
                "Choose one\$ - draw X cards; " +
                "or SN deals X damage to target creature or player.\$" 
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int X = event.getRefInt();
            if (event.isMode(1)) {
                game.doAction(new MagicDrawAction(event.getPlayer(),X));
            } else if (event.isMode(2)) {
                event.processTarget(game, {
                    game.doAction(new MagicDealDamageAction(event.getSource(),it,X));
                });
            }
        }
    }
]
Pushed