Menu

Submission for Augury Adept

227

Config

name=Augury Adept
image=http://mtgimage.com/card/augury%20adept.jpg
value=2.500
rarity=R
type=Creature
subtype=Kithkin,Wizard
cost={1}{W/U}{W/U}
pt=2/2
timing=main
requires_groovy_code
oracle=Whenever Augury Adept deals combat damage to a player, reveal the top card of your library and put that card into your hand. You gain life equal to its converted mana cost.

Script

[
    new MagicWhenSelfCombatDamagePlayerTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
            return new MagicEvent(
                permanent,
                this,
                "Reveal the top card of PN's library and put that card into PN's hand. PN gains life equal to its converted mana cost."
            );
        }
        @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
                ));
                game.doAction(new MagicMoveCardAction(
                    card,
                    MagicLocationType.OwnersLibrary,
                    MagicLocationType.OwnersHand
                ));
                game.doAction(new MagicChangeLifeAction(
                    event.getPlayer(), 
                    card.getConvertedCost()
                ));
            }
        }
    }
]
Pushed