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.

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"}

Fri, 2017-11-24 09:06
Mahx Michael
Mahx Michael's picture

Yes. In the duplicate scenario, I would reccomend using @Sade612's method, concidering it would behave differently for any permanent card, not only for creatures. Also, unless you have already done so, I would change "creature token" in the reminder text to ajust to the cards type as well, so that if it is an artifact, it would become "artifact token" instead. An alternative can be to just change it to just "token" to make it more uniformal, because the "that's a copy of it" part would give it the "creature" type either way, when it' becomes a copy of a creature. Then it would also apply for other permanent types as well.

Fri, 2017-11-24 11:26
fireantprincess
fireantprincess's picture

Also, you can shorten "put a token onto battlefield" to "create a token" since that's the new wording.