Menu

Submission for Stitch in Time

132

Config

name=Stitch in Time
image=http://magiccards.info/scans/en/gp/132.jpg
value=2.500
rarity=R
type=Sorcery
cost={1}{U}{R}
timing=main
requires_groovy_code
oracle=Flip a coin. If you win the flip, take an extra turn after this one.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                new MagicCoinFlipChoice(),
                this,
                "PN flips a coin.\$ If PN wins the flip, PN takes an extra turn after this one."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicPlayer player = event.getPlayer();
            final Boolean heads = event.isMode(1) 
            game.addEvent(new MagicCoinFlipEvent(
                event.getSource(),
                heads,
                player,
                new ChangeExtraTurnsAction(player,1),
                null
            ));
        }
    }
]
Pushed