Clarified argument changing section in Add Phys/Spec Split guide (markdown)

Matthew Cabral 2022-01-21 23:29:57 -05:00
parent d3458e0031
commit 2dbc98291e
1 changed files with 24 additions and 3 deletions

@ -136,7 +136,26 @@ if (defender->ability == ABILITY_THICK_FAT && (type == TYPE_FIRE || type == TYPE
gBattleMovePower /= 2;
```
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 is one instance of each of these functions in **src/pokemon.c**, three more in **src/battle_script_commands.c**, and two more in **src/battle_tv.c**. The ones in **pokemon.c** should be changed from IS_TYPE_PHYSICAL(type) and IS_TYPE_SPECIAL(type) to IS_TYPE_PHYSICAL(gBattleMoves[move]) and IS_TYPE_SPECIAL(gBattleMoves[move]). The first one in **battle_script_commands.c** can also be changed like this, but the argument names are different for the second and third one. The second one looks like this originally:
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:
```c
IS_TYPE_PHYSICAL(type)
```
We will change this to:
```c
IS_TYPE_PHYSICAL(gBattleMoves[gCurrentMove])
```
And the second one we will need to change from:
```c
IS_TYPE_SPECIAL(type)
```
to
```c
IS_TYPE_SPECIAL(gBattleMoves[gCurrentMove])
```
The first one in **battle_script_commands.c** can also be changed like this, but the argument names are different for the second and third one. The second one looks like this originally:
```c
IS_TYPE_PHYSICAL(type)
```
@ -152,7 +171,8 @@ We will change this to:
```c
IS_TYPE_SPECIAL(gBattleMoves[gCurrentMove])
```
The two in **battle_tv.c** can be changed to
And lastly, the two in **battle_tv.c** can be changed to:
```c
IS_TYPE_PHYSICAL(move)
```
@ -160,7 +180,8 @@ and
```c
IS_TYPE_SPECIAL(move)
```
Note that we have changed !IS_TYPE_PHYSICAL to IS_TYPE_SPECIAL; "not physical" no longer automatically means "special" due to the introduction of the "other/status" option.
**Note:** We have changed `!IS_TYPE_PHYSICAL` to `IS_TYPE_SPECIAL` because "not physical" no longer automatically means "special" due to the introduction of the "other/status" option.
## 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:
```c