Menu

Submission for Psychic Drain

220

Config

name=Psychic Drain
url=http://magiccards.info/query?q=%21psychic%20drain
image=http://mtgimage.com/card/psychic%20drain.jpg
value=3.470
rarity=R
type=Sorcery
cost={X}{U}{B}
timing=main
requires_groovy_code

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            final int amount=payedCost.getX();
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_PLAYER,  
                amount,
                this,
                "Target player puts the top "+amount+" cards of his or her library into his or her graveyard and PN gains "+amount+" life."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                final MagicPlayer player ->
                game.doAction(new MagicMillLibraryAction(player,event.getRefInt()));
            });
            game.doAction(new MagicChangeLifeAction(event.getPlayer(), event.getRefInt()));
        }
    }
]
Pushed