Menu

Submission for Well of Discovery

140

Config

name=Well of Discovery
image=http://mtgimage.com/card/well%20of%20discovery.jpg
value=2.500
rarity=R
type=Artifact
cost={6}
timing=main
requires_groovy_code
oracle=At the beginning of your end step, if you control no untapped lands, draw a card.

Script

[
    new MagicAtEndOfTurnTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer endofturnPlayer) {
            return permanent.getController().controlsPermanent(MagicTargetFilterFactory.UNTAPPED_LAND) == false ?
                new MagicEvent(
                    permanent,
                    this,
                    "Draw a card."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getPlayer().controlsPermanent(MagicTargetFilterFactory.UNTAPPED_LAND) == false) {
                game.doAction(new MagicDrawAction(event.getPlayer()));
            }
        }
    }
]
Pushed