Pokeruby is a decompilation of Pokemon Ruby & Sapphire. ProjectRevoTPP is absolutely certain that this will be the next wave of hacking Pokemon games, so I decided to give it a shot and slap a new type in.
Was it easier than hacking the binary ROM? Well, that depends on your preference. If you can't or refuse to read source code, you might enjoy repointing tables. Personally, I've been doing both for a while, but I think editing the source code is a lot easier.
In this tutorial, I will be adding a Fairy type, include the type image & effectiveness chart.
Here is the result:
Step 0: Setup Pokeruby
You can follow Revo's tutorial here.
I am using commit 09b8f4c09e69a2359cdf5e4497b97aca3746b8b1 (future commits will most likely be the same unless some things are renamed).
Step 1: Add the new Type Constant
All types have an ID associated with them. We need to put the ID of our new type in two places.
types := normal fight flying poison ground rock bug ghost steel mystery fire water grass electric psychic ice dragon dark fairy
This will build, but if you check in game you'll see the wrong palette!
To fix this, we need to change what palette is loaded for our type image.
The code that maps types to image palettes is in src/pokemon_summary_screen.c:
And that's it! You can try out your new type by changing an existing Pokemon or move.
I changed Tackle to the TYPE_FAIRY and got the result I put above!
If you want a summary of the changes as a git commit, you can view them here.
First of all, I have to say you did an amazing work here dude. The tutorial is easy to understand and the changes are well explained.
With that being said, are you sure these are all the changes to get a fully working Fairy type?
In some sort of united effort between Wahackforo, me and some other people in some other place, we also tried to add the Fairy type to Pokeruby almost 2 months ago, and along all the changes you're showing here, we also had to do some other changes that are not being shown in this thread, changes in pokemon_summary_screen.c and changes in the pokedex.c file too. Click here to read the full post that I wrote in Wahack with all the changes.