Menu

Submission for Psychic Vortex

50

Config

name=Psychic Vortex
image=http://mtgimage.com/card/psychic%20vortex.jpg
value=2.500
rarity=R
type=Enchantment
cost={2}{U}{U}
timing=enchantment
requires_groovy_code
oracle=Cumulative upkeep—Draw a card. At the beginning of your end step, sacrifice a land and discard your hand.

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\$ draw 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.doAction(new MagicDrawAction(event.getPlayer(),event.getPermanent().getCounters(MagicCounterType.Age)));
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    },
    new MagicAtEndOfTurnTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer eotPlayer) {
            return permanent.isController(eotPlayer) ?
                new MagicEvent(
                    permanent,
                    this,
                    "PN sacrifices a land and discards his or her hand."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.addEvent(new MagicSacrificePermanentEvent(event.getPermanent(), MagicTargetChoice.LAND_YOU_CONTROL));
            game.addEvent(new MagicDiscardHandEvent(event.getPermanent()));
        }
    }
]
Pushed