Menu

Submission for

Config

name=Yawgmoth Demon
image=http://mtgimage.com/card/yawgmoth%20demon.jpg
value=2.500
rarity=R
type=Creature
subtype=Demon
cost={4}{B}{B}
pt=6/6
ability=Flying;\
        First strike
timing=main
requires_groovy_code
oracle=Flying. First strike. At the beginning of your upkeep, you may sacrifice an artifact. If you don't, tap Yawgmoth Demon and it deals 2 damage to you.

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 an artifact?"),
                    this,
                    "PN may\$ sacrifice an artifact. If PN doesn't, tap SN and it deals 2 damage to you."
                ):
                MagicEvent.NONE;
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getPlayer().controlsPermanent(MagicType.Artifact) && event.isYes()) {
                game.addEvent(new MagicSacrificePermanentEvent(event.getPermanent(),event.getPlayer(),MagicTargetChoice.SACRIFICE_ARTIFACT));
            } else {
                game.doAction(new MagicTapAction(event.getPermanent(),true));
		final MagicDamage damage = new MagicDamage(event.getSource(),event.getPlayer(),2)
                game.doAction(new MagicDealDamageAction(damage));
            }
        }
    }
]
Pushed