Menu

Submission for Rancid Earth

78

Config

name=Rancid Earth
image=http://mtgimage.com/card/rancid%20earth.jpg
value=2.500
rarity=C
type=Sorcery
cost={1}{B}{B}
timing=main
requires_groovy_code
oracle=Destroy target land. Threshold — If seven or more cards are in your graveyard, instead destroy that land and Rancid Earth deals 1 damage to each creature and each player.

Script

[
    new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                MagicTargetChoice.NEG_TARGET_LAND,
                this,
                "Destroy target land. " +
                "If seven or more cards are in your graveyard, SN deals 1 damage to each creature and each player."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPermanent(game, {
                game.doAction(new MagicDestroyAction(it));
                if (MagicCondition.THRESHOLD_CONDITION.accept(event.getSource())) {
                final Collection<MagicPermanent> targets=
                    game.filterPermanents(event.getPlayer(),MagicTargetFilterFactory.CREATURE);
                for (final MagicPermanent target : targets) {
                    game.doAction(new MagicDealDamageAction(event.getSource(),target,1));
            }
                for (final MagicPlayer player : game.getAPNAP()) {
                    game.doAction(new MagicDealDamageAction(event.getSource(),player,1));
                    }
                }
            });
        }
    }
]
Pushed