Menu

Submission for Phenax, God of Deception

152

Config

 name=Phenax, God of Deception
url=http://magiccards.info/query?q=%21phenax%2C%20god%20of%20deception
image=http://mtgimage.com/card/phenax%2C%20god%20of%20deception.jpg
value=3.582
rarity=M
type=Legendary,Enchantment,Creature
subtype=God
cost={3}{U}{B}
pt=4/7
ability=indestructible
timing=main
requires_groovy_code

Script

def millX = new MagicPermanentActivation(new MagicActivationHints(MagicTiming.Main),"Mill") {
        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [new MagicTapEvent(source)];
        }
        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source,final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.TARGET_PLAYER,
                this,
                "Target Player puts the top X cards of his or her library into his or her graveyard, where X is SN's toughness."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            event.processTargetPlayer(game, {
                final MagicPlayer targetPlayer ->
                game.doAction(new MagicMillLibraryAction(targetPlayer,event.getPermanent().getToughness()));
            });
        }
    };

[
    new MagicStatic(MagicLayer.Type) {
        @Override
        public int getTypeFlags(final MagicPermanent permanent,final int flags) {
            return flags & ~MagicType.Creature.getMask();
        }
        @Override
        public void modSubTypeFlags(final MagicPermanent permanent,final Set<MagicSubType> flags) {
            flags.remove(MagicSubType.God);
        }
        @Override
        public boolean condition(final MagicGame game,final MagicPermanent source,final MagicPermanent target) {
            return source.getController().getDevotion(MagicColor.Black, MagicColor.Blue) < 7;
        }
    },
    new MagicStatic(MagicLayer.Ability,MagicTargetFilter.TARGET_CREATURE_YOU_CONTROL) {
        @Override
        public void modAbilityFlags(final MagicPermanent source,final MagicPermanent permanent,final Set<MagicAbility> flags) {
            permanent.addAbility(millX);
        }
    }
]
Pushed