Menu

Submission for Champion's Drake

56

Comment

It works. It might not be computationally efficient (perhaps the filter could be refined to shorten the ``for'' section), but it functions as it says on the card. I do wish someone would write up some documentation for the groovy scripts, though. The ``value'' entry is just copy+paste leftovers -- I don't know what it means or what it's used for, but it seems required, so I left it there.

Config

name=Champion's Drake
url=http://magiccards.info/query?q=%21champion%27s%20drake
image=http://mtgimage.com/card/champion%27s%20drake.jpg
value=3.234
rarity=C
type=Creature
subtype=Drake
cost={1}{U}
pt=1/1
ability=flying
timing=main
requires_groovy_code

Script

[
    new MagicStatic(MagicLayer.ModPT) {
        @Override
        public void modPowerToughness(final MagicPermanent source,final MagicPermanent permanent,final MagicPowerToughness pt) {
            final MagicGame game = source.getGame();
        	final int boost = 0;
            final Collection<MagicPermanent> targets = game.filterPermanents(
                    permanent.getController(),
                    MagicTargetFilterFactory.CREATURE_YOU_CONTROL);
            for (final MagicPermanent target : targets) {
                if (target.getCounters(MagicCounterType.Level) >= 3) {
                    boost = 3;
                }
            }
            pt.add(boost,boost);
        }
    }
]
Pushed