Menu

Submission for Keeper of the Nine Gales

42

Config

name=Keeper of the Nine Gales
image=http://mtgimage.com/card/keeper%20of%20the%20nine%20gales.jpg
value=2.500
rarity=R
type=Creature
subtype=Bird,Wizard
cost={2}{U}
pt=1/2
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. {T}, Tap two untapped Birds you control: Return target permanent to its owner's hand.

Script

def UNTAPPED_BIRD_YOU_CONTROL=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target)
    {
        return target.hasSubType(MagicSubType.Bird) && 
               target.isUntapped() && 
               target.isController(player);
    }
};

def TWO_UNTAPPED_BIRD_CONDITION = new MagicCondition() {
    public boolean accept(final MagicSource source) {
        return source.getController().getNrOfPermanents(UNTAPPED_BIRD_YOU_CONTROL) >= 2;
    }
};

def AN_UNTAPPED_BIRD_YOU_CONTROL = new MagicTargetChoice(UNTAPPED_BIRD_YOU_CONTROL,"an untapped Bird you control");

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return MagicRuleEventAction.create(source, "Return target permanent to it's owner's hand.");
        }
    }
]
Pushed