Menu

Submission for Into Thin Air

33

Config

name=Into Thin Air
image=http://mtgimage.com/card/into%20thin%20air.jpg
value=2.500
rarity=C
type=Instant
cost={5}{U}
effect=Return target artifact to its owner's hand.
timing=removal
requires_groovy_code
oracle=Affinity for artifacts. Return target artifact to its owner's hand.

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,5-n)
            return cost==0 ?
                [new MagicPayManaCostEvent(source,"{U}")]:
                [new MagicPayManaCostEvent(source,"{"+cost.toString()+"}{U}")];
        }
    }
]
Pushed