Menu

Submission for Bottled Cloister

256

Config

name=Bottled Cloister
image=http://magiccards.info/scans/en/rav/256.jpg
value=2.500
rarity=R
type=Artifact
cost={4}
timing=artifact
requires_groovy_code
oracle=At the beginning of each opponent's upkeep, exile all cards from your hand face down. At the beginning of your upkeep, return all cards you own exiled with Bottled Cloister to your hand, then draw a card.

Script

[
    new MagicAtUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game, final MagicPermanent permanent, final MagicPlayer upkeepPlayer) {
            return permanent.isOpponent(upkeepPlayer) ?
                new MagicEvent(
                    permanent,
                    this,
                    "Exile all cards from your hand."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            final MagicCardList hand = new MagicCardList(event.getPlayer().getHand());
            for (final MagicCard card : hand) {
                game.doAction(new MagicExileLinkAction(
                    event.getPermanent(),
                    card,
                    MagicLocationType.OwnersHand
                ));
            }
        }
    },
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return new MagicEvent(
                permanent,
                this,
                "Return all cards you own exiled with SN to PN's hand, then draw a card."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.doAction(new MagicReturnLinkedExileAction(
                event.getPermanent(),
                MagicLocationType.OwnersHand
            ));
            game.doAction(new MagicDrawAction(event.getPlayer(),1));
        }
    }
]
Pushed