Menu

Submission for Bog Elemental

57

Comment

Adapted from Endless Wurm

Config

name=Bog Elemental
image=http://mtgimage.com/card/bog%20elemental.jpg
value=2.500
rarity=R
type=Creature
subtype=Elemental
cost={3}{B}{B}
pt=5/4
ability=Protection from white
timing=main
requires_groovy_code
oracle=Protection from white. At the beginning of your upkeep, sacrifice Bog Elemental unless you sacrifice a land.

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 land?"),
                    this,
                    "PN may\$ sacrifice a land. If PN doesn't, sacrifice SN."
                ):
                MagicEvent.NONE;
        }

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