Menu

Submission for Blinkmoth Infusion

25

Config

name=Blinkmoth Infusion
image=http://mtgimage.com/card/blinkmoth%20infusion.jpg
value=2.500
rarity=R
type=Instant
cost={12}{U}{U}
effect=Untap all artifacts.
timing=pump
requires_groovy_code
oracle=Affinity for artifacts. Untap all artifacts.

Script

[
     new MagicCardActivation(
        [MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Main, true),
        "Cast"
    ) {
        @Override
        public void change(final MagicCardDefinition cdef) {
            cdef.setCardAct(this);
        }

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            final MagicGame game = source.getGame();
            final int n = game.filterPermanents(source.getController(),MagicTargetFilterFactory.ARTIFACT_YOU_CONTROL).size();
            final int cost= Math.max(0,12-n)
            return cost==0 ?
                [new MagicPayManaCostEvent(source,"{U}{U}")]:
                [new MagicPayManaCostEvent(source,"{"+cost.toString()+"}{U}{U}")];
        }
    }
]
Pushed