Menu

Submission for Parallax Inhibitor

134

Config

name=Parallax Inhibitor
image=http://magiccards.info/scans/en/ne/134.jpg
value=2.500
rarity=R
type=Artifact
cost={2}
timing=artifact
requires_groovy_code
oracle={1}, {T}, Sacrifice Parallax Inhibitor: Put a fade counter on each permanent with fading you control.

Script

def PERMANENT_WITH_FADING_YOU_CONTROL = new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasAbility(MagicAbility.Fading) && target.isController(player);
    } 
};

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Counter"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source,"{1}"),
                new MagicTapEvent(source),
                new MagicSacrificeEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Put a fade counter on each permanent with fading you control."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final Collection<MagicPermanent> targets = game.filterPermanents(PERMANENT_WITH_FADING_YOU_CONTROL);
            for (final MagicPermanent target : targets) {
                game.doAction(new MagicChangeCountersAction(target, MagicCounterType.Fade, 1));
            }
        }
    }
]
Pushed