Menu

Submission for Spirit Shackle

74

Config

name=Spirit Shackle
image=http://mtgimage.com/card/spirit%20shackle.jpg
value=2.500
rarity=C
type=Enchantment
subtype=Aura
cost={B}{B}
enchant=default,neg creature
timing=aura
requires_groovy_code
oracle=Enchant creature. Whenever enchanted creature becomes tapped, put a -0/-2 counter on it.

Script

[
    new MagicWhenBecomesTappedTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent tapped) {
            final MagicPermanent enchantedCreature = permanent.getEnchantedPermanent();
            return (enchantedCreature.isCreature() && enchantedCreature==tapped) ?
                new MagicEvent(
                    permanent,
                    enchantedCreature,
                    this,
                    "PN puts a -0/-2 counter on creature enchanted by SN."
                ) :
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game,final MagicEvent event) {
            final MagicPermanent permanent=event.getPermanent();
            final MagicPermanent enchanted=permanent.getEnchantedPermanent();
            if (enchanted.isValid()) {
                game.doAction(new MagicChangeCountersAction(enchanted,MagicCounterType.MinusZeroMinusTwo,1));
		 }
        }
    }
]
Pushed