Menu

Submission for Zanam Djinn

90

Config

name=Zanam Djinn
image=http://mtgimage.com/card/zanam%20djinn.jpg
value=2.500
rarity=U
type=Creature
subtype=Djinn
cost={5}{U}
pt=5/6
ability=Flying
timing=main
requires_groovy_code
oracle=Flying. Zanam Djinn gets -2/-2 as long as blue is the most common color among all permanents or is tied for most common.

Script

def BLACK_PERMANENT=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasColor(MagicColor.Black) && 
               target.isPermanent();
    }
};

def BLUE_PERMANENT=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasColor(MagicColor.Blue) && 
               target.isPermanent();
    }
};

def GREEN_PERMANENT=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasColor(MagicColor.Green) && 
               target.isPermanent();
    }
};

def RED_PERMANENT=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasColor(MagicColor.Red) && 
               target.isPermanent();
    }
};

def WHITE_PERMANENT=new MagicPermanentFilterImpl(){
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
        return target.hasColor(MagicColor.White) && 
               target.isPermanent();
    }
};

[
    new MagicStatic(MagicLayer.ModPT) {
        @Override
        public void modPowerToughness(final MagicPermanent source, final MagicPermanent permanent, final MagicPowerToughness pt) {
            if (source.getGame().getNrOfPermanents(BLUE_PERMANENT) >=
                source.getGame().getNrOfPermanents(BLACK_PERMANENT) +
                source.getGame().getNrOfPermanents(GREEN_PERMANENT) +
                source.getGame().getNrOfPermanents(RED_PERMANENT) +
                source.getGame().getNrOfPermanents(WHITE_PERMANENT)) {
            pt.add(-2,-2);
            }
        }
    }
]
Pushed