Menu

Submission for Impending Disaster

82

Config

name=Impending Disaster
image=http://mtgimage.com/card/impending%20disaster.jpg
value=2.500
rarity=R
type=Enchantment
cost={1}{R}
timing=enchantment
requires_groovy_code
oracle=At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice Impending Disaster and destroy all lands.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return game.getNrOfPermanents(MagicType.Land) >= 7 ?
                new MagicEvent(
                    permanent,
                    this,
                    "If there are 7 or more lands in play, sacrifice SN and destroy all lands."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (game.getNrOfPermanents(MagicType.Land) >= 7) {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            final Collection<MagicPermanent> lands = game.filterPermanents(MagicTargetFilterFactory.LAND);
            for (final MagicPermanent land : lands) {
                game.doAction(new MagicDestroyAction(land));
            }
            }
        }
    }
]
Pushed