Menu

Submission for Breakthrough

92

Config

name=Breakthrough
image=http://mtgimage.com/card/breakthrough.jpg
value=2.500
rarity=U
type=Sorcery
cost={X}{U}
timing=draw
requires_groovy_code
oracle=Draw four cards, then choose X cards in your hand and discard the rest.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack, final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                this,
                "Draw 4 cards, then choose X cards from your hand and discard the rest."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
                game.doAction(new MagicDrawAction(event.getPlayer(), 4));
		final int amount = event.getPlayer().getHandSize() - event.getCardOnStack().getX();
                game.addEvent(new MagicDiscardEvent(event.getSource(),event.getPlayer(),amount));
        }
    }
]
Pushed