Menu

Submission for Enlistment Officer

9

Comment

Adapted from Garruk, Caller of Beasts

Config

name=Enlistment Officer
image=http://mtgimage.com/card/enlistment%20officer.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Soldier
cost={3}{W}
pt=2/3
ability=First strike
timing=main
requires_groovy_code
oracle=First strike. When Enlistment Officer enters the battlefield, reveal the top four cards of your library. Put all Soldier cards revealed this way into your hand and the rest on the bottom of your library in any order.

Script

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                this,
                "Reveal the top four cards of your library. Put all Soldier cards revealed this way into your hand and the rest on the bottom of your library in any order."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicCardList library = event.getPlayer().getLibrary();
            for (int i = 0; i < 4 && library.isEmpty() == false; i++) {
                final MagicCard top = library.getCardAtTop();
                game.doAction(new MagicRemoveCardAction(
                    top,
                    MagicLocationType.OwnersLibrary
                ));
                game.doAction(new MagicMoveCardAction(
                    top,
                    MagicLocationType.OwnersLibrary,
                    top.hasSubType(MagicSubType.Soldier) ?
                      MagicLocationType.OwnersHand :
                      MagicLocationType.BottomOfOwnersLibrary
                ));
            }
        }
    }
]
Pushed