Coding FAQs
Q: Where would I find cards that are not in the /src/cards c files? I want to look at some other already exsisting cards in their raw c format. Take for instance Ancestrial recall where would I find it decompiled into raw c text? or how do I decompile it?
A: Form the tutorial, you should know how to find the ASM code for any card. (look on the Magic.exe tab for the code pointer, and then click the '...' button to view the code.
There is also a version of Manalink 2.01 decompiled into C. It can be found here: http://www.savefile.com/files/2088274
To find the code for a specific card, search for the address of the code pointer. You'll find a sub with that name. That's the code. Of course, since decompiling saves no symbolic information, such as variable names, the code isn't always too helpful.
The .c file can be useful for figuring out where to inject code (injecting code). For example, there used to be a bug that the shock lands did not count as basic lands for Kird Ape, land walk, etc. This was strange, since the code for Template Garden was directly copied from the code for Savannah. So we suspected that there was some hard-coded id's of the dual lands somewhere else in the code. I searched the .c file for the ids of the dual lands, and found one sub that referred to the 10 id's, one after another. So I was able to look at the name of the sub that the code was in, and that name is the same as the address in Magic.exe. From there I was able to inject some code to also look for the ids of the shock lands.
