Menu

Submission for Thwart

108

Config

name=Thwart
image=http://mtgimage.com/card/thwart.jpg
value=2.500
rarity=U
type=Instant
cost={2}{U}{U}
effect=Counter target spell.
timing=counter
requires_groovy_code
oracle=You may return three Islands you control to their owner's hand rather than pay Thwart's mana cost. Counter target spell.

Script

def THREE_ISLANDS_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(MagicSubType.Island) >= 3;
    }
};

def choice = new MagicTargetChoice("an Island you control");

[
     new MagicCardActivation(
        [THREE_ISLANDS_CONDITION, MagicCondition.CARD_CONDITION],
        new MagicActivationHints(MagicTiming.Draw),
        "NoCost"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicCard source) {
            return [ 
            new MagicBounceChosenPermanentEvent(source,choice),
            new MagicBounceChosenPermanentEvent(source,choice),
            new MagicBounceChosenPermanentEvent(source,choice)
            ];
        }
    }
]
Pushed