Menu

Submission for Bog Serpent

84

Config

name=Bog Serpent
image=http://mtgimage.com/card/bog%20serpent.jpg
value=2.500
rarity=C
type=Creature
subtype=Serpent
cost={5}{B}
pt=5/5
timing=main
requires_groovy_code
oracle=Bog Serpent can't attack unless defending player controls a Swamp. When you control no Swamps, sacrifice Bog Serpent.

Script

[	
	new MagicStatic(
        MagicLayer.Ability
    ) {
        @Override
        public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
            permanent.addAbility(MagicAbility.CannotAttack, flags);
        }
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return !source.getController().getOpponent().controlsPermanent(MagicSubType.Swamp);
        }
    },
    new MagicStatic(MagicLayer.Game) {
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source.getController().controlsPermanent(MagicSubType.Swamp) == false;
        }
        @Override
        public void modGame(final MagicPermanent source, final MagicGame game) {
            game.doAction(new MagicPutStateTriggerOnStackAction(new MagicEvent(
                source,
                {
                    final MagicGame G, final MagicEvent E ->
                    G.doAction(new MagicSacrificeAction(E.getPermanent()));
                },
                "Sacrifice SN."
            )));
        }
    }
]
Pushed