Menu

Submission for Imaginary Pet

82

Config

name=Imaginary Pet
image=http://mtgimage.com/card/imaginary%20pet.jpg
value=2.500
rarity=R
type=Creature
subtype=Illusion
cost={1}{U}
pt=4/4
timing=main
requires_groovy_code
oracle=At the beginning of your upkeep, if you have a card in hand, return Imaginary Pet to its owner's hand.

Script

[
    new MagicAtYourUpkeepTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer upkeepPlayer) {
            return upkeepPlayer.getHandSize() >= 1 ?
                new MagicEvent(
                    permanent,
                    this,
                    "If PN has a card in hand, return SN to its owner's hand."
                ):
                MagicEvent.NONE;
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.getPlayer().getHandSize() >= 1) {
                game.doAction(new MagicRemoveFromPlayAction(event.getPermanent(),MagicLocationType.OwnersHand));
            }
        }
    }
]
Pushed