Menu

Submission for Sea Serpent

60

Comment

This groovy represents the ability keyword "Islandhome". While some of the old pictures read "bury" (destroy and can't be regenerated), they were all oracled to "sacrifice" instead.

Config

name=Sea Serpent
image=http://mtgimage.com/card/sea%20serpent.jpg
value=2.500
rarity=C
type=Creature
subtype=Serpent
cost={5}{U}
pt=5/5
timing=main
requires_groovy_code
oracle=Sea Serpent can't attack unless defending player controls an Island. When you control no Islands, sacrifice Sea 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.Island);
        }
    },
    new MagicStatic(MagicLayer.Game) {
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source.getController().controlsPermanent(MagicSubType.Island) == 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