Menu

Submission for Decree of Silence

32

Config

name=Decree of Silence
image=http://mtgimage.com/card/decree%20of%20silence.jpg
value=2.500
rarity=R
type=Enchantment
cost={6}{U}{U}
ability=Cycling {4}{U}{U}
timing=enchantment
requires_groovy_code
oracle=Whenever an opponent casts a spell, counter that spell and put a depletion counter on Decree of Silence. If there are three or more depletion counters on Decree of Silence, sacrifice it. Cycling {4}{U}{U}. When you cycle Decree of Silence, you may counter target spell.

Script

[
    new MagicWhenOtherSpellIsCastTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicCardOnStack cardOnStack) {
            return cardOnStack.getController() != permanent.getController() ?
                new MagicEvent(
                permanent,
                cardOnStack,
                this,
                "Counter RN and put a depletion counter on SN."
            ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicCounterItemOnStackAction(event.getRefCardOnStack()));
            game.doAction(new MagicChangeCountersAction(event.getPermanent(),MagicCounterType.Depletion,1));
        }
    },
    new MagicStatic(MagicLayer.Game) {
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source.getCounters(MagicCounterType.Depletion) >= 3;
        }
        @Override
        public void modGame(final MagicPermanent source, final MagicGame game) {
            game.doAction(new MagicSacrificeAction(source));
        }
    },
    new MagicWhenCycleTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicCard card) {
            return new MagicEvent(
                card,
                new MagicMayChoice(MagicTargetChoice.NEG_TARGET_SPELL),
                this,
                "PN may\$ counter target spell\$."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                event.processTargetCardOnStack(game, {
                    game.doAction(new MagicCounterItemOnStackAction(it));
                });
            }
        }
    }
]
Pushed