opentext and breeding

This commit is contained in:
PikalaxALT 2015-12-09 18:25:44 -05:00
parent 0c4bf512d0
commit a5a8364c35
291 changed files with 1938 additions and 1894 deletions

View File

@ -9,21 +9,21 @@
; egg group constants ; egg group constants
const_value SET 1 const_value SET 1
const MONSTER const MONSTER ; 1
const AMPHIBIAN const AMPHIBIAN ; 2
const INSECT const INSECT ; 3
const AVIAN const AVIAN ; 4
const FIELD const FIELD ; 5
const FAIRY const FAIRY ; 6
const PLANT const PLANT ; 7
const HUMANSHAPE const HUMANSHAPE ; 8
const INVERTEBRATE const INVERTEBRATE ; 9
const INANIMATE const INANIMATE ; a
const AMORPHOUS const AMORPHOUS ; b
const FISH const FISH ; c
const LADIES_MAN const LADIES_MAN ; d
const REPTILE const REPTILE ; e
const NO_EGGS const NO_EGGS ; f
; menu sprites ; menu sprites

View File

@ -1,7 +1,7 @@
Function16e1d: ; 16e1d CheckBreedmonCompatibility: ; 16e1d
call Function16ed6 call .CheckBreedingGroupCompatibility
ld c, $0 ld c, $0
jp nc, .asm_16eb7 jp nc, .done
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
ld [CurPartySpecies], a ld [CurPartySpecies], a
ld a, [wBreedMon1DVs] ld a, [wBreedMon1DVs]
@ -11,12 +11,12 @@ Function16e1d: ; 16e1d
ld a, $3 ld a, $3
ld [MonType], a ld [MonType], a
predef GetGender predef GetGender
jr c, .asm_16e70 jr c, .genderless
ld b, $1 ld b, $1
jr nz, .asm_16e48 jr nz, .breedmon2
inc b inc b
.asm_16e48 .breedmon2
push bc push bc
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
ld [CurPartySpecies], a ld [CurPartySpecies], a
@ -28,96 +28,105 @@ Function16e1d: ; 16e1d
ld [MonType], a ld [MonType], a
predef GetGender predef GetGender
pop bc pop bc
jr c, .asm_16e70 jr c, .genderless
ld a, $1 ld a, $1
jr nz, .asm_16e6d jr nz, .compare_gender
inc a inc a
.asm_16e6d .compare_gender
cp b cp b
jr nz, .asm_16e89 jr nz, .compute
.asm_16e70 .genderless
ld c, $0 ld c, $0
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
cp DITTO cp DITTO
jr z, .asm_16e82 jr z, .ditto1
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
cp DITTO cp DITTO
jr nz, .asm_16eb7 jr nz, .done
jr .asm_16e89 jr .compute
.asm_16e82 .ditto1
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
cp DITTO cp DITTO
jr z, .asm_16eb7 jr z, .done
.asm_16e89 .compute
call Function16ebc call .CheckDVs
ld c, $ff ld c, 255
jp z, .asm_16eb7 jp z, .done
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
ld b, a ld b, a
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
cp b cp b
ld c, $fe ld c, 254
jr z, .asm_16e9f jr z, .compare_ids
ld c, $80 ld c, 128
.asm_16e9f .compare_ids
; Speed up
ld a, [wBreedMon1ID] ld a, [wBreedMon1ID]
ld b, a ld b, a
ld a, [wBreedMon2ID] ld a, [wBreedMon2ID]
cp b cp b
jr nz, .asm_16eb7 jr nz, .done
ld a, [wBreedMon1ID + 1] ld a, [wBreedMon1ID + 1]
ld b, a ld b, a
ld a, [wBreedMon2ID + 1] ld a, [wBreedMon2ID + 1]
cp b cp b
jr nz, .asm_16eb7 jr nz, .done
ld a, c ld a, c
sub $4d sub 77
ld c, a ld c, a
.asm_16eb7 .done
ld a, c ld a, c
ld [wd265], a ld [wd265], a
ret ret
; 16ebc ; 16ebc
Function16ebc: ; 16ebc (5:6ebc) .CheckDVs: ; 16ebc (5:6ebc)
; If Defense DVs match and the lower 3 bits of the Special DVs match,
; maximize the chances of spawning an egg regardless of species.
ld a, [wBreedMon1DVs] ld a, [wBreedMon1DVs]
and $f and %1111
ld b, a ld b, a
ld a, [wBreedMon2DVs] ld a, [wBreedMon2DVs]
and $f and %1111
cp b cp b
ret nz ret nz
ld a, [wBreedMon1DVs + 1] ld a, [wBreedMon1DVs + 1]
and $7 and %111
ld b, a ld b, a
ld a, [wBreedMon2DVs + 1] ld a, [wBreedMon2DVs + 1]
and $7 and %111
cp b cp b
ret ret
; 16ed6 ; 16ed6
Function16ed6: ; 16ed6 .CheckBreedingGroupCompatibility: ; 16ed6
; If either mon is in the No Eggs group,
; they are not compatible.
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
ld [CurSpecies], a ld [CurSpecies], a
call GetBaseData call GetBaseData
ld a, [BaseEggGroups] ld a, [BaseEggGroups]
cp $ff cp NO_EGGS * $11
jr z, .asm_16f3a jr z, .Incompatible
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
ld [CurSpecies], a ld [CurSpecies], a
call GetBaseData call GetBaseData
ld a, [BaseEggGroups] ld a, [BaseEggGroups]
cp $ff cp NO_EGGS * $11
jr z, .asm_16f3a jr z, .Incompatible
; Ditto is automatically compatible with everything.
; If not Ditto, load the breeding groups into b/c and d/e.
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
cp DITTO cp DITTO
jr z, .asm_16f3c jr z, .Compatible
ld [CurSpecies], a ld [CurSpecies], a
call GetBaseData call GetBaseData
ld a, [BaseEggGroups] ld a, [BaseEggGroups]
@ -128,9 +137,10 @@ Function16ed6: ; 16ed6
and $f0 and $f0
swap a swap a
ld c, a ld c, a
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
cp DITTO cp DITTO
jr z, .asm_16f3c jr z, .Compatible
ld [CurSpecies], a ld [CurSpecies], a
push bc push bc
call GetBaseData call GetBaseData
@ -143,22 +153,24 @@ Function16ed6: ; 16ed6
and $f0 and $f0
swap a swap a
ld e, a ld e, a
ld a, d ld a, d
cp b cp b
jr z, .asm_16f3c jr z, .Compatible
cp c cp c
jr z, .asm_16f3c jr z, .Compatible
ld a, e ld a, e
cp b cp b
jr z, .asm_16f3c jr z, .Compatible
cp c cp c
jr z, .asm_16f3c jr z, .Compatible
.asm_16f3a .Incompatible
and a and a
ret ret
.asm_16f3c .Compatible
scf scf
ret ret
; 16f3e ; 16f3e
@ -448,7 +460,7 @@ endr
jr .loop jr .loop
.reached_end .reached_end
call Function1720b call GetBreedmonMovePointer
ld b, NUM_MOVES ld b, NUM_MOVES
.loop2 .loop2
ld a, [de] ld a, [de]
@ -613,7 +625,7 @@ GetHeritableMoves: ; 17197
ret ret
; 1720b ; 1720b
Function1720b: ; 1720b GetBreedmonMovePointer: ; 1720b
ld hl, wBreedMon1Moves ld hl, wBreedMon1Moves
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
cp DITTO cp DITTO
@ -631,7 +643,7 @@ Function1720b: ; 1720b
; 17224 ; 17224
Function17224: ; 17224 (5:7224) GetEggFrontpic: ; 17224 (5:7224)
push de push de
ld [CurPartySpecies], a ld [CurPartySpecies], a
ld [CurSpecies], a ld [CurSpecies], a
@ -641,7 +653,7 @@ Function17224: ; 17224 (5:7224)
pop de pop de
predef_jump GetFrontpic predef_jump GetFrontpic
Function1723c: ; 1723c (5:723c) GetHatchlingFrontpic: ; 1723c (5:723c)
push de push de
ld [CurPartySpecies], a ld [CurPartySpecies], a
ld [CurSpecies], a ld [CurSpecies], a
@ -701,10 +713,10 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
callba ClearSpriteAnims callba ClearSpriteAnims
ld de, VTiles2 tile $00 ld de, VTiles2 tile $00
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
call Function1723c call GetHatchlingFrontpic
ld de, VTiles2 tile $31 ld de, VTiles2 tile $31
ld a, EGG ld a, EGG
call Function17224 call GetEggFrontpic
ld de, MUSIC_EVOLUTION ld de, MUSIC_EVOLUTION
call PlayMusic call PlayMusic
call EnableLCD call EnableLCD
@ -915,7 +927,7 @@ Function1746c: ; 1746c
ld de, StringBuffer1 ld de, StringBuffer1
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
call Function16e1d call CheckBreedmonCompatibility
pop bc pop bc
ld a, [wd265] ld a, [wd265]
ld hl, UnknownText_0x1749c ld hl, UnknownText_0x1749c

View File

@ -137,7 +137,7 @@ Function8ade: ; 8ade SGB layout $fc
.asm_8af7 .asm_8af7
push de push de
ld hl, wcda9 + 10 ld hl, wcda9 + 10
ld bc, $0006 ld bc, $6
ld a, [wcda9] ld a, [wcda9]
call AddNTimes call AddNTimes
pop de pop de
@ -150,13 +150,13 @@ Function8b07: ; 8b07
ret z ret z
ld hl, Palette8b2f ld hl, Palette8b2f
ld de, UnknBGPals ld de, UnknBGPals
ld bc, $0008 ld bc, 1 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ld hl, Palette8b37 ld hl, Palette8b37
ld de, MartPointer ld de, MartPointer
ld bc, $0008 ld bc, 1 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
@ -171,6 +171,7 @@ Palette8b2f: ; 8b2f
RGB 18, 23, 31 RGB 18, 23, 31
RGB 15, 20, 31 RGB 15, 20, 31
RGB 00, 00, 00 RGB 00, 00, 00
; 8b37 ; 8b37
Palette8b37: ; 8b37 Palette8b37: ; 8b37
@ -178,6 +179,7 @@ Palette8b37: ; 8b37
RGB 31, 31, 12 RGB 31, 31, 12
RGB 08, 16, 28 RGB 08, 16, 28
RGB 00, 00, 00 RGB 00, 00, 00
; 8b3f ; 8b3f
Function8b3f: ; 8b3f Function8b3f: ; 8b3f
@ -276,7 +278,7 @@ endr
asm_8bd7 asm_8bd7
push hl push hl
ld hl, UnknBGPals ld hl, UnknBGPals
ld de, $0008 ld de, $8
.asm_8bde .asm_8bde
and a and a
jr z, .asm_8be5 jr z, .asm_8be5
@ -304,7 +306,7 @@ Function8bec: ; 8bec
ld c, a ld c, a
ld a, [EnemyReflectCount] ld a, [EnemyReflectCount]
hlcoord 0, 0, AttrMap hlcoord 0, 0, AttrMap
ld de, $0014 ld de, $14
.asm_8c04 .asm_8c04
and a and a
jr z, .asm_8c0b jr z, .asm_8c0b
@ -357,11 +359,11 @@ Function8c43: ; 8c43
ret ret
.asm_8c52 .asm_8c52
ld de, BGPals + $10 + 2 ld de, BGPals + 2 palettes + 2
jr .asm_8c5a jr .asm_8c5a
.asm_8c57 .asm_8c57
ld de, BGPals + $18 + 2 ld de, BGPals + 3 palettes + 2
.asm_8c5a .asm_8c5a
ld l, c ld l, c
@ -371,7 +373,7 @@ rept 2
endr endr
ld bc, Palettes_a8be ld bc, Palettes_a8be
add hl, bc add hl, bc
ld bc, $0004 ld bc, $4
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ld a, $1 ld a, $1
@ -382,7 +384,7 @@ endr
ld e, c ld e, c
inc e inc e
hlcoord 11, 1, AttrMap hlcoord 11, 1, AttrMap
ld bc, $0028 ld bc, $28
ld a, [CurPartyMon] ld a, [CurPartyMon]
.asm_8c7b .asm_8c7b
and a and a
@ -459,7 +461,7 @@ endr
.asm_8cf0 .asm_8cf0
ld de, UnknBGPals ld de, UnknBGPals
ld bc, $0008 ld bc, 1 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
call Function96a4 call Function96a4
@ -518,6 +520,7 @@ Palettes_8d05: ; 8d05
RGB 31, 31, 00 RGB 31, 31, 00
RGB 00, 21, 00 RGB 00, 21, 00
RGB 00, 00, 00 RGB 00, 00, 00
; 8d55 ; 8d55
INCLUDE "predef/cgb.asm" INCLUDE "predef/cgb.asm"
@ -540,6 +543,7 @@ Palette_9608: ; 9608
RGB 09, 31, 31 RGB 09, 31, 31
RGB 10, 12, 31 RGB 10, 12, 31
RGB 00, 03, 19 RGB 00, 03, 19
; 9610 ; 9610
@ -678,7 +682,7 @@ Function9699: ; 9699
Function96a4: ; 96a4 Function96a4: ; 96a4
ld hl, UnknBGPals ld hl, UnknBGPals
ld de, BGPals ld de, BGPals
ld bc, $0080 ld bc, 16 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ret ret
@ -740,7 +744,7 @@ Function96f3: ; 96f3 CGB layout $fc
inc a inc a
ld e, a ld e, a
hlcoord 11, 2, AttrMap hlcoord 11, 2, AttrMap
ld bc, $0028 ld bc, $28
ld a, [wcda9] ld a, [wcda9]
.asm_970b .asm_970b
and a and a
@ -760,7 +764,7 @@ Function96f3: ; 96f3 CGB layout $fc
Function971a: ; 971a Function971a: ; 971a
ld hl, Palettes_b681 ld hl, Palettes_b681
ld de, UnknOBPals ld de, UnknOBPals
ld bc, $0010 ld bc, 2 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ret ret
@ -844,7 +848,7 @@ Function977a: ; 977a
jr nz, .asm_9787 jr nz, .asm_9787
ld hl, Palettes_979c ld hl, Palettes_979c
ld de, UnknOBPals + 8 * 2 ld de, UnknOBPals + 8 * 2
ld bc, $0010 ld bc, 2 palettes
ld a, $5 ld a, $5
call FarCopyWRAM call FarCopyWRAM
ret ret
@ -855,26 +859,32 @@ Palettes_979c: ; 979c
RGB 25, 25, 25 RGB 25, 25, 25
RGB 13, 13, 13 RGB 13, 13, 13
RGB 00, 00, 00 RGB 00, 00, 00
RGB 31, 31, 31 RGB 31, 31, 31
RGB 31, 31, 07 RGB 31, 31, 07
RGB 31, 16, 01 RGB 31, 16, 01
RGB 00, 00, 00 RGB 00, 00, 00
RGB 31, 31, 31 RGB 31, 31, 31
RGB 31, 19, 24 RGB 31, 19, 24
RGB 30, 10, 06 RGB 30, 10, 06
RGB 00, 00, 00 RGB 00, 00, 00
RGB 31, 31, 31 RGB 31, 31, 31
RGB 12, 25, 01 RGB 12, 25, 01
RGB 05, 14, 00 RGB 05, 14, 00
RGB 00, 00, 00 RGB 00, 00, 00
RGB 31, 31, 31 RGB 31, 31, 31
RGB 08, 12, 31 RGB 08, 12, 31
RGB 01, 04, 31 RGB 01, 04, 31
RGB 00, 00, 00 RGB 00, 00, 00
RGB 31, 31, 31 RGB 31, 31, 31
RGB 24, 18, 07 RGB 24, 18, 07
RGB 20, 15, 03 RGB 20, 15, 03
RGB 00, 00, 00 RGB 00, 00, 00
; 97cc ; 97cc
Function97cc: ; 97cc Function97cc: ; 97cc
@ -1217,20 +1227,20 @@ Function99d8: ; 99d8
ld b, $12 ld b, $12
.asm_99ea .asm_99ea
push bc push bc
ld bc, $000c ld bc, $c
call CopyData call CopyData
ld bc, $0028 ld bc, $28
call ClearBytes call ClearBytes
ld bc, $000c ld bc, $c
call CopyData call CopyData
pop bc pop bc
dec b dec b
jr nz, .asm_99ea jr nz, .asm_99ea
ld bc, $0140 ld bc, $140
call CopyData call CopyData
ld bc, Start ld bc, Start
call ClearBytes call ClearBytes
ld bc, $0080 ld bc, 16 palettes
call CopyData call CopyData
call DrawDefaultTiles call DrawDefaultTiles
ld a, $e3 ld a, $e3
@ -1250,9 +1260,9 @@ Function9a24: ; 9a24
ld b, $80 ld b, $80
.asm_9a30 .asm_9a30
push bc push bc
ld bc, $0010 ld bc, 2 palettes
call CopyData call CopyData
ld bc, $0010 ld bc, 2 palettes
call ClearBytes call ClearBytes
pop bc pop bc
dec b dec b
@ -1803,6 +1813,7 @@ Palettes_9df6: ; 9df6
RGB 08, 11, 11 RGB 08, 11, 11
RGB 21, 21, 21 RGB 21, 21, 21
RGB 31, 31, 31 RGB 31, 31, 31
; a06e ; a06e
SGBBorderMap: ; a06e SGBBorderMap: ; a06e
@ -1916,6 +1927,7 @@ SGBBorderPalettes: ; a49e
RGB 31, 31, 25 RGB 31, 31, 25
RGB 31, 31, 25 RGB 31, 31, 25
RGB 31, 31, 25 RGB 31, 31, 25
; a51e ; a51e
SGBBorder: ; a51e SGBBorder: ; a51e
@ -2085,6 +2097,7 @@ Palette_b309: ; b309
RGB 31, 19, 24 RGB 31, 19, 24
RGB 30, 10, 06 RGB 30, 10, 06
RGB 00, 00, 00 RGB 00, 00, 00
; b311 ; b311
Palette_b311: ; b311 Palette_b311: ; b311
@ -2092,6 +2105,7 @@ Palette_b311: ; b311
RGB 17, 19, 31 RGB 17, 19, 31
RGB 14, 16, 31 RGB 14, 16, 31
RGB 00, 00, 00 RGB 00, 00, 00
; b319 ; b319
TilesetBGPalette: ; b319 TilesetBGPalette: ; b319
@ -2143,6 +2157,7 @@ Palettes_b641: ; b641
RGB 11, 11, 19 RGB 11, 11, 19
RGB 07, 07, 12 RGB 07, 07, 12
RGB 00, 00, 00 RGB 00, 00, 00
; b681 ; b681
Palettes_b681: ; b681 Palettes_b681: ; b681
@ -2216,6 +2231,7 @@ Palettes_b681: ; b681
RGB 20, 15, 03 RGB 20, 15, 03
RGB 07, 07, 07 RGB 07, 07, 07
Palettes_b6f1: ; b6f1 Palettes_b6f1: ; b6f1
RGB 31, 31, 31 RGB 31, 31, 31
RGB 18, 23, 31 RGB 18, 23, 31
@ -2242,6 +2258,7 @@ Palettes_b6f1: ; b6f1
RGB 18, 23, 31 RGB 18, 23, 31
RGB 00, 00, 00 RGB 00, 00, 00
Palettes_b719: ; b719 Palettes_b719: ; b719
RGB 31, 31, 31 RGB 31, 31, 31
RGB 07, 06, 03 RGB 07, 06, 03
@ -2252,6 +2269,7 @@ Palettes_b719: ; b719
RGB 31, 31, 00 RGB 31, 31, 00
RGB 26, 22, 00 RGB 26, 22, 00
RGB 00, 00, 00 RGB 00, 00, 00
; b729 ; b729
Palettes_b729: ; b729 Palettes_b729: ; b729
@ -2284,6 +2302,7 @@ Palettes_b729: ; b729
RGB 00, 31, 00 RGB 00, 31, 00
RGB 15, 07, 00 RGB 15, 07, 00
RGB 31, 00, 00 RGB 31, 00, 00
; b759 ; b759
Palettes_b759: ; b759 Palettes_b759: ; b759
@ -2316,6 +2335,7 @@ Palettes_b759: ; b759
RGB 00, 31, 00 RGB 00, 31, 00
RGB 15, 07, 00 RGB 15, 07, 00
RGB 31, 00, 00 RGB 31, 00, 00
; b789 ; b789
Palettes_b789: ; b789 Palettes_b789: ; b789
@ -2338,6 +2358,7 @@ Palettes_b789: ; b789
RGB 29, 26, 05 RGB 29, 26, 05
RGB 18, 18, 18 RGB 18, 18, 18
RGB 00, 00, 00 RGB 00, 00, 00
; b7a9 ; b7a9
Palettes_b7a9: ; b7a9 Palettes_b7a9: ; b7a9
@ -2420,4 +2441,5 @@ Palettes_b7a9: ; b7a9
RGB 31, 31, 31 RGB 31, 31, 31
RGB 00, 00, 00 RGB 00, 00, 00
RGB 00, 00, 00 RGB 00, 00, 00
; b829 ; b829

View File

@ -1244,7 +1244,7 @@ DecorationDesc_PosterPointers: ; 26f84
; 26f91 ; 26f91
DecorationDesc_TownMapPoster: ; 0x26f91 DecorationDesc_TownMapPoster: ; 0x26f91
loadfont opentext
writetext .TownMapText writetext .TownMapText
waitbutton waitbutton
special Special_TownMap special Special_TownMap

View File

@ -1,6 +1,6 @@
FruitTreeScript:: ; 44000 FruitTreeScript:: ; 44000
callasm GetCurTreeFruit callasm GetCurTreeFruit
loadfont opentext
copybytetovar CurFruit copybytetovar CurFruit
itemtotext $0, $0 itemtotext $0, $0
writetext FruitBearingTreeText writetext FruitBearingTreeText

572
engine/npc_movement.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -141,7 +141,7 @@ ScriptCommandTable: ; 96cb1
dw Script_stringtotext ; 44 dw Script_stringtotext ; 44
dw Script_itemnotify ; 45 dw Script_itemnotify ; 45
dw Script_pocketisfull ; 46 dw Script_pocketisfull ; 46
dw Script_loadfont ; 47 dw Script_textbox ; 47
dw Script_refreshscreen ; 48 dw Script_refreshscreen ; 48
dw Script_closetext ; 49 dw Script_closetext ; 49
dw Script_loadbytec2cf ; 4a dw Script_loadbytec2cf ; 4a
@ -345,7 +345,7 @@ Script_jumptext: ; 96e5f
JumpTextFacePlayerScript: ; 96e79 JumpTextFacePlayerScript: ; 96e79
faceplayer faceplayer
JumpTextScript: ; 96e7a JumpTextScript: ; 96e7a
loadfont opentext
repeattext -1, -1 repeattext -1, -1
waitbutton waitbutton
closetext closetext
@ -3026,10 +3026,10 @@ Script_reloadandreturn: ; 97b16
jp Script_end jp Script_end
; 97b1c ; 97b1c
Script_loadfont: ; 97b1c Script_textbox: ; 97b1c
; script command 0x47 ; script command 0x47
call LoadFont call OpenText
ret ret
; 97b20 ; 97b20

View File

@ -5,7 +5,7 @@ SelectMenu:: ; 13327
jp UseRegisteredItem jp UseRegisteredItem
.NotRegistered .NotRegistered
call LoadFont call OpenText
ld b, BANK(ItemMayBeRegisteredText) ld b, BANK(ItemMayBeRegisteredText)
ld hl, ItemMayBeRegisteredText ld hl, ItemMayBeRegisteredText
call MapTextbox call MapTextbox
@ -139,7 +139,7 @@ UseRegisteredItem: ; 133c3
; 133df ; 133df
.NoFunction ; 133df .NoFunction ; 133df
call LoadFont call OpenText
call CantUseItem call CantUseItem
call CloseText call CloseText
and a and a
@ -147,7 +147,7 @@ UseRegisteredItem: ; 133c3
; 133ea ; 133ea
.Current ; 133ea .Current ; 133ea
call LoadFont call OpenText
call DoItemEffect call DoItemEffect
call CloseText call CloseText
and a and a

View File

@ -55,7 +55,7 @@ StdScripts::
PokeCenterNurseScript: PokeCenterNurseScript:
; EVENT_WELCOMED_TO_POKECOM_CENTER is never set ; EVENT_WELCOMED_TO_POKECOM_CENTER is never set
loadfont opentext
checkmorn checkmorn
iftrue .morn iftrue .morn
checkday checkday
@ -181,7 +181,7 @@ MerchandiseShelfScript:
farjumptext MerchandiseShelfText farjumptext MerchandiseShelfText
TownMapScript: TownMapScript:
loadfont opentext
farwritetext TownMapText farwritetext TownMapText
waitbutton waitbutton
special Special_TownMap special Special_TownMap
@ -192,7 +192,7 @@ WindowScript:
farjumptext WindowText farjumptext WindowText
TVScript: TVScript:
loadfont opentext
farwritetext TVText farwritetext TVText
waitbutton waitbutton
closetext closetext
@ -202,7 +202,7 @@ HomepageScript:
farjumptext HomepageText farjumptext HomepageText
Radio1Script: Radio1Script:
loadfont opentext
writebyte $0 writebyte $0
special MapRadio special MapRadio
closetext closetext
@ -210,7 +210,7 @@ Radio1Script:
Radio2Script: Radio2Script:
; Lucky Channel ; Lucky Channel
loadfont opentext
writebyte $4 writebyte $4
special MapRadio special MapRadio
closetext closetext
@ -220,7 +220,7 @@ TrashCanScript: ; 0xbc1a5
farjumptext TrashCanText farjumptext TrashCanText
PCScript: PCScript:
loadfont opentext
special PokemonCenterPC special PokemonCenterPC
closetext closetext
end end
@ -317,7 +317,7 @@ BugContestResultsScript:
clearevent EVENT_CONTEST_OFFICER_HAS_EVERSTONE clearevent EVENT_CONTEST_OFFICER_HAS_EVERSTONE
clearevent EVENT_CONTEST_OFFICER_HAS_GOLD_BERRY clearevent EVENT_CONTEST_OFFICER_HAS_GOLD_BERRY
clearevent EVENT_CONTEST_OFFICER_HAS_BERRY clearevent EVENT_CONTEST_OFFICER_HAS_BERRY
loadfont opentext
farwritetext ContestResults_ReadyToJudgeText farwritetext ContestResults_ReadyToJudgeText
waitbutton waitbutton
special BugContestJudging special BugContestJudging
@ -1385,7 +1385,7 @@ PackFullMScript:
end end
RematchGiftMScript: RematchGiftMScript:
loadfont opentext
checkcode VAR_CALLERID checkcode VAR_CALLERID
if_equal PHONE_SAILOR_HUEY, .Huey if_equal PHONE_SAILOR_HUEY, .Huey
if_equal PHONE_YOUNGSTER_JOEY, .Joey if_equal PHONE_YOUNGSTER_JOEY, .Joey
@ -1753,14 +1753,14 @@ RematchGiftFScript:
if_equal PHONE_PICNICKER_ERIN, .Erin if_equal PHONE_PICNICKER_ERIN, .Erin
.Erin .Erin
loadfont opentext
farwritetext ErinRematchGiftText farwritetext ErinRematchGiftText
buttonsound buttonsound
end end
GymStatue1Script: GymStatue1Script:
mapnametotext $0 mapnametotext $0
loadfont opentext
farwritetext GymStatue_CityGymText farwritetext GymStatue_CityGymText
waitbutton waitbutton
closetext closetext
@ -1768,7 +1768,7 @@ GymStatue1Script:
GymStatue2Script: GymStatue2Script:
mapnametotext $0 mapnametotext $0
loadfont opentext
farwritetext GymStatue_CityGymText farwritetext GymStatue_CityGymText
buttonsound buttonsound
farwritetext GymStatue_WinningTrainersText farwritetext GymStatue_WinningTrainersText
@ -1794,7 +1794,7 @@ ReceiveTogepiEggScript: ; 0xbcdc3
GameCornerCoinVendorScript: ; 0xbcdcd GameCornerCoinVendorScript: ; 0xbcdcd
faceplayer faceplayer
loadfont opentext
farwritetext CoinVendor_WelcomeText farwritetext CoinVendor_WelcomeText
buttonsound buttonsound
checkitem COIN_CASE checkitem COIN_CASE
@ -1887,7 +1887,7 @@ CoinVendor_MenuData2: ; 0xbce5c
HappinessCheckScript: HappinessCheckScript:
faceplayer faceplayer
loadfont opentext
special GetFirstPokemonHappiness special GetFirstPokemonHappiness
if_less_than 50, .Unhappy if_less_than 50, .Unhappy
if_less_than 150, .KindaHappy if_less_than 150, .KindaHappy

View File

@ -571,7 +571,7 @@ Function16a3b: ; 16a3b
ld a, [wDaycareMan] ld a, [wDaycareMan]
bit 0, a bit 0, a
ret z ret z
callab Function16e1d callab CheckBreedmonCompatibility
ld a, [wd265] ld a, [wd265]
and a and a
ret z ret z

View File

@ -2,7 +2,7 @@ FindItemInBallScript:: ; 0x122ce
callasm .TryReceiveItem callasm .TryReceiveItem
iffalse .no_room iffalse .no_room
disappear LAST_TALKED disappear LAST_TALKED
loadfont opentext
writetext .text_found writetext .text_found
playsound SFX_ITEM playsound SFX_ITEM
pause 60 pause 60
@ -12,7 +12,7 @@ FindItemInBallScript:: ; 0x122ce
; 0x122e3 ; 0x122e3
.no_room: ; 0x122e3 .no_room: ; 0x122e3
loadfont opentext
writetext .text_found writetext .text_found
waitbutton waitbutton
writetext .text_bag_full writetext .text_bag_full

View File

@ -111,7 +111,7 @@ DoPoisonStep:: ; 505da
.Script_MonFaintedToPoison: ; 50669 .Script_MonFaintedToPoison: ; 50669
callasm .PlayPoisonSFX callasm .PlayPoisonSFX
loadfont opentext
callasm .CheckWhitedOut callasm .CheckWhitedOut
iffalse .whiteout iffalse .whiteout
closetext closetext

View File

@ -22,7 +22,7 @@ CloseText:: ; 2dcf
ld a, $1 ld a, $1
ld [hOAMUpdate], a ld [hOAMUpdate], a
call Function2de2 call .CloseText
pop af pop af
ld [hOAMUpdate], a ld [hOAMUpdate], a
@ -31,7 +31,7 @@ CloseText:: ; 2dcf
ret ret
; 2de2 ; 2de2
Function2de2:: ; 2de2 .CloseText ; 2de2
call ResetTextRelatedRAM call ResetTextRelatedRAM
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
@ -48,17 +48,17 @@ Function2de2:: ; 2de2
ret ret
; 2e08 ; 2e08
LoadFont:: ; 2e08 OpenText:: ; 2e08
call ResetTextRelatedRAM call ResetTextRelatedRAM
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(Function6454) ; and BANK(Function64bf) ld a, BANK(Function6454) ; and BANK(Function64bf)
rst Bankswitch rst Bankswitch
call Function6454 call Function6454 ; clear bgmap
call SpeechTextBox call SpeechTextBox
call Function2e20 call Function2e20 ; anchor bgmap
call Function64bf call Function64bf ; load font
pop af pop af
rst Bankswitch rst Bankswitch

View File

@ -476,9 +476,9 @@ pocketisfull: macro
db pocketisfull_command db pocketisfull_command
endm endm
enum loadfont_command enum opentext_command
loadfont: macro opentext: macro
db loadfont_command db opentext_command
endm endm
enum refreshscreen_command enum refreshscreen_command

650
main.asm

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ AzaleaGym_MapScriptHeader:
BugsyScript: BugsyScript:
faceplayer faceplayer
loadfont opentext
checkevent EVENT_BEAT_BUGSY checkevent EVENT_BEAT_BUGSY
iftrue .FightDone iftrue .FightDone
writetext BugsyText_INeverLose writetext BugsyText_INeverLose
@ -27,7 +27,7 @@ BugsyScript:
startbattle startbattle
returnafterbattle returnafterbattle
setevent EVENT_BEAT_BUGSY setevent EVENT_BEAT_BUGSY
loadfont opentext
writetext Text_ReceivedHiveBadge writetext Text_ReceivedHiveBadge
playsound SFX_GET_BADGE playsound SFX_GET_BADGE
waitsfx waitsfx
@ -74,7 +74,7 @@ TrainerTwinsAmyandmay1:
.AfterScript: .AfterScript:
end_if_just_battled end_if_just_battled
loadfont opentext
writetext TwinsAmyandmay1AfterBattleText writetext TwinsAmyandmay1AfterBattleText
waitbutton waitbutton
closetext closetext
@ -85,7 +85,7 @@ TrainerTwinsAmyandmay2:
.AfterScript: .AfterScript:
end_if_just_battled end_if_just_battled
loadfont opentext
writetext TwinsAmyandmay2AfterBattleText writetext TwinsAmyandmay2AfterBattleText
waitbutton waitbutton
closetext closetext
@ -96,7 +96,7 @@ TrainerBug_catcherbenny:
.AfterScript: .AfterScript:
end_if_just_battled end_if_just_battled
loadfont opentext
writetext Bug_catcherbennyAfterBattleText writetext Bug_catcherbennyAfterBattleText
waitbutton waitbutton
closetext closetext
@ -107,7 +107,7 @@ TrainerBug_catcherAl:
.AfterScript: .AfterScript:
end_if_just_battled end_if_just_battled
loadfont opentext
writetext Bug_catcherAlAfterBattleText writetext Bug_catcherAlAfterBattleText
waitbutton waitbutton
closetext closetext
@ -118,7 +118,7 @@ TrainerBug_catcherJosh:
.AfterScript: .AfterScript:
end_if_just_battled end_if_just_battled
loadfont opentext
writetext Bug_catcherJoshAfterBattleText writetext Bug_catcherJoshAfterBattleText
waitbutton waitbutton
closetext closetext
@ -128,14 +128,14 @@ AzaleaGymGuyScript:
faceplayer faceplayer
checkevent EVENT_BEAT_BUGSY checkevent EVENT_BEAT_BUGSY
iftrue .AzaleaGymGuyWinScript iftrue .AzaleaGymGuyWinScript
loadfont opentext
writetext AzaleaGymGuyText writetext AzaleaGymGuyText
waitbutton waitbutton
closetext closetext
end end
.AzaleaGymGuyWinScript .AzaleaGymGuyWinScript
loadfont opentext
writetext AzaleaGymGuyWinText writetext AzaleaGymGuyWinText
waitbutton waitbutton
closetext closetext

View File

@ -11,7 +11,7 @@ AzaleaMart_MapScriptHeader:
db 0 db 0
ClerkScript_0x18e040: ClerkScript_0x18e040:
loadfont opentext
pokemart MARTTYPE_STANDARD, MART_AZALEA pokemart MARTTYPE_STANDARD, MART_AZALEA
closetext closetext
end end

View File

@ -61,7 +61,7 @@ UnknownScript_0x198034:
spriteface PLAYER, UP spriteface PLAYER, UP
UnknownScript_0x198049: UnknownScript_0x198049:
playmusic MUSIC_RIVAL_ENCOUNTER playmusic MUSIC_RIVAL_ENCOUNTER
loadfont opentext
writetext UnknownText_0x19814d writetext UnknownText_0x19814d
waitbutton waitbutton
closetext closetext
@ -98,7 +98,7 @@ UnknownScript_0x198081:
UnknownScript_0x198091: UnknownScript_0x198091:
playmusic MUSIC_RIVAL_AFTER playmusic MUSIC_RIVAL_AFTER
loadfont opentext
writetext UnknownText_0x198233 writetext UnknownText_0x198233
waitbutton waitbutton
closetext closetext
@ -119,7 +119,7 @@ AzaleaRocketScript_0x1980ae:
GrampsScript_0x1980b1: GrampsScript_0x1980b1:
faceplayer faceplayer
loadfont opentext
checkevent EVENT_CLEARED_SLOWPOKE_WELL checkevent EVENT_CLEARED_SLOWPOKE_WELL
iftrue UnknownScript_0x1980bf iftrue UnknownScript_0x1980bf
writetext UnknownText_0x19841b writetext UnknownText_0x19841b
@ -140,7 +140,7 @@ YoungsterScript_0x1980c8:
jumptextfaceplayer UnknownText_0x19851a jumptextfaceplayer UnknownText_0x19851a
SlowpokeScript_0x1980cb: SlowpokeScript_0x1980cb:
loadfont opentext
writetext UnknownText_0x1985b0 writetext UnknownText_0x1985b0
pause 60 pause 60
writetext UnknownText_0x1985c3 writetext UnknownText_0x1985c3
@ -152,7 +152,7 @@ SlowpokeScript_0x1980cb:
WoosterScript: WoosterScript:
; unused ; unused
faceplayer faceplayer
loadfont opentext
writetext WoosterText writetext WoosterText
cry QUAGSIRE cry QUAGSIRE
waitbutton waitbutton
@ -161,7 +161,7 @@ WoosterScript:
UnknownScript_0x1980e5: UnknownScript_0x1980e5:
applymovement PLAYER, MovementData_0x198148 applymovement PLAYER, MovementData_0x198148
loadfont opentext
writetext UnknownText_0x1985df writetext UnknownText_0x1985df
buttonsound buttonsound
spriteface AZALEATOWN_KURT_OUTSIDE, RIGHT spriteface AZALEATOWN_KURT_OUTSIDE, RIGHT
@ -180,7 +180,7 @@ UnknownScript_0x1980e5:
KurtOutsideScript_0x19810c: KurtOutsideScript_0x19810c:
faceplayer faceplayer
loadfont opentext
writetext UnknownText_0x198628 writetext UnknownText_0x198628
waitbutton waitbutton
spriteface AZALEATOWN_KURT_OUTSIDE, LEFT spriteface AZALEATOWN_KURT_OUTSIDE, LEFT

View File

@ -26,7 +26,7 @@ BattleTower1F_MapScriptHeader:
if_equal $2, .priorityjump1 if_equal $2, .priorityjump1
if_equal $3, .SkipEverything if_equal $3, .SkipEverything
if_equal $4, .SkipEverything if_equal $4, .SkipEverything
loadfont opentext
writetext Text_WeveBeenWaitingForYou writetext Text_WeveBeenWaitingForYou
waitbutton waitbutton
closetext closetext
@ -45,7 +45,7 @@ BattleTower1F_MapScriptHeader:
end end
MapBattleTower1FSignpost0Script: MapBattleTower1FSignpost0Script:
loadfont opentext
writetext Text_ReadBattleTowerRules writetext Text_ReadBattleTowerRules
yesorno yesorno
iffalse UnknownScript_0x9e3e0 iffalse UnknownScript_0x9e3e0
@ -59,7 +59,7 @@ ReceptionistScript_0x9e3e2:
writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState writebyte BATTLETOWERACTION_02 ; copybytetovar sBattleTowerChallengeState
special BattleTowerAction special BattleTowerAction
if_equal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm if_equal $3, Script_BeatenAllTrainers2 ; maps/BattleTowerBattleRoom.asm
loadfont opentext
writetext Text_BattleTowerWelcomesYou writetext Text_BattleTowerWelcomesYou
buttonsound buttonsound
writebyte BATTLETOWERACTION_00 ; if new save file: bit 1, [sbe4f] writebyte BATTLETOWERACTION_00 ; if new save file: bit 1, [sbe4f]
@ -244,14 +244,14 @@ UnknownScript_0x9e550:
end end
BattleTower_LeftWithoutSaving: BattleTower_LeftWithoutSaving:
loadfont opentext
writetext Text_BattleTower_LeftWithoutSaving writetext Text_BattleTower_LeftWithoutSaving
waitbutton waitbutton
jump Script_BattleTowerHopeToServeYouAgain jump Script_BattleTowerHopeToServeYouAgain
YoungsterScript_0x9e55d: YoungsterScript_0x9e55d:
faceplayer faceplayer
loadfont opentext
writetext Text_BattleTowerYoungster writetext Text_BattleTowerYoungster
waitbutton waitbutton
closetext closetext

View File

@ -30,7 +30,7 @@ Script_BattleRoomLoop: ; 0x9f425
warpsound warpsound
waitsfx waitsfx
applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn applymovement BATTLETOWERBATTLEROOM_YOUNGSTER, MovementData_BattleTowerBattleRoomOpponentWalksIn
loadfont opentext
battletowertext 1 battletowertext 1
buttonsound buttonsound
closetext closetext
@ -45,7 +45,7 @@ Script_BattleRoomLoop: ; 0x9f425
disappear BATTLETOWERBATTLEROOM_YOUNGSTER disappear BATTLETOWERBATTLEROOM_YOUNGSTER
applymovement BATTLETOWERBATTLEROOM_RECEPTIONIST, MovementData_BattleTowerBattleRoomReceptionistWalksToPlayer applymovement BATTLETOWERBATTLEROOM_RECEPTIONIST, MovementData_BattleTowerBattleRoomReceptionistWalksToPlayer
applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceReceptionist applymovement PLAYER, MovementData_BattleTowerBattleRoomPlayerTurnsToFaceReceptionist
loadfont opentext
writetext Text_YourPkmnWillBeHealedToFullHealth writetext Text_YourPkmnWillBeHealedToFullHealth
waitbutton waitbutton
closetext closetext
@ -55,7 +55,7 @@ Script_BattleRoomLoop: ; 0x9f425
pause 60 pause 60
special FadeInPalettes special FadeInPalettes
special RestartMapMusic special RestartMapMusic
loadfont opentext
writetext Text_NextUpOpponentNo writetext Text_NextUpOpponentNo
yesorno yesorno
iffalse Script_DontBattleNextOpponent iffalse Script_DontBattleNextOpponent
@ -90,7 +90,7 @@ Script_DontSaveAndEndTheSession: ; 0x9f4a3
closetext closetext
special FadeOutPalettes special FadeOutPalettes
warpfacing UP, BATTLE_TOWER_1F, $7, $7 warpfacing UP, BATTLE_TOWER_1F, $7, $7
loadfont opentext
jump Script_BattleTowerHopeToServeYouAgain jump Script_BattleTowerHopeToServeYouAgain
Script_FailedBattleTowerChallenge: Script_FailedBattleTowerChallenge:
@ -99,7 +99,7 @@ Script_FailedBattleTowerChallenge:
warpfacing UP, BATTLE_TOWER_1F, $7, $7 warpfacing UP, BATTLE_TOWER_1F, $7, $7
writebyte BATTLETOWERACTION_CHALLENGECANCELED writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction special BattleTowerAction
loadfont opentext
writetext Text_ThanksForVisiting writetext Text_ThanksForVisiting
waitbutton waitbutton
closetext closetext
@ -110,14 +110,14 @@ Script_BeatenAllTrainers: ; 0x9f4d9
special Special_BattleTowerFade special Special_BattleTowerFade
warpfacing UP, BATTLE_TOWER_1F, $7, $7 warpfacing UP, BATTLE_TOWER_1F, $7, $7
Script_BeatenAllTrainers2: Script_BeatenAllTrainers2:
loadfont opentext
writetext Text_CongratulationsYouveBeatenAllTheTrainers writetext Text_CongratulationsYouveBeatenAllTheTrainers
jump Script_GivePlayerHisPrize jump Script_GivePlayerHisPrize
UnreferencedScript_0x9f4eb: UnreferencedScript_0x9f4eb:
writebyte BATTLETOWERACTION_CHALLENGECANCELED writebyte BATTLETOWERACTION_CHALLENGECANCELED
special BattleTowerAction special BattleTowerAction
loadfont opentext
writetext Text_TooMuchTimeElapsedNoRegister writetext Text_TooMuchTimeElapsedNoRegister
waitbutton waitbutton
closetext closetext
@ -128,7 +128,7 @@ UnreferencedScript_0x9f4f7:
special BattleTowerAction special BattleTowerAction
writebyte BATTLETOWERACTION_06 writebyte BATTLETOWERACTION_06
special BattleTowerAction special BattleTowerAction
loadfont opentext
writetext Text_ThanksForVisiting writetext Text_ThanksForVisiting
writetext Text_WeHopeToServeYouAgain writetext Text_WeHopeToServeYouAgain
waitbutton waitbutton

Some files were not shown because too many files have changed in this diff Show More