Menu

Submission for Junk Golem

300

Config

name=Junk Golem
image=http://mtgimage.com/card/junk%20golem.jpg
value=2.500
rarity=R
type=Artifact,Creature
subtype=Golem
cost={4}
pt=0/0
ability=SN enters the battlefield with three +1/+1 counters on it.;\
        {1}, Discard a card: Put a +1/+1 counter on SN.
timing=main
requires_groovy_code
oracle=Junk Golem enters the battlefield with three +1/+1 counters on it. At the beginning of your upkeep, sacrifice Junk Golem unless you remove a +1/+1 counter from it. {1}, Discard a card: Put a +1/+1 counter on Junk Golem.

Script

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

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes() && event.getPermanent().getCounters(MagicCounterType.PlusOne) >= 1) {
                game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.PlusOne,-1));
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    }
]
Pushed