Menu

Submission for Dromar's Cavern

138

Config

name=Dromar's Cavern
image=http://mtgimage.com/card/dromar%27s%20cavern.jpg
value=2.500
rarity=U
type=Land
subtype=Lair
mana=w3u3b3
ability={T}: Add {W} to your mana pool.;\
        {T}: Add {U} to your mana pool.;\
        {T}: Add {B} to your mana pool.
timing=land
requires_groovy_code
oracle=When Dromar's Cavern enters the battlefield, sacrifice it unless you return a non-Lair land you control to its owner's hand. {T}: Add {W}, {U}, or {B} to your mana pool.

Script

def NONLAIR_LAND=new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return !target.hasSubType(MagicSubType.Lair) && target.isLand();
    } 
};

def TARGET_NONLAIR_LAND = new MagicTargetChoice(
    NONLAIR_LAND,
    "target nonlair land"
);

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPayedCost payedCost) {
            return new MagicEvent(
                permanent,
                new MagicMayChoice(TARGET_NONLAIR_LAND),
                this,
                "PN may\$ return a nonlair land to his or her hand. If you don't, sacrifice SN."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicPermanent perm = event.getPermanent();
            if (event.getPlayer().controlsPermanent(NONLAIR_LAND) && event.isYes()) {
            event.processTargetPermanent(game, {
                game.doAction(new MagicRemoveFromPlayAction(it,MagicLocationType.OwnersHand));
            });     
            } else {
                game.doAction(new MagicSacrificeAction(perm));
            }
        }
    }
]
Pushed