Menu

Submission for Silvergill Douser

87

Config

name=Silvergill Douser
image=http://mtgimage.com/card/silvergill%20douser.jpg
value=2.500
rarity=C
type=Creature
subtype=Merfolk,Wizard
cost={1}{U}
pt=1/1
timing=main
requires_groovy_code
oracle={T}: Target creature gets -X/-0 until end of turn, where X is the number of Merfolk and/or Faeries you control.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "Weaken"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            final int amount = source.getController().getNrOfPermanents(MagicSubType.Merfolk) + source.getController().getNrOfPermanents(MagicSubType.Faerie);
            return new MagicEvent(
                source,
                MagicTargetChoice.NEG_TARGET_CREATURE,
                amount,
                this,
                "Target creature\$ gets -X/-0 until end of turn. (X="+amount+")"
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int amount=event.getRefInt();
            event.processTargetPermanent(game, {
                game.doAction(new MagicChangeTurnPTAction(it,-amount,0));
            });
        }
    }
]
Pushed