Menu

Submission for Lithophage

57

Config

name=Lithophage
image=http://mtgimage.com/card/lithophage.jpg
value=2.500
rarity=R
type=Creature
subtype=Insect
cost={3}{R}{R}
pt=7/7
timing=main
requires_groovy_code
oracle=At the beginning of your upkeep, sacrifice Lithophage unless you sacrifice a Mountain.

Script

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

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getPlayer().controlsPermanent(MagicSubType.Mountain) && event.isYes()) {
                game.addEvent(new MagicSacrificePermanentEvent(event.getPermanent(),event.getPlayer(),MagicTargetChoice.SACRIFICE_MOUNTAIN));
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed