Menu

Submission for Lich Lord of Unx

24

Config

name=Lich Lord of Unx
url=http://magiccards.info/arb/en/24.html
image=http://mtgimage.com/card/lich%20lord%20of%20Unx.jpg
value=3.657
rarity=R
type=Creature
subtype=Zombie,Wizard
cost={1}{U}{B}
pt=2/2
ability={U}{B},{T}: Put a 1/1 blue and black Zombie Wizard creature token onto the battlefield.
timing=main
requires_groovy_code

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Pump),
        "Mill"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [new MagicPayManaCostEvent(source,"{U}{U}{B}{B}")];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
         	return new MagicEvent(
                source,
                MagicTargetChoice.NEG_TARGET_PLAYER,
                this,
                "Target player\$ puts X cards from the top of his or her library into his or her graveyard " +
				"and loses X life where X is the number of Zombies you control."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                final MagicPlayer player ->
                final Collection<MagicPermanent> targets = game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.ZOMBIE_YOU_CONTROL);
				int amount = targets.size();
                game.doAction(new MagicMillLibraryAction(player,amount));
                game.doAction(new MagicChangeLifeAction(player,-amount));
            });
        }
    }
]
Pushed