Menu

Submission for Land Equilibrium

40

Config

name=Land Equilibrium
image=http://mtgimage.com/card/land%20equilibrium.jpg
value=2.500
rarity=R
type=Enchantment
cost={2}{U}{U}
timing=enchantment
requires_groovy_code
oracle=If an opponent who controls at least as many lands as you do would put a land onto the battlefield, that player instead puts that land onto the battlefield then sacrifices a land.

Script

[
    new MagicWhenOtherComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPermanent otherPermanent) {
            return otherPermanent.isController(permanent.getController().getOpponent()) &&
                   otherPermanent.hasType(MagicType.Land) &&
                   otherPermanent.getController().getNrOfPermanents(MagicType.Land) >=
                   permanent.getController().getNrOfPermanents(MagicType.Land) ?
                new MagicEvent(
                    permanent,
                    otherPermanent.getController(),
                    this,
                    "PN sacrifices a land."
                ):
                MagicEvent.NONE;
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.addEvent(new MagicSacrificePermanentEvent(
                event.getSource(),
                event.getPlayer(),
                MagicTargetChoice.SACRIFICE_LAND
            ));
        }
    }
]
Pushed