summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdain <luiscarlosholguinperez@outlook.com>2021-06-12 22:49:38 -0400
committerIdain <luiscarlosholguinperez@outlook.com>2021-06-12 22:49:38 -0400
commit61ecbbe13860c70dd7786e34adfdd713484502ce (patch)
tree6763226a464b69126062b41c93ea7c2b17cb19c3
parent03e37d9f022f9b569c1102299e1e98426f987d4e (diff)
Update to tutorial
-rw-r--r--Allow-more-trainer-parties,-with-individual-DVs,-stat-experience,-and-nicknames.md41
1 files changed, 22 insertions, 19 deletions
diff --git a/Allow-more-trainer-parties,-with-individual-DVs,-stat-experience,-and-nicknames.md b/Allow-more-trainer-parties,-with-individual-DVs,-stat-experience,-and-nicknames.md
index f080370..8430caf 100644
--- a/Allow-more-trainer-parties,-with-individual-DVs,-stat-experience,-and-nicknames.md
+++ b/Allow-more-trainer-parties,-with-individual-DVs,-stat-experience,-and-nicknames.md
@@ -54,19 +54,23 @@ Ironically, the numeric values of the `TRAINERTYPE_*` constants haven't even cha
Edit [wram.asm](../blob/master/wram.asm):
```diff
-- ds 3
-+wOtherTrainerType:: db
-+
-+ ds 2
+ ...
+ NEXTU
+ ; catch tutorial dude pack
+ wDudeNumItems:: db
+ wDudeItems:: ds 2 * 4 + 1
+
+ wDudeNumKeyItems:: db
+ wDudeKeyItems:: ds 18 + 1
- wLinkBattleRNs:: ds 10 ; d1fa
+ wDudeNumBalls:: db
+ wDudeBalls:: ds 2 * 4 + 1
+ ENDU
+- ds 4
++wOtherTrainerType:: db
++ ds 3
...
-
- wOtherTrainerClass:: ; d22f
- ; class (Youngster, Bug Catcher, etc.) of opposing trainer
- ; 0 if opponent is a wild Pokémon, not a trainer
- db
```
The `wOtherTrainerType` byte will store the trainer type while their data is being read.
@@ -417,7 +421,7 @@ LoadEnemyMon:
+ call GetPokemonName
ld hl, wStringBuffer1
+.got_nickname
- ld de, wEnemyMonNick
+ ld de, wEnemyMonNickname
ld bc, MON_NAME_LENGTH
call CopyBytes
```
@@ -448,7 +452,7 @@ Now you can give nicknames to enemy Pokémon. If the nickname is just `"@"`, it
For example, here's a party for your rival that give him nicknames, held items, and a new Pokémon:
```
- db "RIVAL@", TRAINERTYPE_NICKNAME | TRAINERTYPE_ITEM
+ db "?@", TRAINERTYPE_NICKNAME | TRAINERTYPE_ITEM
db 3, RATTATA, "@", NO_ITEM
db 5, TOTODILE, "JAWS@", BERRY
db -1 ; end
@@ -638,7 +642,7 @@ DVs are specified as `$AD, $SP`, where *A* = attack, *D* = defense, *S* = 
For example, here's a party with custom DVs:
```
- db "RIVAL@", TRAINERTYPE_DVS | TRAINERTYPE_ITEM
+ db "?@", TRAINERTYPE_DVS | TRAINERTYPE_ITEM
db 3, RATTATA, $87, $77, NO_ITEM
db 5, TOTODILE, ATKDEFDV_SHINY, SPDSPCDV_SHINY, BERRY
db -1 ; end
@@ -776,7 +780,7 @@ Then edit [engine/battle/core.asm](../blob/master/engine/battle/core.asm) again:
; Fill stats
ld de, wEnemyMonMaxHP
ld b, FALSE
- ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1) ; wLinkBattleRNs + 7 ; ?
+ ld hl, wEnemyMonDVs - (MON_DVS - MON_STAT_EXP + 1)
+ ld a, [wBattleMode]
+ cp TRAINER_BATTLE
+ jr nz, .no_stat_exp
@@ -825,7 +829,7 @@ Stat experience is specified as five *words*, not bytes, because each of the fiv
For example, here's a party with custom DVs, stat experience, held items, and moves:
```
- db "RIVAL@", TRAINERTYPE_DVS | TRAINERTYPE_STAT_EXP | TRAINERTYPE_ITEM | TRAINERTYPE_MOVES
+ db "?@", TRAINERTYPE_DVS | TRAINERTYPE_STAT_EXP | TRAINERTYPE_ITEM_MOVES
db 3, RATTATA
db PERFECT_DV, $de ; atk|def, spd|spc
dw $0040, $0060, $0020, $0040, $0000 ; hp, atk, def, spd, spc
@@ -853,9 +857,8 @@ Edit [wram.asm](../blob/master/wram.asm) again:
```diff
wOtherTrainerType:: db
+wTrainerGroupBank:: db
-
-- ds 2
-+ ds 1
+- ds 3
++ ds 2
```
The `wTrainerGroupBank` byte will store the trainer group's bank while a trainer's data is being read.
@@ -1211,7 +1214,7 @@ Edit [engine/overworld/wildmons.asm](../blob/master/engine/overworld/wildmons.as
+ ld [wTrainerGroupBank], a
+ inc hl
ld a, BANK(TrainerGroups)
- call GetFarHalfword
+ call GetFarWord
.skip_trainer
dec e