Mechanic Code Focusing on Card type.

Login or register to post comments
Wed, 2015-12-23 20:19
popcornguy13
popcornguy13's picture

So, I'm not proficient with Magic Set Editor Mechanic coding, and I've created a complex mechanic that will become too wordy if I type it out. Could I have some help coding it?

The Mechanic is called Duplicate.

Keyword: Duplicate
Match: Duplicate<cost>

What I'm trying to do is make the keyword say.

"When you cast this spell..."
And then for creatures say, "...put a creature token that's a copy of it onto the battlefield for each time you paid its duplicate cost."

And for instants and sorceries, "...copy it for each time you paid its duplicate cost."

Any guidance as to how I can do this?

Wed, 2015-12-23 20:22
thehuw
thehuw's picture

Provided it's not on any noncreature permanents, you can use "if has_pt()", as follows:

When you cast this spell, {if has_pt() then "put a creature token that's a copy of it onto the battlefield for each time you paid its duplicate cost" else "copy it for each time you paid its duplicate cost"}.

I think this works. Let me know.

Red mana symbolWhite mana symbolBlack mana symbol
Set Huwb
They/them pronouns, please.
Praise Vectron.

Wed, 2015-12-23 20:35
popcornguy13
popcornguy13's picture

It did. Thanks much.

Sun, 2017-11-12 01:42
Sade612
Sade612's picture

I've been playing with vehicles and other noncreature permanents that have power and toughness. I used a Boolean to read the card-type as follows:

{if contains(card.type, match:"Creature") then "dies" else "is put into a graveyard from the battlefield"}