Menu

Submission for Dross Golem

119

Config

name=Dross Golem
image=http://mtgimage.com/card/dross%20golem.jpg
value=2.500
rarity=C
type=Artifact,Creature
subtype=Golem
cost={5}
pt=3/2
ability=Fear
timing=main
requires_groovy_code
oracle=Affinity for Swamps. Fear

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