Menu

Submission for Keeper of the Mind

36

Config

name=Keeper of the Mind
image=http://magiccards.info/scans/en/ex/36.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Wizard
cost={U}{U}
pt=1/2
timing=main
requires_groovy_code
oracle={U}, {T}: Choose target opponent who had at least two more cards in hand than you did as you activated this ability. Draw a card.

Script

def OPPONENT_WITH_TWO_MORE_CARDS = new MagicPlayerFilterImpl() {
    public boolean accept(final MagicSource source,final MagicPlayer player,final MagicPlayer target) {
        return target.isEnemy(player) && target.getHandSize() >= player.getHandSize() + 2;
    } 
};

def TARGET_OPPONENT_WITH_TWO_MORE_CARDS = new MagicTargetChoice(
    OPPONENT_WITH_TWO_MORE_CARDS,
    "target opponent who has at least two more cards in hand than you"
);

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                TARGET_OPPONENT_WITH_TWO_MORE_CARDS,
                this,
                "Draw a card."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.addEvent(MagicRuleEventAction.create("Draw a card.").getEvent(event.getSource()));
        }
    }
]
Pushed