Menu

Submission for Khalni Hydra

192

Config

name=Khalni Hydra
image=http://mtgimage.com/card/khalni%20hydra.jpg
value=2.500
rarity=M
type=Creature
subtype=Hydra
cost={G}{G}{G}{G}{G}{G}{G}{G}
pt=8/8
ability=Trample
timing=main
requires_groovy_code
oracle=Khalni Hydra costs {G} less to cast for each green creature you control. Trample

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 int n = source.getController().getNrOfPermanents(MagicTargetFilterFactory.GREEN_CREATURE);
            return [
                new MagicPayManaCostEvent(
                    source,
                    source.getCost().reduce(MagicCostManaType.Green, n)
                )
            ];
        }
    }
]
Pushed