Menu

Submission for Vexing Sphinx

50

Config

name=Vexing Sphinx
image=http://mtgimage.com/card/vexing%20sphinx.jpg
value=2.500
rarity=R
type=Creature
subtype=Sphinx
cost={1}{U}{U}
pt=4/4
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. Cumulative upkeepā€”Discard a card. When Vexing Sphinx dies, draw a card for each age counter on it.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            game.doAction(new MagicChangeCountersAction(
                permanent,
                MagicCounterType.Age,
                1
            ));
            return new MagicEvent(
                permanent,
                new MagicMayChoice("Pay cumulative upkeep?"),
                this,
                "PN may\$ discard a card for each Age counter on SN. " +
                " If he or she doesn't, sacrifice SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.addEvent(new MagicDiscardEvent(
                    event.getPermanent(),
                    event.getPlayer(),
                    event.getPermanent().getCounters(MagicCounterType.Age)
                ));
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    },
    new MagicWhenDiesTrigger() {       
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent died) {       
            return new MagicEvent(
                permanent,
                this,
                "PN draws a card for each age counter on SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicDrawAction(event.getPlayer(),event.getPermanent().getCounters(MagicCounterType.Age)));
        }
    }
]
Pushed