summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorentrpntr <entrpntr@gmail.com>2020-04-08 09:09:04 -0400
committerentrpntr <entrpntr@gmail.com>2020-04-08 09:09:04 -0400
commit1413f4ee55e7a2b434c6bc047ac6f8f9ae96bb79 (patch)
treeeacd77a2adedc0858164c8c845349d2d9660c4bc
parent8df3c3f15b443d48a7bbbaa5512da3088d954117 (diff)
Add engine/battle/read_trainer_[attributes|party].asm.
-rw-r--r--data/trainers/attributes.asm398
-rw-r--r--engine/battle/read_trainer_attributes.asm66
-rw-r--r--engine/battle/read_trainer_party.asm374
-rw-r--r--engine/menus/intro_menu.asm4
-rwxr-xr-xengine/pokemon/move_mon.asm2
-rw-r--r--home/time.asm12
-rw-r--r--main.asm23
-rw-r--r--pokegold.link1
-rw-r--r--pokesilver.link1
-rwxr-xr-xsram.asm157
-rw-r--r--wram.asm93
11 files changed, 907 insertions, 224 deletions
diff --git a/data/trainers/attributes.asm b/data/trainers/attributes.asm
new file mode 100644
index 00000000..86f5841c
--- /dev/null
+++ b/data/trainers/attributes.asm
@@ -0,0 +1,398 @@
+TrainerClassAttributes:
+; entries correspond to trainer classes (see constants/trainer_constants.asm)
+
+; Falkner
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Whitney
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Bugsy
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Morty
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Pryce
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Jasmine
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Chuck
+ db FULL_HEAL, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Clair
+ db FULL_HEAL, HYPER_POTION ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Rival1
+ db NO_ITEM, NO_ITEM ; items
+ db 15 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Pokemon Prof
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_AGGRESSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Will
+ db MAX_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Cal
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Bruno
+ db MAX_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Karen
+ db FULL_HEAL, MAX_POTION ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Koga
+ db FULL_HEAL, FULL_RESTORE ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Champion
+ db FULL_HEAL, FULL_RESTORE ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Brock
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Misty
+ db FULL_HEAL, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Lt Surge
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Scientist
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Erika
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Youngster
+ db NO_ITEM, NO_ITEM ; items
+ db 4 ; base reward
+ dw AI_BASIC | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Schoolboy
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_OFTEN
+
+; Bird Keeper
+ db NO_ITEM, NO_ITEM ; items
+ db 6 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OFFENSIVE | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Lass
+ db NO_ITEM, NO_ITEM ; items
+ db 6 ; base reward
+ dw AI_BASIC | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_OFTEN
+
+; Janine
+ db DIRE_HIT, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Cooltrainerm
+ db NO_ITEM, NO_ITEM ; items
+ db 12 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Cooltrainerf
+ db NO_ITEM, NO_ITEM ; items
+ db 12 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Beauty
+ db NO_ITEM, NO_ITEM ; items
+ db 22 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Pokemaniac
+ db NO_ITEM, NO_ITEM ; items
+ db 15 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_OFFENSIVE | AI_AGGRESSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Gruntm
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Gentleman
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_AGGRESSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Skier
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Teacher
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_OPPORTUNIST | AI_AGGRESSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Sabrina
+ db HYPER_POTION, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Bug Catcher
+ db NO_ITEM, NO_ITEM ; items
+ db 4 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Fisher
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_OFTEN
+
+; Swimmerm
+ db NO_ITEM, NO_ITEM ; items
+ db 2 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_OFFENSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Swimmerf
+ db NO_ITEM, NO_ITEM ; items
+ db 5 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Sailor
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_OFFENSIVE | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Super Nerd
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_SMART | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Rival2
+ db NO_ITEM, NO_ITEM ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Guitarist
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Hiker
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_OFFENSIVE | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Biker
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Blaine
+ db MAX_POTION, FULL_HEAL ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Burglar
+ db NO_ITEM, NO_ITEM ; items
+ db 22 ; base reward
+ dw AI_BASIC | AI_OFFENSIVE | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Firebreather
+ db NO_ITEM, NO_ITEM ; items
+ db 12 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_OFFENSIVE | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Juggler
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_SMART | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Blackbelt T
+ db NO_ITEM, NO_ITEM ; items
+ db 6 ; base reward
+ dw AI_BASIC | AI_OFFENSIVE | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Executivem
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_SMART | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Psychic T
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Picnicker
+ db NO_ITEM, NO_ITEM ; items
+ db 5 ; base reward
+ dw AI_BASIC | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Camper
+ db NO_ITEM, NO_ITEM ; items
+ db 5 ; base reward
+ dw AI_BASIC | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Executivef
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_SMART | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Sage
+ db NO_ITEM, NO_ITEM ; items
+ db 8 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Medium
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_TYPES | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Boarder
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Pokefanm
+ db NO_ITEM, NO_ITEM ; items
+ db 20 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_SMART | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Kimono Girl
+ db NO_ITEM, NO_ITEM ; items
+ db 18 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Twins
+ db NO_ITEM, NO_ITEM ; items
+ db 5 ; base reward
+ dw NO_AI
+ dw CONTEXT_USE | SWITCH_OFTEN
+
+; Pokefanf
+ db NO_ITEM, NO_ITEM ; items
+ db 20 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_SMART | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Red
+ db FULL_RESTORE, FULL_RESTORE ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Blue
+ db FULL_RESTORE, FULL_RESTORE ; items
+ db 25 ; base reward
+ dw AI_BASIC | AI_SETUP | AI_SMART | AI_AGGRESSIVE | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Officer
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_STATUS
+ dw CONTEXT_USE | SWITCH_SOMETIMES
+
+; Gruntf
+ db NO_ITEM, NO_ITEM ; items
+ db 10 ; base reward
+ dw AI_BASIC | AI_TYPES | AI_OPPORTUNIST | AI_CAUTIOUS | AI_STATUS | AI_RISKY
+ dw CONTEXT_USE | SWITCH_SOMETIMES
diff --git a/engine/battle/read_trainer_attributes.asm b/engine/battle/read_trainer_attributes.asm
new file mode 100644
index 00000000..3f4d4a98
--- /dev/null
+++ b/engine/battle/read_trainer_attributes.asm
@@ -0,0 +1,66 @@
+GetTrainerClassName:
+ ld hl, wRivalName
+ ld a, c
+ cp RIVAL1
+ jr z, .rival
+
+ ld [wCurSpecies], a
+ ld a, TRAINER_NAME
+ ld [wNamedObjectTypeBuffer], a
+ call GetName
+ ld de, wStringBuffer1
+ ret
+
+.rival
+ ld de, wStringBuffer1
+ push de
+ ld bc, TRAINER_CLASS_NAME_LENGTH
+ call CopyBytes
+ pop de
+ ret
+
+GetOTName:
+ ld hl, wOTPlayerName
+ ld a, [wLinkMode]
+ and a
+ jr nz, .ok
+
+ ld hl, wRivalName
+ ld a, c
+ cp RIVAL1
+ jr z, .ok
+
+ ld [wCurSpecies], a
+ ld a, TRAINER_NAME
+ ld [wNamedObjectTypeBuffer], a
+ call GetName
+ ld hl, wStringBuffer1
+
+.ok
+ ld bc, TRAINER_CLASS_NAME_LENGTH
+ ld de, wOTClassName
+ push de
+ call CopyBytes
+ pop de
+ ret
+
+GetTrainerAttributes:
+ ld a, [wTrainerClass]
+ ld c, a
+ call GetOTName
+ ld a, [wTrainerClass]
+ dec a
+ ld hl, TrainerClassAttributes + TRNATTR_ITEM1
+ ld bc, NUM_TRAINER_ATTRIBUTES
+ call AddNTimes
+ ld de, wEnemyTrainerItem1
+ ld a, [hli]
+ ld [de], a
+ inc de
+ ld a, [hli]
+ ld [de], a
+ ld a, [hl]
+ ld [wEnemyTrainerBaseReward], a
+ ret
+
+INCLUDE "data/trainers/attributes.asm"
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
new file mode 100644
index 00000000..18e23f13
--- /dev/null
+++ b/engine/battle/read_trainer_party.asm
@@ -0,0 +1,374 @@
+ReadTrainerParty:
+ ld a, [wLinkMode]
+ and a
+ ret nz
+
+ ld hl, wOTPartyCount
+ xor a
+ ld [hli], a
+ dec a
+ ld [hl], a
+
+ ld hl, wOTPartyMons
+ ld bc, wOTPartyMonsEnd - wOTPartyMons
+ xor a
+ call ByteFill
+
+ ld a, [wOtherTrainerClass]
+ cp CAL
+ jr nz, .not_cal2
+ ld a, [wOtherTrainerID]
+ cp CAL2
+ jr z, .cal2
+ ld a, [wOtherTrainerClass]
+.not_cal2
+
+ dec a
+ ld c, a
+ ld b, 0
+ ld hl, TrainerGroups
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+
+ ld a, [wOtherTrainerID]
+ ld b, a
+.skip_trainer
+ dec b
+ jr z, .got_trainer
+.loop
+ ld a, [hli]
+ cp -1
+ jr nz, .loop
+ jr .skip_trainer
+.got_trainer
+
+.skip_name
+ ld a, [hli]
+ cp "@"
+ jr nz, .skip_name
+
+ ld a, [hli]
+ ld c, a
+ ld b, 0
+ ld d, h
+ ld e, l
+ ld hl, TrainerTypes
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld bc, .done
+ push bc
+ jp hl
+
+.done
+ jp ComputeTrainerReward
+
+.cal2
+ ld a, BANK(sMysteryGiftTrainer)
+ call OpenSRAM
+ ld de, sMysteryGiftTrainer
+ call TrainerType2
+ call CloseSRAM
+ jr .done
+
+TrainerTypes:
+; entries correspond to TRAINERTYPE_* constants
+ dw TrainerType1 ; level, species
+ dw TrainerType2 ; level, species, moves
+ dw TrainerType3 ; level, species, item
+ dw TrainerType4 ; level, species, item, moves
+
+TrainerType1:
+; normal (level, species)
+ ld h, d
+ ld l, e
+.loop
+ ld a, [hli]
+ cp $ff
+ ret z
+
+ ld [wCurPartyLevel], a
+ ld a, [hli]
+ ld [wCurPartySpecies], a
+ ld a, OTPARTYMON
+ ld [wMonType], a
+ push hl
+ predef TryAddMonToParty
+ pop hl
+ jr .loop
+
+TrainerType2:
+; moves
+ ld h, d
+ ld l, e
+.loop
+ ld a, [hli]
+ cp $ff
+ ret z
+
+ ld [wCurPartyLevel], a
+ ld a, [hli]
+ ld [wCurPartySpecies], a
+ ld a, OTPARTYMON
+ ld [wMonType], a
+
+ push hl
+ predef TryAddMonToParty
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1Moves
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ pop hl
+
+ ld b, NUM_MOVES
+.copy_moves
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .copy_moves
+
+ push hl
+
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1Species
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld hl, MON_PP
+ add hl, de
+ push hl
+ ld hl, MON_MOVES
+ add hl, de
+ pop de
+
+ ld b, NUM_MOVES
+.copy_pp
+ ld a, [hli]
+ and a
+ jr z, .copied_pp
+
+ push hl
+ push bc
+ dec a
+ ld hl, Moves + MOVE_PP
+ ld bc, MOVE_LENGTH
+ call AddNTimes
+ ld a, BANK(Moves)
+ call GetFarByte
+ pop bc
+ pop hl
+
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .copy_pp
+.copied_pp
+
+ pop hl
+ jr .loop
+
+TrainerType3:
+; item
+ ld h, d
+ ld l, e
+.loop
+ ld a, [hli]
+ cp $ff
+ ret z
+
+ ld [wCurPartyLevel], a
+ ld a, [hli]
+ ld [wCurPartySpecies], a
+ ld a, OTPARTYMON
+ ld [wMonType], a
+ push hl
+ predef TryAddMonToParty
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1Item
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ pop hl
+ ld a, [hli]
+ ld [de], a
+ jr .loop
+
+TrainerType4:
+; item + moves
+ ld h, d
+ ld l, e
+.loop
+ ld a, [hli]
+ cp $ff
+ ret z
+
+ ld [wCurPartyLevel], a
+ ld a, [hli]
+ ld [wCurPartySpecies], a
+
+ ld a, OTPARTYMON
+ ld [wMonType], a
+
+ push hl
+ predef TryAddMonToParty
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1Item
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ pop hl
+
+ ld a, [hli]
+ ld [de], a
+
+ push hl
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1Moves
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ pop hl
+
+ ld b, NUM_MOVES
+.copy_moves
+ ld a, [hli]
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .copy_moves
+
+ push hl
+
+ ld a, [wOTPartyCount]
+ dec a
+ ld hl, wOTPartyMon1
+ ld bc, PARTYMON_STRUCT_LENGTH
+ call AddNTimes
+ ld d, h
+ ld e, l
+ ld hl, MON_PP
+ add hl, de
+
+ push hl
+ ld hl, MON_MOVES
+ add hl, de
+ pop de
+
+ ld b, NUM_MOVES
+.copy_pp
+ ld a, [hli]
+ and a
+ jr z, .copied_pp
+
+ push hl
+ push bc
+ dec a
+ ld hl, Moves + MOVE_PP
+ ld bc, MOVE_LENGTH
+ call AddNTimes
+ ld a, BANK(Moves)
+ call GetFarByte
+ pop bc
+ pop hl
+
+ ld [de], a
+ inc de
+ dec b
+ jr nz, .copy_pp
+.copied_pp
+
+ pop hl
+ jr .loop
+
+ComputeTrainerReward:
+ ld hl, hProduct
+ xor a
+ ld [hli], a
+ ld [hli], a ; hMultiplicand + 0
+ ld [hli], a ; hMultiplicand + 1
+ ld a, [wEnemyTrainerBaseReward]
+ ld [hli], a ; hMultiplicand + 2
+ ld a, [wCurPartyLevel]
+ ld [hl], a ; hMultiplier
+ call Multiply
+ ld hl, wBattleReward
+ xor a
+ ld [hli], a
+ ldh a, [hProduct + 2]
+ ld [hli], a
+ ldh a, [hProduct + 3]
+ ld [hl], a
+ ret
+
+Battle_GetTrainerName::
+ ld a, [wOtherTrainerID]
+ ld b, a
+ ld a, [wOtherTrainerClass]
+ ld c, a
+
+GetTrainerName::
+ ld a, c
+ cp CAL
+ jr nz, .not_cal2
+
+ ld a, BANK(sMysteryGiftTrainerHouseFlag)
+ call OpenSRAM
+ ld a, [sMysteryGiftTrainerHouseFlag]
+ and a
+ call CloseSRAM
+ jr z, .not_cal2
+
+ ld a, BANK(sMysteryGiftPartnerName)
+ call OpenSRAM
+ ld hl, sMysteryGiftPartnerName
+ call CopyTrainerName
+ jp CloseSRAM
+
+.not_cal2
+ dec c
+ push bc
+ ld b, 0
+ ld hl, TrainerGroups
+ add hl, bc
+ add hl, bc
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop bc
+
+.loop
+ dec b
+ jr z, CopyTrainerName
+
+.skip
+ ld a, [hli]
+ cp $ff
+ jr nz, .skip
+ jr .loop
+
+CopyTrainerName:
+ ld de, wStringBuffer1
+ push de
+ ld bc, NAME_LENGTH
+ call CopyBytes
+ pop de
+ ret
+
+INCLUDE "data/trainers/parties.asm"
diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm
index b9d0d316..41b93708 100644
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -324,9 +324,9 @@ Function5c41: ; 5c41 (1:5c41)
ld [wRoamMon2MapNumber], a
ld [wRoamMon3MapNumber], a
- ld a, BANK(s0_abe2)
+ ld a, BANK(sMysteryGiftItem)
call OpenSRAM
- ld hl, s0_abe2
+ ld hl, sMysteryGiftItem
xor a
ld [hli], a
dec a
diff --git a/engine/pokemon/move_mon.asm b/engine/pokemon/move_mon.asm
index f60f3a1a..26b0f0b9 100755
--- a/engine/pokemon/move_mon.asm
+++ b/engine/pokemon/move_mon.asm
@@ -375,7 +375,7 @@ AddTempmonToParty: ; da9c (3:5a9c)
call SkipNames
ld d, h
ld e, l
- ld hl, wOTPartyMon1Nickname
+ ld hl, wOTPartyMonNicknames
ld a, [wCurPartyMon]
call SkipNames
ld bc, NAME_LENGTH
diff --git a/home/time.asm b/home/time.asm
index 8e935ed2..d3c400f7 100644
--- a/home/time.asm
+++ b/home/time.asm
@@ -254,18 +254,18 @@ ClearRTCStatus::
; clear sRTCStatusFlags
xor a
push af
- ld a, BANK(s0_ac60)
+ ld a, BANK(sRTCStatusFlags)
call OpenSRAM
pop af
- ld [s0_ac60], a
+ ld [sRTCStatusFlags], a
call CloseSRAM
ret
RecordRTCStatus::
; append flags to sRTCStatusFlags
- ld hl, s0_ac60
+ ld hl, sRTCStatusFlags
push af
- ld a, BANK(s0_ac60)
+ ld a, BANK(sRTCStatusFlags)
call OpenSRAM
pop af
or [hl]
@@ -275,8 +275,8 @@ RecordRTCStatus::
CheckRTCStatus::
; check sRTCStatusFlags
- ld a, BANK(s0_ac60)
+ ld a, BANK(sRTCStatusFlags)
call OpenSRAM
- ld a, [s0_ac60]
+ ld a, [sRTCStatusFlags]
call CloseSRAM
ret
diff --git a/main.asm b/main.asm
index 68e1b80b..4f8da584 100644
--- a/main.asm
+++ b/main.asm
@@ -276,25 +276,20 @@ RandomPhoneMon:
JohtoGrassWildMons:
dr $2ab35, $2c000
-SECTION "bankb", ROMX, BANK[$b]
+SECTION "bankb", ROMX
dr $2c000, $2c225
AI_Redundant:
dr $2c225, $2c352
MoveDeletion:
dr $2c352, $2c57a
-
Pack_TMHMPocketMenu_:
dr $2c57a, $2c5ca
-
AskTeachTMHM:
dr $2c5ca, $2c606
-
ChooseMonToLearnTMHM:
dr $2c606, $2c672
-
TeachTMHM:
dr $2c672, $2c943
-
PrintMoveDesc::
dr $2c943, $30000
@@ -339,17 +334,8 @@ SECTION "banke", ROMX
INCLUDE "engine/battle/ai/items.asm"
INCLUDE "engine/battle/ai/scoring.asm"
-
-GetTrainerClassName::
- dr $394f3, $39562
-TrainerClassAttributes::
- dr $39562, $398f2
-Battle_GetTrainerName::
- dr $398f2, $398fa
-GetTrainerName::
- dr $398fa, $3993e
-
-INCLUDE "data/trainers/parties.asm"
+INCLUDE "engine/battle/read_trainer_attributes.asm"
+INCLUDE "engine/battle/read_trainer_party.asm"
SECTION "bankf", ROMX
dr $3c000, $3c551
@@ -884,7 +870,7 @@ GoldSilverIntro:
dr $e4af9, $e8000
ENDC
-SECTION "bank3e", ROMX, BANK[$3e]
+SECTION "bank3e", ROMX
Functionf8000::
dr $f8000, $f800c
Functionf800c::
@@ -906,7 +892,6 @@ PlaySlowCry:
dr $fb94b, $fb981
NewPokedexEntry:
dr $fb981, $fba12
-
ConvertMon_1to2::
dr $fba12, $fbb22
UpdateUnownDex:
diff --git a/pokegold.link b/pokegold.link
index 941e62a8..971b5a39 100644
--- a/pokegold.link
+++ b/pokegold.link
@@ -360,7 +360,6 @@ WRAMX 1
"WRAM1"
"Game Data"
"Party"
- "OT Party"
org $dfff
"Stack"
WRAMX 2
diff --git a/pokesilver.link b/pokesilver.link
index 941e62a8..971b5a39 100644
--- a/pokesilver.link
+++ b/pokesilver.link
@@ -360,7 +360,6 @@ WRAMX 1
"WRAM1"
"Game Data"
"Party"
- "OT Party"
org $dfff
"Stack"
WRAMX 2
diff --git a/sram.asm b/sram.asm
index 12829c2b..876f7e9d 100755
--- a/sram.asm
+++ b/sram.asm
@@ -412,141 +412,28 @@ sMailbox8Backup:: mailmsg sMailbox8Backup
sMailbox9Backup:: mailmsg sMailbox9Backup
sMailbox10Backup:: mailmsg sMailbox10Backup
-s0_abe2:: ds 1 ; 0:abe2
-s0_abe3:: ds 1 ; 0:abe3
-s0_abe4:: ds 1 ; 0:abe4
-s0_abe5:: ds 1 ; 0:abe5
-s0_abe6:: ds 1 ; 0:abe6
-s0_abe7:: ds 1 ; 0:abe7
-s0_abe8:: ds 1 ; 0:abe8
-s0_abe9:: ds 1 ; 0:abe9
-s0_abea:: ds 1 ; 0:abea
-s0_abeb:: ds 1 ; 0:abeb
-s0_abec:: ds 1 ; 0:abec
-s0_abed:: ds 1 ; 0:abed
-s0_abee:: ds 1 ; 0:abee
-s0_abef:: ds 1 ; 0:abef
-s0_abf0:: ds 1 ; 0:abf0
-s0_abf1:: ds 1 ; 0:abf1
-s0_abf2:: ds 1 ; 0:abf2
-s0_abf3:: ds 1 ; 0:abf3
-s0_abf4:: ds 1 ; 0:abf4
-s0_abf5:: ds 1 ; 0:abf5
-s0_abf6:: ds 1 ; 0:abf6
-s0_abf7:: ds 1 ; 0:abf7
-s0_abf8:: ds 1 ; 0:abf8
-s0_abf9:: ds 1 ; 0:abf9
-sMysteryGiftTimer:: ds 2 ; 0:abfa
-s0_abfc:: ds 1 ; 0:abfc
-s0_abfd:: ds 1 ; 0:abfd
-s0_abfe:: ds 1 ; 0:abfe
-s0_abff:: ds 1 ; 0:abff
-s0_ac00:: ds 1 ; 0:ac00
-s0_ac01:: ds 1 ; 0:ac01
-s0_ac02:: ds 1 ; 0:ac02
-s0_ac03:: ds 1 ; 0:ac03
-s0_ac04:: ds 1 ; 0:ac04
-s0_ac05:: ds 1 ; 0:ac05
-s0_ac06:: ds 1 ; 0:ac06
-s0_ac07:: ds 1 ; 0:ac07
-s0_ac08:: ds 1 ; 0:ac08
-s0_ac09:: ds 1 ; 0:ac09
-s0_ac0a:: ds 1 ; 0:ac0a
-s0_ac0b:: ds 1 ; 0:ac0b
-s0_ac0c:: ds 1 ; 0:ac0c
-s0_ac0d:: ds 1 ; 0:ac0d
-s0_ac0e:: ds 1 ; 0:ac0e
-s0_ac0f:: ds 1 ; 0:ac0f
-s0_ac10:: ds 1 ; 0:ac10
-s0_ac11:: ds 1 ; 0:ac11
-s0_ac12:: ds 1 ; 0:ac12
-s0_ac13:: ds 1 ; 0:ac13
-s0_ac14:: ds 1 ; 0:ac14
-s0_ac15:: ds 1 ; 0:ac15
-s0_ac16:: ds 1 ; 0:ac16
-s0_ac17:: ds 1 ; 0:ac17
-s0_ac18:: ds 1 ; 0:ac18
-s0_ac19:: ds 1 ; 0:ac19
-s0_ac1a:: ds 1 ; 0:ac1a
-s0_ac1b:: ds 1 ; 0:ac1b
-s0_ac1c:: ds 1 ; 0:ac1c
-s0_ac1d:: ds 1 ; 0:ac1d
-s0_ac1e:: ds 1 ; 0:ac1e
-s0_ac1f:: ds 1 ; 0:ac1f
-s0_ac20:: ds 1 ; 0:ac20
-s0_ac21:: ds 1 ; 0:ac21
-s0_ac22:: ds 1 ; 0:ac22
-s0_ac23:: ds 1 ; 0:ac23
-s0_ac24:: ds 1 ; 0:ac24
-s0_ac25:: ds 1 ; 0:ac25
-s0_ac26:: ds 1 ; 0:ac26
-s0_ac27:: ds 1 ; 0:ac27
-s0_ac28:: ds 1 ; 0:ac28
-s0_ac29:: ds 1 ; 0:ac29
-s0_ac2a:: ds 1 ; 0:ac2a
-s0_ac2b:: ds 1 ; 0:ac2b
-s0_ac2c:: ds 1 ; 0:ac2c
-s0_ac2d:: ds 1 ; 0:ac2d
-s0_ac2e:: ds 1 ; 0:ac2e
-s0_ac2f:: ds 1 ; 0:ac2f
-s0_ac30:: ds 1 ; 0:ac30
-s0_ac31:: ds 1 ; 0:ac31
-s0_ac32:: ds 1 ; 0:ac32
-s0_ac33:: ds 1 ; 0:ac33
-s0_ac34:: ds 1 ; 0:ac34
-s0_ac35:: ds 1 ; 0:ac35
-s0_ac36:: ds 1 ; 0:ac36
-s0_ac37:: ds 1 ; 0:ac37
-s0_ac38:: ds 1 ; 0:ac38
-s0_ac39:: ds 1 ; 0:ac39
-s0_ac3a:: ds 1 ; 0:ac3a
-s0_ac3b:: ds 1 ; 0:ac3b
-s0_ac3c:: ds 1 ; 0:ac3c
-s0_ac3d:: ds 1 ; 0:ac3d
-s0_ac3e:: ds 1 ; 0:ac3e
-s0_ac3f:: ds 1 ; 0:ac3f
-s0_ac40:: ds 1 ; 0:ac40
-s0_ac41:: ds 1 ; 0:ac41
-s0_ac42:: ds 1 ; 0:ac42
-s0_ac43:: ds 1 ; 0:ac43
-s0_ac44:: ds 1 ; 0:ac44
-s0_ac45:: ds 1 ; 0:ac45
-s0_ac46:: ds 1 ; 0:ac46
-s0_ac47:: ds 1 ; 0:ac47
-s0_ac48:: ds 1 ; 0:ac48
-s0_ac49:: ds 1 ; 0:ac49
-s0_ac4a:: ds 1 ; 0:ac4a
-s0_ac4b:: ds 1 ; 0:ac4b
-s0_ac4c:: ds 1 ; 0:ac4c
-s0_ac4d:: ds 1 ; 0:ac4d
-s0_ac4e:: ds 1 ; 0:ac4e
-s0_ac4f:: ds 1 ; 0:ac4f
-s0_ac50:: ds 1 ; 0:ac50
-s0_ac51:: ds 1 ; 0:ac51
-s0_ac52:: ds 1 ; 0:ac52
-s0_ac53:: ds 1 ; 0:ac53
-s0_ac54:: ds 1 ; 0:ac54
-s0_ac55:: ds 1 ; 0:ac55
-s0_ac56:: ds 1 ; 0:ac56
-s0_ac57:: ds 1 ; 0:ac57
-s0_ac58:: ds 1 ; 0:ac58
-s0_ac59:: ds 1 ; 0:ac59
-s0_ac5a:: ds 1 ; 0:ac5a
-s0_ac5b:: ds 1 ; 0:ac5b
-s0_ac5c:: ds 1 ; 0:ac5c
-s0_ac5d:: ds 1 ; 0:ac5d
-s0_ac5e:: ds 1 ; 0:ac5e
-s0_ac5f:: ds 1 ; 0:ac5f
-s0_ac60:: ds 1 ; 0:ac60
-s0_ac61:: ds 1 ; 0:ac61
-s0_ac62:: ds 1 ; 0:ac62
-s0_ac63:: ds 1 ; 0:ac63
-s0_ac64:: ds 1 ; 0:ac64
-s0_ac65:: ds 1 ; 0:ac65
-s0_ac66:: ds 1 ; 0:ac66
-s0_ac67:: ds 1 ; 0:ac67
-sLuckyNumberDay:: db ; 0:ac68
-sLuckyIDNumber:: dw ; 0:ac69
+; abe2
+sMysteryGiftItem:: db
+sMysteryGiftUnlocked:: db
+sBackupMysteryGiftItem:: db
+sNumDailyMysteryGiftPartnerIDs:: db
+sDailyMysteryGiftPartnerIDs:: ds 5 * 2 ; maximum 5 per day, 2 bytes per ID
+sMysteryGiftDecorationsReceived:: flag_array NUM_NON_TROPHY_DECOS
+ ds 4
+sMysteryGiftTimer:: db
+sMysteryGiftTimerStartDay:: db
+ ds 1
+sMysteryGiftTrainerHouseFlag:: db
+sMysteryGiftPartnerName:: ds NAME_LENGTH
+s0_ac09:: ds 1
+sMysteryGiftTrainer:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 2 ; ac0a
+sBackupMysteryGiftItemEnd::
+
+ ds $30
+
+sRTCStatusFlags:: ds 8
+sLuckyNumberDay:: db
+sLuckyIDNumber:: dw
s0_ac6b:: ds 1 ; 0:ac6b
s0_ac6c:: ds 1 ; 0:ac6c
s0_ac6d:: ds 1 ; 0:ac6d
diff --git a/wram.asm b/wram.asm
index 1b0ee4a7..43c20790 100644
--- a/wram.asm
+++ b/wram.asm
@@ -1643,7 +1643,7 @@ wcb2c:: ds 1 ; cb2c
wcb2d:: ds 1 ; cb2d
wEnemyTrainerItem1:: db ; cb2e
wEnemyTrainerItem2:: db ; cb2f
-wcb30:: ds 1 ; cb30
+wEnemyTrainerBaseReward:: db ; cb30
wcb31:: ds 1 ; cb31
wcb32:: ds 1 ; cb32
wcb33:: ds 1 ; cb33
@@ -2791,7 +2791,7 @@ wOtherTrainerClass:: ; d118
wBattleType:: ds 1 ; d119
wd11a:: ds 1 ; d11a
-wd11b:: ds 1 ; d11b
+wOtherTrainerID:: db ; d11b
wd11c:: ds 1 ; d11c
wTrainerClass:: ds 1 ; d11d
wUnownLetter:: ds 1 ; d11e
@@ -3811,53 +3811,39 @@ wBestMagikarpLengthFeet:: ds 1 ; dd33
wBestMagikarpLengthInches:: ds 1 ; dd34
wMagikarpRecordHoldersName:: ds NAME_LENGTH ; dd35
-wPokedexShowPointerAddr:: dw ; dd40
-wPokedexShowPointerBank:: db ; dd42
-wdd43:: ds 1 ; dd43
-wdd44:: ds 1 ; dd44
-wdd45:: ds 1 ; dd45
-wdd46:: ds 1 ; dd46
-wdd47:: ds 1 ; dd47
-wdd48:: ds 1 ; dd48
-wdd49:: ds 1 ; dd49
-wdd4a:: ds 1 ; dd4a
-wdd4b:: ds 1 ; dd4b
-wdd4c:: ds 1 ; dd4c
-wdd4d:: ds 1 ; dd4d
-wdd4e:: ds 1 ; dd4e
-wdd4f:: ds 1 ; dd4f
-wdd50:: ds 1 ; dd50
-wdd51:: ds 1 ; dd51
-wdd52:: ds 1 ; dd52
-wdd53:: ds 1 ; dd53
-wdd54:: ds 1 ; dd54
-
-SECTION "OT Party", WRAMX, BANK[1]
-
-wOTPartyCount:: ds 1 ; dd55
+UNION ; dd40
+wPokedexShowPointerAddr:: dw
+wPokedexShowPointerBank:: db
+ ds 3
+
+NEXTU ; dd40
+; enemy party
+wOTPlayerName:: ds NAME_LENGTH ; dd40
+wOTPlayerID:: dw ; dd4b
+ ds 8
+wOTPartyCount:: db ; dd55
wOTPartySpecies:: ds PARTY_LENGTH ; dd56
-wOTPartySpeciesEnd:: ds 1 ; dd5c
+wOTPartyEnd:: db ; older code doesn't check PartyCount
+ENDU ; dd5d
-; The tutorial pack uses the OT party space.
-; It's placed here rather than at wOTPartyCount
-; to avoid confusing the game.
+UNION ; dd5d
+; catch tutorial dude pack
+wDudeBag::
+wDudeNumItems:: db
+wDudeItems:: ds 2 * 4
+wDudeItemsEnd:: db
-UNION
-wDudePack::
-wDudeNumItems:: ds 1 ; dd5d
-wDudeItems:: ds 2 * 4 ; dd5e
-wDudeItemsEnd:: ds 1 ; dd66
+wDudeNumKeyItems:: db ; dd67
+wDudeKeyItems:: ds 18
+wDudeKeyItemsEnd:: db
-wDudeNumKeyItems:: ds 1 ; dd67
-wDudeKeyItems:: ds 18 ; dd68
-wDudeKeyItemsEnd:: ds 1 ; dd7a
-
-wDudeNumBalls:: ds 1 ; dd7b
+wDudeNumBalls:: db ; dd7b
wDudeBalls:: ds 2 * 4 ; dd7c
-wDudeBallsEnd:: ds 1 ; dd84
-wDudePackEnd::
-NEXTU
+wDudeBallsEnd:: db ; dd84
+wDudeBagEnd::
+NEXTU ; dd5d
+; ot party mons
wOTPartyMons::
wOTPartyMon1:: party_struct wOTPartyMon1 ; dd5d
wOTPartyMon2:: party_struct wOTPartyMon2 ; dd8d
@@ -3865,23 +3851,12 @@ wOTPartyMon3:: party_struct wOTPartyMon3 ; ddbd
wOTPartyMon4:: party_struct wOTPartyMon4 ; dded
wOTPartyMon5:: party_struct wOTPartyMon5 ; de1d
wOTPartyMon6:: party_struct wOTPartyMon6 ; de4d
+wOTPartyMonsEnd::
-wOTPartyMonOT::
-wOTPartyMon1OT:: ds NAME_LENGTH ; de7d
-wOTPartyMon2OT:: ds NAME_LENGTH ; de88
-wOTPartyMon3OT:: ds NAME_LENGTH ; de93
-wOTPartyMon4OT:: ds NAME_LENGTH ; de9e
-wOTPartyMon5OT:: ds NAME_LENGTH ; dea9
-wOTPartyMon6OT:: ds NAME_LENGTH ; deb4
-
-wOTPartyMonNicknames::
-wOTPartyMon1Nickname:: ds MON_NAME_LENGTH ; debf
-wOTPartyMon2Nickname:: ds MON_NAME_LENGTH ; deca
-wOTPartyMon3Nickname:: ds MON_NAME_LENGTH ; ded5
-wOTPartyMon4Nickname:: ds MON_NAME_LENGTH ; dee0
-wOTPartyMon5Nickname:: ds MON_NAME_LENGTH ; deeb
-wOTPartyMon6Nickname:: ds MON_NAME_LENGTH ; def6
-ENDU
+wOTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; de7d
+wOTPartyMonNicknames:: ds MON_NAME_LENGTH * PARTY_LENGTH ; debf
+wOTPartyDataEnd::
+ENDU ; df01
wGameDataEnd::