Menu

Submission for Planar Portal

311

Config

name=Planar Portal
image=http://mtgimage.com/card/planar%20portal.jpg
value=2.500
rarity=R
type=Artifact
cost={6}
timing=main
requires_groovy_code
oracle={6}, {T}: Search your library for a card and put that card into your hand. Then shuffle your library.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Draw),
        "Search"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostEvent(source,"{6}"),
                new MagicTapEvent(source)
            ];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent permanent,final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                this,
                "PN searches PN's library for a card and puts it into PN's hand. Then shuffles PN's library."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.addEvent(new MagicSearchToLocationEvent(
                event,
                MagicTargetChoice.CARD_FROM_LIBRARY,
                MagicLocationType.OwnersHand
            ));
        }
    }
]
Pushed