Menu

Submission for Honden of Night's Reach

91

Config

 name=Honden of Night's Reach
url=http://magiccards.info/query?q=%21honden%20of%20night%27s%20reach
image=http://mtgimage.com/card/honden%20of%20night%27s%20reach.jpg
value=3.884
rarity=U
type=Legendary,Enchantment
subtype=shrine
cost={3}{B}
timing=main
requires_groovy_code

Script

def SHRINES_YOU_CONTROL = new MagicPermanentFilterImpl() {
        public boolean accept(final MagicGame game,final MagicPlayer player,final MagicPermanent target) {
            return target.isController(player) &&
                   target.hasSubType(MagicSubType.Shrine);
        }
    };

[
    new MagicAtUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
            return (permanent.getController() == upkeepPlayer) ? new MagicEvent(
                permanent,
                MagicTargetChoice.TARGET_OPPONENT,
                this,
                "Target opponent\$ discards a card for each Shrine PN controls."
            ):
            MagicEvent.NONE
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final int size = (game.filterPermanents(event.getPlayer(),SHRINES_YOU_CONTROL).size());
            event.processTarget(game, {
                final MagicPlayer player ->
                game.addEvent(MagicDiscardEvent.Random(event.getSource(), player, size));
            });
        }
    }
]
Pushed