Menu

Submission for Stern Judge

16

Config

name=Stern Judge
image=http://mtgimage.com/card/stern%20judge.jpg
value=2.500
rarity=U
type=Creature
subtype=Human,Cleric
cost={2}{W}
pt=2/2
timing=main
requires_groovy_code
oracle={T}: Each player loses 1 life for each Swamp he or she controls.

Script

[
   new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Removal),
        "-Life"
    ) {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicTapEvent(source)
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                this,
                "Each player loses 1 life for each swamp he or she controls."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            for (final MagicPlayer player : game.getAPNAP()) {
                game.doAction(new MagicChangeLifeAction(
                    player, 
                    player.getNrOfPermanents(MagicSubType.Swamp)
                ));
            }
        }
    }
]
Pushed