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

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
FruitTreeScript:: ; 44000
callasm GetCurTreeFruit
loadfont
opentext
copybytetovar CurFruit
itemtotext $0, $0
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_itemnotify ; 45
dw Script_pocketisfull ; 46
dw Script_loadfont ; 47
dw Script_textbox ; 47
dw Script_refreshscreen ; 48
dw Script_closetext ; 49
dw Script_loadbytec2cf ; 4a
@@ -345,7 +345,7 @@ Script_jumptext: ; 96e5f
JumpTextFacePlayerScript: ; 96e79
faceplayer
JumpTextScript: ; 96e7a
loadfont
opentext
repeattext -1, -1
waitbutton
closetext
@@ -3026,10 +3026,10 @@ Script_reloadandreturn: ; 97b16
jp Script_end
; 97b1c
Script_loadfont: ; 97b1c
Script_textbox: ; 97b1c
; script command 0x47
call LoadFont
call OpenText
ret
; 97b20

View File

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

View File

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