Menu

Submission for Barren Glory

3

Config

name=Barren Glory
image=http://mtgimage.com/card/barren%20glory.jpg
value=2.500
rarity=R
type=Enchantment
cost={4}{W}{W}
timing=enchantment
requires_groovy_code
oracle=At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return upkeepPlayer.controlsPermanent(new MagicOtherPermanentTargetFilter(
                MagicTargetFilterFactory.PERMANENT_YOU_CONTROL, permanent)) == false &&
                upkeepPlayer.getHandSize() == 0 ?
                new MagicEvent(
                    permanent,
                    this,
                    "PN wins the game."
                ):
                MagicEvent.NONE;
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicLoseGameAction(event.getPlayer().getOpponent()));
        };
    }
]
Pushed