diff options
| author | Idain <luiscarlosholguinperez@outlook.com> | 2021-11-17 23:10:45 -0400 |
|---|---|---|
| committer | Idain <luiscarlosholguinperez@outlook.com> | 2021-11-17 23:10:45 -0400 |
| commit | ce768f657139c257269bb6cc56ef9abbb51d9203 (patch) | |
| tree | 53ec62e47a91928419fca2d1b2500f04477563c8 /Add-a-new-trainer-class.md | |
| parent | 39d1b292d96648e8d7a7ba54b8687132bad123c2 (diff) | |
Update macros.
Diffstat (limited to 'Add-a-new-trainer-class.md')
| -rw-r--r-- | Add-a-new-trainer-class.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Add-a-new-trainer-class.md b/Add-a-new-trainer-class.md index f333727..1e558f1 100644 --- a/Add-a-new-trainer-class.md +++ b/Add-a-new-trainer-class.md @@ -31,12 +31,11 @@ Edit [constants/trainer_constants.asm](../blob/master/constants/trainer_constant ; - BTTrainerClassSprites (see data/trainers/sprites.asm) ; - BTTrainerClassGenders (see data/trainers/genders.asm) ; trainer constants are Trainers indexes, for the sub-tables of TrainerGroups (see data/trainers/parties.asm) - enum_start - CHRIS EQU __enum__ + CHRIS EQU __trainer_class__ trainerclass TRAINER_NONE ; 0 ... - KRIS EQU __enum__ + KRIS EQU __trainer_class__ trainerclass FALKNER ; 1 const FALKNER1 @@ -48,14 +47,14 @@ Edit [constants/trainer_constants.asm](../blob/master/constants/trainer_constant + trainerclass PARASOL_LADY + const SUE - NUM_TRAINER_CLASSES EQU __enum__ + NUM_TRAINER_CLASSES EQU __trainer_class__ - 1 ``` The `trainerclass` macro defines the next trainer class constant, and prepares to define a sequence of constants for individual trainers. Here we've defined `SUE` as the only Parasol Lady. -(Note the `CHRIS` and `KRIS` constants, equal to 0 and 1 respectively; they're used for getting the correct color palette when displaying the player's sprite in the introduction and on the trainer card. `KRIS` is equal to `FALKNER`, which is why they share a palette.) +Note the `CHRIS` and `KRIS` constants, equal to 0 and 1 respectively; they're used for getting the correct color palette when displaying the player's sprite in the introduction and on the trainer card. `KRIS` is equal to `FALKNER`, which is why they share a palette. -Be careful when naming trainer constants; either make them unique, or make them unambiguous (like `BUG_CATCHER_BENNY` and `BIKER_BENNY`). I once made a trainer constant `SPARK` and caused a bug because `SPARK` was already a move constant. (That's why we have suffixes for `BLACKBELT_T` (trainer) and `BLACKBELT_I` (item), or `PSYCHIC_T` (trainer), `PSYCHIC_M` (move), and `PSYCHIC_TYPE` (type).) +Be careful when naming trainer constants; either make them unique, or make them unambiguous (like `BUG_CATCHER_BENNY` and `BIKER_BENNY`). I once made a trainer constant `SPARK` and caused a bug because `SPARK` was already a move constant. (That's why we have suffixes for `BLACKBELT_T` [trainer] and `BLACKBELT_I` [item], or `PSYCHIC_T` [trainer], `PSYCHIC_M` [move], and `PSYCHIC_TYPE` [type].) Next we'll add data for the new `PARASOL_LADY` class to all those tables mentioned in the top comment. @@ -67,13 +66,14 @@ Edit [data/trainers/class_names.asm](../blob/master/data/trainers/class_names.as ```diff TrainerClassNames:: ; entries correspond to trainer classes (see constants/trainer_constants.asm) - db "LEADER@" + list_start TrainerClassNames + li "LEADER" ... - db "MYSTICALMAN@" -+ db "PARASOL LADY@" + li "MYSTICALMAN" ++ li "PARASOL LADY" ``` -A name can be up to 12 characters long, plus a "@" at the end. Note that the trainer class and individual name will get printed on one line in phrases like "PARASOL LADY SUE wants to battle!" so make sure the whole phrase will fit in 18 characters. +A name can be up to 12 characters long. Note that the trainer class and individual name will get printed on one line in phrases like "PARASOL LADY SUE wants to battle!" so make sure the whole phrase will fit in 18 characters. ## 3. Define their attributes |
