Menu

Submission for Zoologist

285

Config

name=Zoologist
image=http://mtgimage.com/card/zoologist.jpg
value=2.500
rarity=R
type=Creature
subtype=Human,Druid
cost={3}{G}
pt=1/2
timing=main
requires_groovy_code
oracle={3}{G}, {T}: Reveal the top card of your library. If it's a creature card, put it onto the battlefield. Otherwise, put it into your graveyard.

Script

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Reveal the top card of PN's library. If it's a creature card, put it onto the battlefield. " + 
                "Otherwise, put it into your graveyard."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            for (final MagicCard card : event.getPlayer().getLibrary().getCardsFromTop(1)) {
                game.doAction(new MagicRevealAction(card));
                game.doAction(new MagicRemoveCardAction(
                    card,
                    MagicLocationType.OwnersLibrary
                ));
                if (card.hasType(MagicType.Creature)) {
                    game.doAction(new MagicPlayCardAction(
                        card,
                        event.getPlayer()
                    ));
                } else {
                    game.doAction(new MagicMoveCardAction(
                        card,
                        MagicLocationType.OwnersLibrary,
                        MagicLocationType.Graveyard
                    ));
                }
            }
        }
    }
]
Pushed