Menu

Submission for Ronom Serpent

45

Config

name=Ronom Serpent
image=http://mtgimage.com/card/ronom%20serpent.jpg
value=2.500
rarity=C
type=Snow,Creature
subtype=Serpent
cost={5}{U}
pt=5/6
ability=SN can't attack unless defending player controls a snow land.
timing=main
requires_groovy_code
oracle=Ronom Serpent can't attack unless defending player controls a snow land. When you control no snow lands, sacrifice Ronom Serpent.

Script

def SNOW_LAND = new MagicPermanentFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasType(MagicType.Snow) && target.hasType(MagicType.Land);
    } 
};

def EFFECT = MagicRuleEventAction.create("Sacrifice SN.");

[
    new MagicStatic(MagicLayer.Game) {
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source.getController().controlsPermanent(SNOW_LAND) == false;
        }
        @Override
        public void modGame(final MagicPermanent source, final MagicGame game) {
            game.doAction(new MagicPutStateTriggerOnStackAction(
                EFFECT.getEvent(source)
            ));
        }
    }
]
Pushed