Menu

Submission for Wakestone Gargoyle

88

Comment

Treating "can attack this turn as though didn't have defender" as "loses defender until end of turn".

Config

name=Wakestone Gargoyle
image=http://mtgimage.com/card/wakestone%20gargoyle.jpg
value=2.500
rarity=R
type=Creature
subtype=Gargoyle
cost={3}{W}
pt=3/4
ability=Defender; flying
timing=main
requires_groovy_code
oracle=Defender, flying. {1}{W}: Creatures you control with defender can attack this turn as though they didn't have defender.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "-Defender"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [new MagicPayManaCostEvent(source, "{1}{W}")];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Creatures you control lose Defender until end of turn."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final Collection<MagicPermanent> targets = game.filterPermanents(
                event.getPlayer(),
                MagicTargetFilterFactory.CREATURE_YOU_CONTROL
            );
            for (final MagicPermanent target : targets) {
                game.doAction(new MagicLoseAbilityAction(target,MagicAbility.Defender));
            }
        }
    }
]
Pushed