Menu

Submission for Embermage Goblin

200

Config

name=Embermage Goblin
image=http://mtgimage.com/card/embermage%20goblin.jpg
value=2.500
rarity=U
type=Creature
subtype=Goblin,Wizard
cost={3}{R}
pt=1/1
ability={T}: SN deals 1 damage to target creature or player.
timing=main
requires_groovy_code
oracle=When Embermage Goblin enters the battlefield, you may search your library for a card named Embermage Goblin, reveal it, and put it into your hand. If you do, shuffle your library. {T}: Embermage Goblin deals 1 damage to target creature or player.

Script

def CARD_NAMED_EMBERMAGE_GOBLIN = new MagicCardFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicCard target) {
        return target.getName().equals("Embermage Goblin");
    }
    public boolean acceptType(final MagicTargetType targetType) {
        return targetType==MagicTargetType.Library;
    }
};

[
    new MagicWhenComesIntoPlayTrigger() {
        @Override
        public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPayedCost payedCost) {      
            return new MagicEvent(
                permanent,
                new MagicMayChoice(),
                this,
                "PN may\$ search his or her library for a card named Embermage Goblin, " + 
                "reveal it, and put it into PN's hand. If PN does, shuffle PN's library."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            if (event.isYes()) {
                game.addEvent(new MagicSearchToLocationEvent(
                    event,
                    new MagicTargetChoice(
                        CARD_NAMED_EMBERMAGE_GOBLIN, 
                        "a card named Embermage Goblin"
                    ),
                    MagicLocationType.OwnersHand
                ));
            }
        }
    }
]
Pushed