Menu

Submission for Soldevi Digger

221

Config

name=Soldevi Digger
image=http://mtgimage.com/card/soldevi%20digger.jpg
value=2.500
rarity=R
type=Artifact
cost={2}
timing=artifact
requires_groovy_code
oracle={2}: Put the top card of your graveyard on the bottom of your library.

Script

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

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Put the top card of PN's graveyard on the bottom of PN's library."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicCardList top1 = event.getPlayer().getGraveyard().getCardsFromTop(1) ;
            for (final MagicCard top : top1) {
                game.doAction(new MagicRemoveCardAction(
                    top,
                    MagicLocationType.Graveyard
                ));
                game.doAction(new MagicMoveCardAction(
                    top,
                    MagicLocationType.Graveyard,
                    MagicLocationType.BottomOfOwnersLibrary
                ));
            }
        }
    }
]
Pushed