Menu

Submission for Chromescale Drake

20

Config

name=Chromescale Drake
image=http://mtgimage.com/card/chromescale%20drake.jpg
value=2.500
rarity=R
type=Creature
subtype=Drake
cost={6}{U}{U}{U}
pt=3/4
ability=Affinity for artifacts;\
Flying
timing=main
requires_groovy_code
oracle=Affinity for artifacts. Flying. When Chromescale Drake enters the battlefield, reveal the top three cards of your library. Put all artifact cards revealed this way into your hand and the rest into your graveyard.

Script

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                this,
                "Reveal the top three cards of your library. Put all artifact cards revealed this way into your hand and the rest into your graveyard."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicCardList top3 = event.getPlayer().getLibrary().getCardsFromTop(3);
            for (final MagicCard top : top3) {
                game.doAction(new MagicRevealAction(top3));
                game.doAction(new MagicRemoveCardAction(
                    top,
                    MagicLocationType.OwnersLibrary
                ));
                game.doAction(new MagicMoveCardAction(
                    top,
                    MagicLocationType.OwnersLibrary,
                    top.hasType(MagicType.Artifact) ?
                      MagicLocationType.OwnersHand :
                      MagicLocationType.Graveyard
                ));
            }
        }
    }
]
Pushed