Add step for relocating `#undef move` to later in the same function in Phys/Spec guide

Matthew Cabral 2022-01-22 00:08:03 -05:00
parent e3ac8febdc
commit 1f61dd19fd
1 changed files with 7 additions and 1 deletions

@ -138,7 +138,7 @@ if (defender->ability == ABILITY_THICK_FAT && (type == TYPE_FIRE || type == TYPE
The next thing we need to do is change the arguments passed to IS_TYPE_PHYSICAL and IS_TYPE_SPECIAL. Originally, they were passed a type argument, but now we want to pass a move argument. There are two instances of these functions in **src/pokemon.c**, three more in **src/battle_script_commands.c**, and two more in **src/battle_tv.c**.
In **src/pokemon.c**, the first one originally reads like this:
In **pokemon.c**, the first one originally reads like this:
```c
IS_TYPE_PHYSICAL(type)
```
@ -181,6 +181,12 @@ and
```c
IS_TYPE_SPECIAL(move)
```
In order for the `move` variable to stay defined, we will also have to relocate the line `#undef move` in **battle_tv.c** to later in the same function. For simplicity, you can place it next to the other `#undef`'s. It would then look like this:
```c
#undef move
#undef type
#undef power
```
## 4. Adding the physicality byte to moves
The last step is definitely the most tedious, but it is very simple. We need to go through every move and define whether it is physical, special, or other. The file that defines all move effects is located at **src/data/battle_moves.h**. There are plenty of resources to find out which one a move is if you do not already know. After adding these, the split is implemented. For reference, here is one example of each possible value of the physicality byte for my names and values: