Menu

Submission for Shepherd of Rot

40

Config

name=Shepherd of Rot
image=http://mtgimage.com/card/shepherd%20of%20rot.jpg
value=2.500
rarity=C
type=Creature
subtype=Zombie,Cleric
cost={1}{B}
pt=1/1
timing=main
requires_groovy_code
oracle={T}: Each player loses 1 life for each Zombie on the battlefield.

Script

[
    new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "LifeLoss"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            final int X = source.getGame().getNrOfPermanents(MagicSubType.Zombie);
            return new MagicEvent(
                source,
                this,
                "Each player loses 1 life for each Zombie on the battlefield."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
                final int X = game.getNrOfPermanents(MagicSubType.Zombie);
                for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicChangeLifeAction(player,-X));
            }
        }
    }
]
Pushed