2015-12-09 23:25:44 +00:00
|
|
|
CheckBreedmonCompatibility: ; 16e1d
|
|
|
|
call .CheckBreedingGroupCompatibility
|
2015-11-10 21:53:37 +00:00
|
|
|
ld c, $0
|
2015-12-09 23:25:44 +00:00
|
|
|
jp nc, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld a, [wBreedMon1DVs]
|
|
|
|
ld [TempMonDVs], a
|
|
|
|
ld a, [wBreedMon1DVs + 1]
|
|
|
|
ld [TempMonDVs + 1], a
|
2016-05-11 21:16:03 +00:00
|
|
|
ld a, TEMPMON
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [MonType], a
|
|
|
|
predef GetGender
|
2015-12-09 23:25:44 +00:00
|
|
|
jr c, .genderless
|
2015-11-10 21:53:37 +00:00
|
|
|
ld b, $1
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .breedmon2
|
2015-11-10 21:53:37 +00:00
|
|
|
inc b
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.breedmon2
|
2015-11-10 21:53:37 +00:00
|
|
|
push bc
|
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld a, [wBreedMon2DVs]
|
|
|
|
ld [TempMonDVs], a
|
|
|
|
ld a, [wBreedMon2DVs + 1]
|
|
|
|
ld [TempMonDVs + 1], a
|
|
|
|
ld a, $3
|
|
|
|
ld [MonType], a
|
|
|
|
predef GetGender
|
|
|
|
pop bc
|
2015-12-09 23:25:44 +00:00
|
|
|
jr c, .genderless
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, $1
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .compare_gender
|
2015-11-10 21:53:37 +00:00
|
|
|
inc a
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.compare_gender
|
2015-11-10 21:53:37 +00:00
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .compute
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.genderless
|
2015-11-10 21:53:37 +00:00
|
|
|
ld c, $0
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
cp DITTO
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .ditto1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
cp DITTO
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .done
|
|
|
|
jr .compute
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.ditto1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
cp DITTO
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.compute
|
|
|
|
call .CheckDVs
|
|
|
|
ld c, 255
|
|
|
|
jp z, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
ld c, 254
|
|
|
|
jr z, .compare_ids
|
|
|
|
ld c, 128
|
|
|
|
.compare_ids
|
|
|
|
; Speed up
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1ID]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wBreedMon2ID]
|
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1ID + 1]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wBreedMon2ID + 1]
|
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
jr nz, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, c
|
2015-12-09 23:25:44 +00:00
|
|
|
sub 77
|
2015-11-10 21:53:37 +00:00
|
|
|
ld c, a
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, c
|
|
|
|
ld [wd265], a
|
|
|
|
ret
|
|
|
|
; 16ebc
|
|
|
|
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.CheckDVs: ; 16ebc (5:6ebc)
|
|
|
|
; If Defense DVs match and the lower 3 bits of the Special DVs match,
|
2016-10-28 23:52:13 +00:00
|
|
|
; avoid breeding
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1DVs]
|
2015-12-09 23:25:44 +00:00
|
|
|
and %1111
|
2015-11-10 21:53:37 +00:00
|
|
|
ld b, a
|
|
|
|
ld a, [wBreedMon2DVs]
|
2015-12-09 23:25:44 +00:00
|
|
|
and %1111
|
2015-11-10 21:53:37 +00:00
|
|
|
cp b
|
|
|
|
ret nz
|
|
|
|
ld a, [wBreedMon1DVs + 1]
|
2015-12-09 23:25:44 +00:00
|
|
|
and %111
|
2015-11-10 21:53:37 +00:00
|
|
|
ld b, a
|
|
|
|
ld a, [wBreedMon2DVs + 1]
|
2015-12-09 23:25:44 +00:00
|
|
|
and %111
|
2015-11-10 21:53:37 +00:00
|
|
|
cp b
|
|
|
|
ret
|
|
|
|
; 16ed6
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
.CheckBreedingGroupCompatibility: ; 16ed6
|
|
|
|
; If either mon is in the No Eggs group,
|
|
|
|
; they are not compatible.
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [BaseEggGroups]
|
2015-12-09 23:25:44 +00:00
|
|
|
cp NO_EGGS * $11
|
|
|
|
jr z, .Incompatible
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [BaseEggGroups]
|
2015-12-09 23:25:44 +00:00
|
|
|
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.
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
cp DITTO
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [BaseEggGroups]
|
|
|
|
push af
|
|
|
|
and $f
|
|
|
|
ld b, a
|
|
|
|
pop af
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
ld c, a
|
2015-12-09 23:25:44 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
cp DITTO
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [CurSpecies], a
|
|
|
|
push bc
|
|
|
|
call GetBaseData
|
|
|
|
pop bc
|
|
|
|
ld a, [BaseEggGroups]
|
|
|
|
push af
|
|
|
|
and $f
|
|
|
|
ld d, a
|
|
|
|
pop af
|
|
|
|
and $f0
|
|
|
|
swap a
|
|
|
|
ld e, a
|
2015-12-09 23:25:44 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, d
|
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
2015-11-10 21:53:37 +00:00
|
|
|
cp c
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, e
|
|
|
|
cp b
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
2015-11-10 21:53:37 +00:00
|
|
|
cp c
|
2015-12-09 23:25:44 +00:00
|
|
|
jr z, .Compatible
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Incompatible:
|
2015-11-10 21:53:37 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Compatible:
|
2015-11-10 21:53:37 +00:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 16f3e
|
|
|
|
|
|
|
|
DoEggStep:: ; 16f3e
|
|
|
|
ld de, PartySpecies
|
|
|
|
ld hl, PartyMon1Happiness
|
|
|
|
ld c, 0
|
|
|
|
.loop
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
cp -1
|
|
|
|
ret z
|
|
|
|
cp EGG
|
|
|
|
jr nz, .next
|
|
|
|
dec [hl]
|
|
|
|
jr nz, .next
|
|
|
|
ld a, 1
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.next
|
|
|
|
push de
|
|
|
|
ld de, PARTYMON_STRUCT_LENGTH
|
|
|
|
add hl, de
|
|
|
|
pop de
|
|
|
|
jr .loop
|
|
|
|
; 16f5e
|
|
|
|
|
|
|
|
OverworldHatchEgg:: ; 16f5e
|
2015-12-25 03:58:42 +00:00
|
|
|
call RefreshScreen
|
2015-11-11 21:11:08 +00:00
|
|
|
call LoadStandardMenuDataHeader
|
2015-12-02 18:24:18 +00:00
|
|
|
call HatchEggs
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-11-10 21:53:37 +00:00
|
|
|
call RestartMapMusic
|
2015-11-25 15:16:29 +00:00
|
|
|
jp CloseText
|
2015-11-10 21:53:37 +00:00
|
|
|
; 16f70
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
HatchEggs: ; 16f70 (5:6f70)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld de, PartySpecies
|
|
|
|
ld hl, PartyMon1Happiness
|
|
|
|
xor a
|
|
|
|
ld [CurPartyMon], a
|
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
.loop ; 16f7a (5:6f7a)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
cp -1
|
2015-12-02 18:24:18 +00:00
|
|
|
jp z, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
push de
|
|
|
|
push hl
|
|
|
|
cp EGG
|
2015-12-02 18:24:18 +00:00
|
|
|
jp nz, .next
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-12-02 18:24:18 +00:00
|
|
|
jp nz, .next
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hl], $78
|
|
|
|
|
|
|
|
push de
|
|
|
|
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall SetEggMonCaughtData
|
|
|
|
farcall TrainerRankings_EggsHatched
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [CurPartyMon]
|
2017-12-10 05:18:29 +00:00
|
|
|
ld hl, PartyMon1Species
|
2015-11-10 21:53:37 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
call AddNTimes
|
|
|
|
ld a, [hl]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
dec a
|
|
|
|
call SetSeenAndCaughtMon
|
|
|
|
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
cp TOGEPI
|
|
|
|
jr nz, .nottogepi
|
|
|
|
; set the event flag for hatching togepi
|
|
|
|
ld de, EVENT_TOGEPI_HATCHED
|
|
|
|
ld b, SET_FLAG
|
|
|
|
call EventFlagAction
|
|
|
|
.nottogepi
|
|
|
|
|
|
|
|
pop de
|
|
|
|
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
dec de
|
|
|
|
ld [de], a
|
|
|
|
ld [wd265], a
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetPokemonName
|
|
|
|
xor a
|
|
|
|
ld [wd26b], a
|
|
|
|
call GetBaseData
|
|
|
|
ld a, [CurPartyMon]
|
2017-12-10 05:18:29 +00:00
|
|
|
ld hl, PartyMon1
|
2015-11-10 21:53:37 +00:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
call AddNTimes
|
|
|
|
push hl
|
|
|
|
ld bc, MON_MAXHP
|
|
|
|
add hl, bc
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
pop hl
|
|
|
|
push hl
|
|
|
|
ld bc, MON_LEVEL
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
ld [CurPartyLevel], a
|
|
|
|
pop hl
|
|
|
|
push hl
|
|
|
|
ld bc, MON_STATUS
|
|
|
|
add hl, bc
|
|
|
|
xor a
|
|
|
|
ld [hli], a
|
|
|
|
ld [hl], a
|
|
|
|
pop hl
|
|
|
|
push hl
|
2015-12-21 19:10:16 +00:00
|
|
|
ld bc, MON_STAT_EXP - 1
|
2015-11-10 21:53:37 +00:00
|
|
|
add hl, bc
|
|
|
|
ld b, $0
|
|
|
|
predef CalcPkmnStats
|
|
|
|
pop bc
|
|
|
|
ld hl, MON_MAXHP
|
|
|
|
add hl, bc
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
ld hl, MON_HP
|
|
|
|
add hl, bc
|
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
ld a, [de]
|
|
|
|
ld [hl], a
|
|
|
|
ld hl, MON_ID
|
|
|
|
add hl, bc
|
|
|
|
ld a, [PlayerID]
|
|
|
|
ld [hli], a
|
|
|
|
ld a, [PlayerID + 1]
|
|
|
|
ld [hl], a
|
|
|
|
ld a, [CurPartyMon]
|
2017-12-10 05:18:29 +00:00
|
|
|
ld hl, PartyMonOT
|
2015-11-10 21:53:37 +00:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call AddNTimes
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
ld hl, PlayerName
|
|
|
|
call CopyBytes
|
2015-12-02 18:24:18 +00:00
|
|
|
ld hl, .Text_HatchEgg
|
2015-11-10 21:53:37 +00:00
|
|
|
call PrintText
|
|
|
|
ld a, [CurPartyMon]
|
|
|
|
ld hl, PartyMonNicknames
|
|
|
|
ld bc, PKMN_NAME_LENGTH
|
|
|
|
call AddNTimes
|
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
push de
|
2015-12-02 18:24:18 +00:00
|
|
|
ld hl, .Text_NicknameHatchling
|
2015-11-10 21:53:37 +00:00
|
|
|
call PrintText
|
|
|
|
call YesNoBox
|
|
|
|
pop de
|
|
|
|
jr c, .nonickname
|
2015-12-02 18:24:18 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, $1
|
|
|
|
ld [wd26b], a
|
|
|
|
xor a
|
|
|
|
ld [MonType], a
|
|
|
|
push de
|
|
|
|
ld b, $0
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall NamingScreen
|
2015-11-10 21:53:37 +00:00
|
|
|
pop hl
|
|
|
|
ld de, StringBuffer1
|
|
|
|
call InitName
|
2015-12-02 18:24:18 +00:00
|
|
|
jr .next
|
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
.nonickname
|
|
|
|
ld hl, StringBuffer1
|
|
|
|
ld bc, PKMN_NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
.next ; 1707d (5:707d)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld hl, CurPartyMon
|
|
|
|
inc [hl]
|
|
|
|
pop hl
|
|
|
|
ld de, PARTYMON_STRUCT_LENGTH
|
|
|
|
add hl, de
|
|
|
|
pop de
|
2015-12-02 18:24:18 +00:00
|
|
|
jp .loop
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
.done ; 1708a (5:708a)
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
; 1708b (5:708b)
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
.Text_HatchEgg: ; 0x1708b
|
2015-11-10 21:53:37 +00:00
|
|
|
; Huh? @ @
|
|
|
|
text_jump UnknownText_0x1c0db0
|
|
|
|
start_asm
|
|
|
|
ld hl, VramState
|
|
|
|
res 0, [hl]
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
push af
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_AnimationSequence
|
|
|
|
ld hl, .ClearTextbox
|
2015-11-10 21:53:37 +00:00
|
|
|
call PrintText
|
|
|
|
pop af
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
2015-12-02 18:24:18 +00:00
|
|
|
ld hl, .CameOutOfItsEgg
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
; 170b0 (5:70b0)
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
.ClearTextbox: ; 0x170b0
|
2015-11-10 21:53:37 +00:00
|
|
|
;
|
|
|
|
text_jump UnknownText_0x1c0db8
|
|
|
|
db "@"
|
|
|
|
; 0x170b5
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
.CameOutOfItsEgg: ; 0x170b5
|
2015-11-10 21:53:37 +00:00
|
|
|
; came out of its EGG!@ @
|
|
|
|
text_jump UnknownText_0x1c0dba
|
|
|
|
db "@"
|
|
|
|
; 0x170ba
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
.Text_NicknameHatchling: ; 0x170ba
|
2015-11-10 21:53:37 +00:00
|
|
|
; Give a nickname to @ ?
|
|
|
|
text_jump UnknownText_0x1c0dd8
|
|
|
|
db "@"
|
|
|
|
; 0x170bf
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
InitEggMoves: ; 170bf
|
|
|
|
call GetHeritableMoves
|
2015-11-10 21:53:37 +00:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
|
|
|
ld b, NUM_MOVES
|
|
|
|
.loop
|
|
|
|
ld a, [de]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
ld hl, wEggMonMoves
|
|
|
|
ld c, NUM_MOVES
|
|
|
|
.next
|
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
|
|
|
jr z, .skip
|
|
|
|
inc hl
|
|
|
|
dec c
|
|
|
|
jr nz, .next
|
2015-12-02 18:24:18 +00:00
|
|
|
call GetEggMove
|
2015-11-10 21:53:37 +00:00
|
|
|
jr nc, .skip
|
2015-12-02 18:24:18 +00:00
|
|
|
call LoadEggMove
|
2015-11-10 21:53:37 +00:00
|
|
|
|
|
|
|
.skip
|
|
|
|
inc de
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
; 170e4
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
GetEggMove: ; 170e4
|
2015-11-10 21:53:37 +00:00
|
|
|
GLOBAL EggMoves
|
|
|
|
|
|
|
|
push bc
|
|
|
|
ld a, [wEggMonSpecies]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, EggMovePointers
|
|
|
|
add hl, bc
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, bc
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, BANK(EggMovePointers)
|
|
|
|
call GetFarHalfword
|
|
|
|
.loop
|
|
|
|
ld a, BANK(EggMoves)
|
|
|
|
call GetFarByte
|
|
|
|
cp -1
|
2015-12-02 18:24:18 +00:00
|
|
|
jr z, .reached_end
|
2015-11-10 21:53:37 +00:00
|
|
|
ld b, a
|
|
|
|
ld a, [de]
|
|
|
|
cp b
|
|
|
|
jr z, .done_carry
|
|
|
|
inc hl
|
|
|
|
jr .loop
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
.reached_end
|
2015-12-09 23:25:44 +00:00
|
|
|
call GetBreedmonMovePointer
|
2015-11-10 21:53:37 +00:00
|
|
|
ld b, NUM_MOVES
|
|
|
|
.loop2
|
|
|
|
ld a, [de]
|
|
|
|
cp [hl]
|
|
|
|
jr z, .found_eggmove
|
|
|
|
inc hl
|
|
|
|
dec b
|
|
|
|
jr z, .inherit_tmhm
|
|
|
|
jr .loop2
|
|
|
|
|
|
|
|
.found_eggmove
|
|
|
|
ld a, [wEggMonSpecies]
|
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, EvosAttacksPointers
|
|
|
|
add hl, bc
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, bc
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, BANK(EvosAttacksPointers)
|
|
|
|
call GetFarHalfword
|
|
|
|
.loop3
|
|
|
|
ld a, BANK(EvosAttacks)
|
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
and a
|
|
|
|
jr nz, .loop3
|
|
|
|
.loop4
|
|
|
|
ld a, BANK(EvosAttacks)
|
|
|
|
call GetFarByte
|
|
|
|
and a
|
|
|
|
jr z, .inherit_tmhm
|
|
|
|
inc hl
|
|
|
|
ld a, BANK(EvosAttacks)
|
|
|
|
call GetFarByte
|
|
|
|
ld b, a
|
|
|
|
ld a, [de]
|
|
|
|
cp b
|
|
|
|
jr z, .done_carry
|
|
|
|
inc hl
|
|
|
|
jr .loop4
|
|
|
|
|
|
|
|
.inherit_tmhm
|
|
|
|
ld hl, TMHMMoves
|
|
|
|
.loop5
|
|
|
|
ld a, BANK(TMHMMoves)
|
|
|
|
call GetFarByte
|
|
|
|
inc hl
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
ld b, a
|
|
|
|
ld a, [de]
|
|
|
|
cp b
|
|
|
|
jr nz, .loop5
|
2015-12-02 18:24:18 +00:00
|
|
|
ld [wPutativeTMHMMove], a
|
2015-11-10 21:53:37 +00:00
|
|
|
predef CanLearnTMHMMove
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
|
|
|
|
.done_carry
|
|
|
|
pop bc
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop bc
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 17169
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
LoadEggMove: ; 17169
|
2015-11-10 21:53:37 +00:00
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
ld a, [de]
|
|
|
|
ld b, a
|
|
|
|
ld hl, wEggMonMoves
|
|
|
|
ld c, NUM_MOVES
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
dec c
|
|
|
|
jr nz, .loop
|
|
|
|
ld de, wEggMonMoves
|
|
|
|
ld hl, wEggMonMoves + 1
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
|
|
|
|
.done
|
|
|
|
dec hl
|
|
|
|
ld [hl], b
|
|
|
|
ld hl, wEggMonMoves
|
|
|
|
ld de, wEggMonPP
|
|
|
|
predef FillPP
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
; 17197
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
GetHeritableMoves: ; 17197
|
2015-11-10 21:53:37 +00:00
|
|
|
ld hl, wBreedMon2Moves
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
cp DITTO
|
|
|
|
jr z, .ditto1
|
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
cp DITTO
|
|
|
|
jr z, .ditto2
|
2015-12-19 01:07:09 +00:00
|
|
|
ld a, [wBreedMotherOrNonDitto]
|
2015-11-10 21:53:37 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld hl, wBreedMon1Moves
|
|
|
|
ret
|
|
|
|
|
|
|
|
.ditto1
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
push af
|
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld a, [wBreedMon2DVs]
|
|
|
|
ld [TempMonDVs], a
|
|
|
|
ld a, [wBreedMon2DVs + 1]
|
|
|
|
ld [TempMonDVs + 1], a
|
2016-05-11 21:16:03 +00:00
|
|
|
ld a, TEMPMON
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [MonType], a
|
|
|
|
predef GetGender
|
|
|
|
jr c, .inherit_mon2_moves
|
|
|
|
jr nz, .inherit_mon2_moves
|
|
|
|
jr .inherit_mon1_moves
|
|
|
|
|
|
|
|
.ditto2
|
|
|
|
ld a, [CurPartySpecies]
|
|
|
|
push af
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld a, [wBreedMon1DVs]
|
|
|
|
ld [TempMonDVs], a
|
|
|
|
ld a, [wBreedMon1DVs + 1]
|
|
|
|
ld [TempMonDVs + 1], a
|
2016-05-11 21:16:03 +00:00
|
|
|
ld a, TEMPMON
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [MonType], a
|
|
|
|
predef GetGender
|
|
|
|
jr c, .inherit_mon1_moves
|
|
|
|
jr nz, .inherit_mon1_moves
|
|
|
|
|
|
|
|
.inherit_mon2_moves
|
|
|
|
ld hl, wBreedMon2Moves
|
|
|
|
pop af
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.inherit_mon1_moves
|
|
|
|
ld hl, wBreedMon1Moves
|
|
|
|
pop af
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ret
|
|
|
|
; 1720b
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
GetBreedmonMovePointer: ; 1720b
|
2015-11-10 21:53:37 +00:00
|
|
|
ld hl, wBreedMon1Moves
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
cp DITTO
|
|
|
|
ret z
|
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
cp DITTO
|
|
|
|
jr z, .ditto
|
2015-12-19 01:07:09 +00:00
|
|
|
ld a, [wBreedMotherOrNonDitto]
|
2015-11-10 21:53:37 +00:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
|
|
|
|
.ditto
|
|
|
|
ld hl, wBreedMon2Moves
|
|
|
|
ret
|
|
|
|
; 17224
|
|
|
|
|
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
GetEggFrontpic: ; 17224 (5:7224)
|
2015-11-10 21:53:37 +00:00
|
|
|
push de
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld hl, BattleMonDVs
|
|
|
|
predef GetUnownLetter
|
|
|
|
pop de
|
2017-12-24 20:03:20 +00:00
|
|
|
predef_jump GetMonFrontpic
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-09 23:25:44 +00:00
|
|
|
GetHatchlingFrontpic: ; 1723c (5:723c)
|
2015-11-10 21:53:37 +00:00
|
|
|
push de
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
ld [CurSpecies], a
|
|
|
|
call GetBaseData
|
|
|
|
ld hl, BattleMonDVs
|
|
|
|
predef GetUnownLetter
|
|
|
|
pop de
|
2017-12-24 20:03:20 +00:00
|
|
|
predef_jump GetAnimatedFrontpicPredef
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
Hatch_UpdateFrontpicBGMapCenter: ; 17254 (5:7254)
|
2015-11-10 21:53:37 +00:00
|
|
|
push af
|
|
|
|
call WaitTop
|
|
|
|
push hl
|
|
|
|
push bc
|
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_HEIGHT * SCREEN_WIDTH
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
pop bc
|
|
|
|
pop hl
|
|
|
|
ld a, b
|
|
|
|
ld [hBGMapAddress + 1], a
|
|
|
|
ld a, c
|
2016-01-12 17:46:18 +00:00
|
|
|
ld [hGraphicStartTile], a
|
2015-11-10 21:53:37 +00:00
|
|
|
lb bc, 7, 7
|
2016-01-12 17:46:18 +00:00
|
|
|
predef PlaceGraphic
|
2015-11-10 21:53:37 +00:00
|
|
|
pop af
|
2015-12-11 03:26:31 +00:00
|
|
|
call Hatch_LoadFrontpicPal
|
2015-11-10 21:53:37 +00:00
|
|
|
call SetPalettes
|
|
|
|
jp WaitBGMap
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
EggHatch_DoAnimFrame: ; 1727f (5:727f)
|
2015-11-10 21:53:37 +00:00
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar PlaySpriteAnimations
|
2015-11-10 21:53:37 +00:00
|
|
|
call DelayFrame
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
EggHatch_AnimationSequence: ; 1728f (5:728f)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wd265]
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ld a, [CurSpecies]
|
|
|
|
push af
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
call PlayMusic
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall BlankScreen
|
2015-11-10 21:53:37 +00:00
|
|
|
call DisableLCD
|
|
|
|
ld hl, EggHatchGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles0 tile $00
|
2015-11-10 21:53:37 +00:00
|
|
|
ld bc, $20
|
|
|
|
ld a, BANK(EggHatchGFX)
|
|
|
|
call FarCopyBytes
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ClearSpriteAnims
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $00
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wJumptableIndex]
|
2015-12-09 23:25:44 +00:00
|
|
|
call GetHatchlingFrontpic
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $31
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, EGG
|
2015-12-09 23:25:44 +00:00
|
|
|
call GetEggFrontpic
|
2015-11-10 21:53:37 +00:00
|
|
|
ld de, MUSIC_EVOLUTION
|
|
|
|
call PlayMusic
|
|
|
|
call EnableLCD
|
|
|
|
hlcoord 7, 4
|
2017-12-28 12:32:33 +00:00
|
|
|
ld b, HIGH(vBGMap0)
|
2015-12-11 03:26:31 +00:00
|
|
|
ld c, $31 ; Egg tiles start here
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, EGG
|
2015-12-11 03:26:31 +00:00
|
|
|
call Hatch_UpdateFrontpicBGMapCenter
|
2015-12-02 18:24:18 +00:00
|
|
|
ld c, 80
|
2015-11-10 21:53:37 +00:00
|
|
|
call DelayFrames
|
|
|
|
xor a
|
2018-01-11 20:36:11 +00:00
|
|
|
ld [wFrameCounter], a
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hSCX]
|
|
|
|
ld b, a
|
2015-12-02 18:24:18 +00:00
|
|
|
.outerloop
|
2018-01-11 20:36:11 +00:00
|
|
|
ld hl, wFrameCounter
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [hl]
|
|
|
|
inc [hl]
|
2015-12-02 18:24:18 +00:00
|
|
|
cp 8
|
|
|
|
jr nc, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld e, [hl]
|
2015-12-02 18:24:18 +00:00
|
|
|
.loop
|
|
|
|
; wobble e times
|
|
|
|
ld a, 2
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCX], a
|
2015-12-02 18:24:18 +00:00
|
|
|
ld a, -2
|
2015-12-02 22:59:05 +00:00
|
|
|
ld [wGlobalAnimXOffset], a
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_DoAnimFrame
|
|
|
|
ld c, 2
|
2015-11-10 21:53:37 +00:00
|
|
|
call DelayFrames
|
2015-12-02 18:24:18 +00:00
|
|
|
ld a, -2
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [hSCX], a
|
2015-12-02 18:24:18 +00:00
|
|
|
ld a, 2
|
2015-12-02 22:59:05 +00:00
|
|
|
ld [wGlobalAnimXOffset], a
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_DoAnimFrame
|
|
|
|
ld c, 2
|
2015-11-10 21:53:37 +00:00
|
|
|
call DelayFrames
|
|
|
|
dec e
|
2015-12-02 18:24:18 +00:00
|
|
|
jr nz, .loop
|
|
|
|
ld c, 16
|
2015-11-10 21:53:37 +00:00
|
|
|
call DelayFrames
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_CrackShell
|
|
|
|
jr .outerloop
|
|
|
|
|
|
|
|
.done
|
2015-11-10 21:53:37 +00:00
|
|
|
ld de, SFX_EGG_HATCH
|
|
|
|
call PlaySFX
|
|
|
|
xor a
|
|
|
|
ld [hSCX], a
|
2015-12-02 22:59:05 +00:00
|
|
|
ld [wGlobalAnimXOffset], a
|
2015-11-10 21:53:37 +00:00
|
|
|
call ClearSprites
|
2015-12-11 03:26:31 +00:00
|
|
|
call Hatch_InitShellFragments
|
2015-11-10 21:53:37 +00:00
|
|
|
hlcoord 6, 3
|
2017-12-28 12:32:33 +00:00
|
|
|
ld b, HIGH(vBGMap0)
|
2015-12-11 03:26:31 +00:00
|
|
|
ld c, $00 ; Hatchling tiles start here
|
2015-11-10 21:53:37 +00:00
|
|
|
ld a, [wJumptableIndex]
|
2015-12-11 03:26:31 +00:00
|
|
|
call Hatch_UpdateFrontpicBGMapCenter
|
|
|
|
call Hatch_ShellFragmentLoop
|
2015-11-10 21:53:37 +00:00
|
|
|
call WaitSFX
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
ld [CurPartySpecies], a
|
|
|
|
hlcoord 6, 3
|
|
|
|
ld d, $0
|
|
|
|
ld e, ANIM_MON_HATCH
|
|
|
|
predef AnimateFrontpic
|
|
|
|
pop af
|
|
|
|
ld [CurSpecies], a
|
|
|
|
ret
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
Hatch_LoadFrontpicPal: ; 17363 (5:7363)
|
2015-11-10 21:53:37 +00:00
|
|
|
ld [PlayerHPPal], a
|
2016-06-06 22:23:00 +00:00
|
|
|
ld b, SCGB_EVOLUTION
|
2015-11-10 21:53:37 +00:00
|
|
|
ld c, $0
|
|
|
|
jp GetSGBLayout
|
|
|
|
|
2015-12-02 18:24:18 +00:00
|
|
|
EggHatch_CrackShell: ; 1736d (5:736d)
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, [wFrameCounter]
|
2015-11-10 21:53:37 +00:00
|
|
|
dec a
|
|
|
|
and $7
|
|
|
|
cp $7
|
|
|
|
ret z
|
|
|
|
srl a
|
|
|
|
ret nc
|
|
|
|
swap a
|
|
|
|
srl a
|
2015-11-28 20:13:40 +00:00
|
|
|
add 9 * 8 + 4
|
2015-11-10 21:53:37 +00:00
|
|
|
ld d, a
|
2015-11-28 20:13:40 +00:00
|
|
|
ld e, 11 * 8
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_EGG_CRACK
|
2015-11-13 15:48:49 +00:00
|
|
|
call _InitSpriteAnimStruct
|
2015-12-02 18:24:18 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-10 21:53:37 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ld de, SFX_EGG_CRACK
|
|
|
|
jp PlaySFX
|
|
|
|
; 17393 (5:7393)
|
|
|
|
|
|
|
|
EggHatchGFX: ; 17393
|
2017-12-10 04:37:08 +00:00
|
|
|
INCBIN "gfx/evo/egg_hatch.2bpp"
|
2015-11-10 21:53:37 +00:00
|
|
|
; 173b3
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
Hatch_InitShellFragments: ; 173b3 (5:73b3)
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ClearSpriteAnims
|
2015-11-28 20:13:40 +00:00
|
|
|
ld hl, .SpriteData
|
2015-11-10 21:53:37 +00:00
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
2015-11-28 20:13:40 +00:00
|
|
|
cp -1
|
2015-11-10 21:53:37 +00:00
|
|
|
jr z, .done
|
|
|
|
ld e, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld c, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
push hl
|
|
|
|
push bc
|
2015-12-11 03:26:31 +00:00
|
|
|
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_EGG_HATCH
|
2015-11-13 15:48:49 +00:00
|
|
|
call _InitSpriteAnimStruct
|
2015-12-11 03:26:31 +00:00
|
|
|
|
2015-12-01 20:35:28 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
2015-11-10 21:53:37 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
2015-12-11 03:26:31 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
pop de
|
|
|
|
ld a, e
|
2015-12-05 20:38:25 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
|
2015-11-10 21:53:37 +00:00
|
|
|
add hl, bc
|
|
|
|
add [hl]
|
|
|
|
ld [hl], a
|
2015-12-11 03:26:31 +00:00
|
|
|
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-10 21:53:37 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], d
|
2015-12-11 03:26:31 +00:00
|
|
|
|
2015-11-10 21:53:37 +00:00
|
|
|
pop hl
|
|
|
|
jr .loop
|
|
|
|
.done
|
|
|
|
ld de, SFX_EGG_HATCH
|
|
|
|
call PlaySFX
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_DoAnimFrame
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
; 173ef (5:73ef)
|
|
|
|
|
2018-01-02 19:48:24 +00:00
|
|
|
shell_fragment: MACRO
|
2018-01-02 19:50:04 +00:00
|
|
|
; y tile, y pxl, x tile, x pxl, frameset offset, ???
|
2018-01-02 19:48:24 +00:00
|
|
|
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5 - SPRITE_ANIM_FRAMESET_EGG_HATCH_1, \6
|
|
|
|
ENDM
|
|
|
|
|
2015-11-28 20:13:40 +00:00
|
|
|
.SpriteData: ; 173ef
|
2018-01-02 19:48:24 +00:00
|
|
|
shell_fragment 10, 4, 9, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $3c
|
|
|
|
shell_fragment 11, 4, 9, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $04
|
|
|
|
shell_fragment 10, 4, 10, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $30
|
|
|
|
shell_fragment 11, 4, 10, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $10
|
|
|
|
shell_fragment 10, 4, 11, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_3, $24
|
|
|
|
shell_fragment 11, 4, 11, 0, SPRITE_ANIM_FRAMESET_EGG_HATCH_4, $1c
|
|
|
|
shell_fragment 10, 0, 9, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_1, $36
|
|
|
|
shell_fragment 12, 0, 9, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_2, $0a
|
|
|
|
shell_fragment 10, 0, 10, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_3, $2a
|
|
|
|
shell_fragment 12, 0, 10, 4, SPRITE_ANIM_FRAMESET_EGG_HATCH_4, $16
|
2015-11-28 20:13:40 +00:00
|
|
|
db -1
|
2015-11-10 21:53:37 +00:00
|
|
|
; 17418
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
Hatch_ShellFragmentLoop: ; 17418 (5:7418)
|
|
|
|
ld c, 129
|
|
|
|
.loop
|
2015-12-02 18:24:18 +00:00
|
|
|
call EggHatch_DoAnimFrame
|
2015-11-10 21:53:37 +00:00
|
|
|
dec c
|
2015-12-11 03:26:31 +00:00
|
|
|
jr nz, .loop
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
Special_DayCareMon1: ; 17421
|
2015-12-11 03:26:31 +00:00
|
|
|
ld hl, DayCareMon1Text
|
2015-11-10 21:53:37 +00:00
|
|
|
call PrintText
|
|
|
|
ld a, [wBreedMon1Species]
|
|
|
|
call PlayCry
|
2017-12-10 18:37:15 +00:00
|
|
|
ld a, [wDayCareLady]
|
2015-11-10 21:53:37 +00:00
|
|
|
bit 0, a
|
2015-12-11 03:26:31 +00:00
|
|
|
jr z, DayCareMonCursor
|
2015-11-30 03:29:45 +00:00
|
|
|
call ButtonSound
|
2015-11-10 21:53:37 +00:00
|
|
|
ld hl, wBreedMon2Nick
|
2015-12-11 03:26:31 +00:00
|
|
|
call DayCareMonCompatibilityText
|
2015-11-10 21:53:37 +00:00
|
|
|
jp PrintText
|
|
|
|
|
|
|
|
Special_DayCareMon2: ; 17440
|
2015-12-11 03:26:31 +00:00
|
|
|
ld hl, DayCareMon2Text
|
2015-11-10 21:53:37 +00:00
|
|
|
call PrintText
|
|
|
|
ld a, [wBreedMon2Species]
|
|
|
|
call PlayCry
|
2017-12-10 18:37:15 +00:00
|
|
|
ld a, [wDayCareMan]
|
2015-11-10 21:53:37 +00:00
|
|
|
bit 0, a
|
2015-12-11 03:26:31 +00:00
|
|
|
jr z, DayCareMonCursor
|
2015-11-30 03:29:45 +00:00
|
|
|
call ButtonSound
|
2015-11-10 21:53:37 +00:00
|
|
|
ld hl, wBreedMon1Nick
|
2015-12-11 03:26:31 +00:00
|
|
|
call DayCareMonCompatibilityText
|
2015-11-10 21:53:37 +00:00
|
|
|
jp PrintText
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
DayCareMonCursor: ; 1745f
|
2015-11-11 04:23:28 +00:00
|
|
|
jp WaitPressAorB_BlinkCursor
|
2015-11-10 21:53:37 +00:00
|
|
|
; 17462
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
DayCareMon2Text: ; 0x17462
|
2015-11-10 21:53:37 +00:00
|
|
|
; It's @ that was left with the DAY-CARE LADY.
|
|
|
|
text_jump UnknownText_0x1c0df3
|
|
|
|
db "@"
|
|
|
|
; 0x17467
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
DayCareMon1Text: ; 0x17467
|
2015-11-10 21:53:37 +00:00
|
|
|
; It's @ that was left with the DAY-CARE MAN.
|
|
|
|
text_jump UnknownText_0x1c0e24
|
|
|
|
db "@"
|
|
|
|
; 0x1746c
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
DayCareMonCompatibilityText: ; 1746c
|
2015-11-10 21:53:37 +00:00
|
|
|
push bc
|
|
|
|
ld de, StringBuffer1
|
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
2015-12-09 23:25:44 +00:00
|
|
|
call CheckBreedmonCompatibility
|
2015-11-10 21:53:37 +00:00
|
|
|
pop bc
|
|
|
|
ld a, [wd265]
|
2015-12-11 03:26:31 +00:00
|
|
|
ld hl, .AllAlone
|
|
|
|
cp -1
|
|
|
|
jr z, .done
|
|
|
|
ld hl, .Incompatible
|
2015-11-10 21:53:37 +00:00
|
|
|
and a
|
2015-12-11 03:26:31 +00:00
|
|
|
jr z, .done
|
|
|
|
ld hl, .HighCompatibility
|
2015-11-10 21:53:37 +00:00
|
|
|
cp 230
|
2015-12-11 03:26:31 +00:00
|
|
|
jr nc, .done
|
2015-11-10 21:53:37 +00:00
|
|
|
cp 70
|
2015-12-11 03:26:31 +00:00
|
|
|
ld hl, .ModerateCompatibility
|
|
|
|
jr nc, .done
|
|
|
|
ld hl, .SlightCompatibility
|
2015-11-10 21:53:37 +00:00
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.done
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
; 1749c
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.AllAlone: ; 0x1749c
|
2015-11-10 21:53:37 +00:00
|
|
|
; It's brimming with energy.
|
|
|
|
text_jump UnknownText_0x1c0e54
|
|
|
|
db "@"
|
|
|
|
; 0x174a1
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.Incompatible: ; 0x174a1
|
2015-11-10 21:53:37 +00:00
|
|
|
; It has no interest in @ .
|
|
|
|
text_jump UnknownText_0x1c0e6f
|
|
|
|
db "@"
|
|
|
|
; 0x174a6
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.HighCompatibility: ; 0x174a6
|
2015-11-10 21:53:37 +00:00
|
|
|
; It appears to care for @ .
|
|
|
|
text_jump UnknownText_0x1c0e8d
|
|
|
|
db "@"
|
|
|
|
; 0x174ab
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.ModerateCompatibility: ; 0x174ab
|
2015-11-10 21:53:37 +00:00
|
|
|
; It's friendly with @ .
|
|
|
|
text_jump UnknownText_0x1c0eac
|
|
|
|
db "@"
|
|
|
|
; 0x174b0
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
.SlightCompatibility: ; 0x174b0
|
2015-11-10 21:53:37 +00:00
|
|
|
; It shows interest in @ .
|
|
|
|
text_jump UnknownText_0x1c0ec6
|
|
|
|
db "@"
|
|
|
|
; 0x174b5
|
|
|
|
|
2015-12-11 03:26:31 +00:00
|
|
|
DayCareMonPrintEmptyString: ; 174b5
|
|
|
|
; unreferenced
|
|
|
|
ld hl, .string
|
2015-11-10 21:53:37 +00:00
|
|
|
ret
|
|
|
|
; 174b9
|
|
|
|
|
2016-04-10 19:01:49 +00:00
|
|
|
.string ; 174b9
|
2015-11-10 21:53:37 +00:00
|
|
|
db "@"
|
|
|
|
; 174ba
|
|
|
|
|