- 18
- Posts
- 11
- Years
- Seen May 14, 2023
I was able to implement the physical special split in pokeruby with a very small amount of effort.
The first change was to add a new field to every move in /src/data/battle_moves.c, I called this 'isPhysical', which meant that if it was a physical I set it to 1 and for a special move set to 0, and for status moves set to 0. This meant I also had to find the definition of the battleMove struct, which was in /include/pokemon.h, in this I added u8 isPhysical; to the struct.
I also added two new functions to /include/battle.h, which were MOVE_IS_PHYSICAL and MOVE_IS_SPECIAL, these were implemented as follows;
#define MOVE_IS_PHYSICAL(move) (gBattleMoves[move].isPhysical == 1)
#define MOVE_IS_SPECIAL(move) (gBattleMoves[move].isPhysical == 0)
And the last change was to replace every instead of TYPE_IS_(PHYSICAL/SPECIAL) in calculate base damage in to MOVE_IS_(PHYSICAL/SPECIAL), as well as passing in move to these functions instead of type.
That's it, I'm sure there are some bugs, but I haven't tested it too much yet.
The first change was to add a new field to every move in /src/data/battle_moves.c, I called this 'isPhysical', which meant that if it was a physical I set it to 1 and for a special move set to 0, and for status moves set to 0. This meant I also had to find the definition of the battleMove struct, which was in /include/pokemon.h, in this I added u8 isPhysical; to the struct.
I also added two new functions to /include/battle.h, which were MOVE_IS_PHYSICAL and MOVE_IS_SPECIAL, these were implemented as follows;
#define MOVE_IS_PHYSICAL(move) (gBattleMoves[move].isPhysical == 1)
#define MOVE_IS_SPECIAL(move) (gBattleMoves[move].isPhysical == 0)
And the last change was to replace every instead of TYPE_IS_(PHYSICAL/SPECIAL) in calculate base damage in to MOVE_IS_(PHYSICAL/SPECIAL), as well as passing in move to these functions instead of type.
That's it, I'm sure there are some bugs, but I haven't tested it too much yet.
Last edited: