Menu

Submission for Sacred Mesa

86

Config

name=Sacred Mesa
image=http://mtgimage.com/card/sacred%20mesa.jpg
value=2.500
rarity=R
type=Enchantment
cost={2}{W}
ability={1}{W}: Put a 1/1 white Pegasus creature token with flying onto the battlefield.
timing=enchantment
requires_groovy_code
oracle=At the beginning of your upkeep, sacrifice Sacred Mesa unless you sacrifice a Pegasus. {1}{W}: Put a 1/1 white Pegasus creature token with flying onto the battlefield.

Script

def choice = new MagicTargetChoice("a Pegasus to sacrifice");

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice("Sacrifice a Pegasus?"),
                this,
                "PN may\$ sacrifice a Pegasus. If PN doesn't, sacrifice SN."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicEvent sac = new MagicSacrificePermanentEvent(event.getPermanent(),event.getPlayer(),choice);
            if (event.isYes() && sac.isSatisfied()) {
                game.addEvent(sac);
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed