Menu

Submission for Tinker

14

Comment

tested in magarena 1.43

Config

name=Tinker
url=http://magiccards.info/fve/en/14.html
image=http://magiccards.info/scans/en/fve/14.jpg
value=4.640
rarity=M
type=Sorcery
cost={2}{U}
timing=main
requires_groovy_code

Script

def ARTIFACT_CARD_FROM_LIBRARY = new MagicCardFilterImpl() {
    public boolean accept(final MagicGame game,final MagicPlayer player,final MagicCard target) {
        return target.hasType(MagicType.Artifact);
    }
    public boolean acceptType(final MagicTargetType targetType) {
        return targetType == MagicTargetType.Library;
    }
};

def AN_ARTIFACT_CARD_FROM_LIBRARY = new MagicTargetChoice(
    ARTIFACT_CARD_FROM_LIBRARY,
    "an artifact card"
);

[
    new MagicAdditionalCost() {
        @Override
        public MagicEvent getEvent(final MagicSource source) {
            return new MagicSacrificePermanentEvent(source, MagicTargetChoice.SACRIFICE_ARTIFACT);
        }
    },
	new MagicSpellCardEvent() {
        @Override
        public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
            return new MagicEvent(
                cardOnStack,
                this,
                "PN may search his or her library for an artifact card and put it on the battlefield, then shuffle his or her library."
            );
        }
        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
            game.addEvent(new MagicSearchOntoBattlefieldEvent(
                event,
                AN_ARTIFACT_CARD_FROM_LIBRARY
            ));
        }
    }
]
Pushed