Menu

Submission for Glacial Chasm

7

Config

name=Glacial Chasm
image=http://mtgimage.com/card/glacial%20chasm.jpg
value=2.500
rarity=U
type=Land
ability=When SN enters the battlefield, sacrifice a land.;\
Creatures you control can't attack.
timing=land
requires_groovy_code
oracle=Cumulative upkeep—Pay 2 life. When Glacial Chasm enters the battlefield, sacrifice a land. Creatures you control can't attack. Prevent all damage that would be dealt to you.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            game.doAction(new MagicChangeCountersAction(
                permanent,
                MagicCounterType.Age,
                1
            ));
            return new MagicEvent(
                permanent,
                new MagicMayChoice("Pay cumulative upkeep?"),
                this,
                "PN may\$ lose 2 life for each Age counter on SN. " +
                " If he or she doesn't, sacrifice SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.doAction(new MagicChangeLifeAction(event.getPlayer(),-2 * event.getPermanent().getCounters(MagicCounterType.Age)));
            } else {
                game.doAction(new MagicSacrificeAction(event.getPermanent()));
            }
        }
    },
    new MagicIfDamageWouldBeDealtTrigger(MagicTrigger.PREVENT_DAMAGE) {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicDamage damage) {
            if (permanent.isController(damage.getTarget())) {
                // Prevention effect.
                damage.prevent();
            }
            return MagicEvent.NONE;
        }
    }
]
Pushed