Menu

Submission for Mogis, God of Slaughter

151

Config

 name=Mogis, God of Slaughter
url=http://magiccards.info/query?q=%21mogis%2C%20god%20of%20slaughter
image=http://mtgimage.com/card/mogis%2C%20god%20of%20slaughter.jpg
value=3.935
rarity=M
type=Legendary,Enchantment,Creature
subtype=God
cost={2}{B}{R}
pt=7/5
ability=indestructible
timing=main
requires_groovy_code

Script

[
    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.Red) < 7;
        }
    },
    new MagicAtUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
            return (permanent.isOpponent(upkeepPlayer)) ? new MagicEvent(
                permanent,
                permanent.getOpponent(),
                new MagicMayChoice(MagicTargetChoice.SACRIFICE_CREATURE),
                MagicSacrificeTargetPicker.create(),
                this,
                "SN deals 2 damage to PN unless he or she sacrifices a creature.\$"
            ):
            MagicEvent.NONE
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                event.processTargetPermanent(game, {
                    final MagicPermanent toSacrifice ->
                    game.doAction(new MagicSacrificeAction(toSacrifice));
                    
                });
            }
            if (event.isNo()) {
                final MagicDamage damage=new MagicDamage(event.getSource(),event.getPlayer(),2);
                game.doAction(new MagicDealDamageAction(damage));
            }
        }
    }
]
Pushed