2018-01-31 08:38:45 -08:00
|
|
|
const_def 1
|
2018-01-11 09:00:01 -08:00
|
|
|
const PINK_PAGE ; 1
|
|
|
|
const GREEN_PAGE ; 2
|
|
|
|
const BLUE_PAGE ; 3
|
2018-02-02 19:55:38 -08:00
|
|
|
NUM_STAT_PAGES EQU const_value + -1
|
2018-01-11 09:00:01 -08:00
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
BattleStatsScreenInit: ; 4dc7b (13:5c7b)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wLinkMode]
|
|
|
|
cp LINK_MOBILE
|
2018-01-16 11:30:10 -08:00
|
|
|
jr nz, StatsScreenInit
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2017-12-09 21:18:29 -08:00
|
|
|
ld a, [wBattleMode]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2018-01-16 11:30:10 -08:00
|
|
|
jr z, StatsScreenInit
|
2016-05-08 11:11:24 -07:00
|
|
|
jr _MobileStatsScreenInit
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2018-01-16 11:30:10 -08:00
|
|
|
StatsScreenInit: ; 4dc8a
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, StatsScreenMain
|
|
|
|
jr StatsScreenInit_gotaddress
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
_MobileStatsScreenInit: ; 4dc8f
|
|
|
|
ld hl, StatsScreenMobile
|
2015-11-19 20:38:16 -08:00
|
|
|
jr StatsScreenInit_gotaddress
|
|
|
|
|
|
|
|
StatsScreenInit_gotaddress: ; 4dc94
|
|
|
|
ld a, [hMapAnims]
|
|
|
|
push af
|
|
|
|
xor a
|
|
|
|
ld [hMapAnims], a ; disable overworld tile animations
|
2015-12-19 11:48:30 -08:00
|
|
|
ld a, [wBoxAlignment] ; whether sprite is to be mirrorred
|
2015-11-19 20:38:16 -08:00
|
|
|
push af
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
ld b, a
|
|
|
|
ld a, [wcf64]
|
|
|
|
ld c, a
|
|
|
|
|
|
|
|
push bc
|
|
|
|
push hl
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearTileMap
|
|
|
|
call UpdateSprites
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall StatsScreen_LoadFont
|
2015-11-19 20:38:16 -08:00
|
|
|
pop hl
|
|
|
|
call _hl_
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearTileMap
|
|
|
|
pop bc
|
|
|
|
|
|
|
|
; restore old values
|
|
|
|
ld a, b
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ld a, c
|
|
|
|
ld [wcf64], a
|
|
|
|
pop af
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-11-19 20:38:16 -08:00
|
|
|
pop af
|
|
|
|
ld [hMapAnims], a
|
|
|
|
ret
|
|
|
|
; 0x4dcd2
|
|
|
|
|
|
|
|
StatsScreenMain: ; 0x4dcd2
|
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
; stupid interns
|
|
|
|
ld [wcf64], a
|
|
|
|
ld a, [wcf64]
|
2018-01-11 09:00:01 -08:00
|
|
|
and %11111100
|
|
|
|
or 1
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [wcf64], a
|
|
|
|
.loop ; 4dce3
|
|
|
|
ld a, [wJumptableIndex]
|
2018-01-11 09:00:01 -08:00
|
|
|
and $ff ^ (1 << 7)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, StatsScreenPointerTable
|
|
|
|
rst JumpTable
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_WaitAnim ; check for keys?
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .loop
|
|
|
|
ret
|
|
|
|
; 0x4dcf7
|
|
|
|
|
2016-05-08 11:11:24 -07:00
|
|
|
StatsScreenMobile: ; 4dcf7
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
; stupid interns
|
|
|
|
ld [wcf64], a
|
|
|
|
ld a, [wcf64]
|
2018-01-11 09:00:01 -08:00
|
|
|
and %11111100
|
|
|
|
or 1
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [wcf64], a
|
|
|
|
.loop
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall Mobile_SetOverworldDelay
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wJumptableIndex]
|
2018-01-11 09:00:01 -08:00
|
|
|
and $ff ^ (1 << 7)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, StatsScreenPointerTable
|
|
|
|
rst JumpTable
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_WaitAnim
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall MobileComms_CheckInactivityTimer
|
2015-11-19 20:38:16 -08:00
|
|
|
jr c, .exit
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
bit 7, a
|
|
|
|
jr z, .loop
|
|
|
|
|
|
|
|
.exit
|
|
|
|
ret
|
|
|
|
; 4dd2a
|
|
|
|
|
|
|
|
StatsScreenPointerTable: ; 4dd2a
|
2015-12-26 18:59:03 -08:00
|
|
|
dw MonStatsInit ; regular pokémon
|
|
|
|
dw EggStatsInit ; egg
|
|
|
|
dw StatsScreenWaitCry
|
|
|
|
dw EggStatsJoypad
|
|
|
|
dw StatsScreen_LoadPage
|
|
|
|
dw StatsScreenWaitCry
|
|
|
|
dw MonStatsJoypad
|
|
|
|
dw StatsScreen_Exit
|
2015-11-19 20:38:16 -08:00
|
|
|
; 4dd3a
|
|
|
|
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_WaitAnim: ; 4dd3a (13:5d3a)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
bit 6, [hl]
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .try_anim
|
2015-11-19 20:38:16 -08:00
|
|
|
bit 5, [hl]
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .finish
|
2015-11-19 20:38:16 -08:00
|
|
|
call DelayFrame
|
|
|
|
ret
|
2015-12-22 19:19:33 -08:00
|
|
|
|
|
|
|
.try_anim
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall SetUpPokeAnim
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nc, .finish
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
res 6, [hl]
|
2015-12-22 19:19:33 -08:00
|
|
|
.finish
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
res 5, [hl]
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferTileMapToWRAMBank3
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_SetJumptableIndex: ; 4dd62 (13:5d62)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
and $80
|
|
|
|
or h
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_Exit: ; 4dd6c (13:5d6c)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
MonStatsInit: ; 4dd72 (13:5d72)
|
|
|
|
ld hl, wcf64
|
|
|
|
res 6, [hl]
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearTileMap
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferTileMapToWRAMBank3
|
2015-12-23 06:12:29 -08:00
|
|
|
call StatsScreen_CopyToTempMon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp EGG
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .egg
|
|
|
|
call StatsScreen_InitUpperHalf
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
set 4, [hl]
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 4
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-22 19:19:33 -08:00
|
|
|
|
|
|
|
.egg
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 1
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
EggStatsInit: ; 4dda1
|
|
|
|
call EggStatsScreen
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
inc a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
; 0x4ddac
|
|
|
|
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
EggStatsJoypad: ; 4ddac (13:5dac)
|
|
|
|
call StatsScreen_GetJoypad
|
|
|
|
jr nc, .check
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 0
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-22 19:19:33 -08:00
|
|
|
|
|
|
|
.check
|
|
|
|
bit A_BUTTON_F, a
|
|
|
|
jr nz, .quit
|
|
|
|
and D_DOWN | D_UP | A_BUTTON | B_BUTTON
|
|
|
|
jp StatsScreen_JoypadAction
|
|
|
|
|
|
|
|
.quit
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 7
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_LoadPage: ; 4ddc6 (13:5dc6)
|
|
|
|
call StatsScreen_LoadGFX
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
res 4, [hl]
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
inc a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
MonStatsJoypad: ; 4ddd6 (13:5dd6)
|
|
|
|
call StatsScreen_GetJoypad
|
|
|
|
jr nc, .next
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 0
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.next
|
|
|
|
and D_DOWN | D_UP | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
|
|
|
|
jp StatsScreen_JoypadAction
|
2015-11-19 20:38:16 -08:00
|
|
|
|
|
|
|
StatsScreenWaitCry: ; 4dde6 (13:5de6)
|
|
|
|
call IsSFXPlaying
|
|
|
|
ret nc
|
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
inc a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
ret
|
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
StatsScreen_CopyToTempMon: ; 4ddf2 (13:5df2)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2016-05-11 14:16:03 -07:00
|
|
|
cp TEMPMON
|
2015-12-23 06:12:29 -08:00
|
|
|
jr nz, .breedmon
|
2018-02-12 14:58:19 -08:00
|
|
|
ld a, [wBufferMonSpecies]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2015-11-19 20:38:16 -08:00
|
|
|
call GetBaseData
|
2015-12-16 09:32:08 -08:00
|
|
|
ld hl, wBufferMon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wTempMon
|
2015-11-19 20:38:16 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
call CopyBytes
|
2015-12-23 06:12:29 -08:00
|
|
|
jr .done
|
|
|
|
|
|
|
|
.breedmon
|
2018-02-22 08:13:29 -08:00
|
|
|
farcall CopyMonToTempMon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp EGG
|
2015-12-23 06:12:29 -08:00
|
|
|
jr z, .done
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp BOXMON
|
2015-12-23 06:12:29 -08:00
|
|
|
jr c, .done
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CalcTempmonStats
|
2015-12-23 06:12:29 -08:00
|
|
|
.done
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_GetJoypad: ; 4de2c (13:5e2c)
|
2015-11-19 20:38:16 -08:00
|
|
|
call GetJoypad
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2016-05-11 14:16:03 -07:00
|
|
|
cp TEMPMON
|
2015-11-19 20:38:16 -08:00
|
|
|
jr nz, .notbreedmon
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall StatsScreenDPad
|
2015-11-19 20:38:16 -08:00
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuJoypad]
|
2015-12-22 19:19:33 -08:00
|
|
|
and D_DOWN | D_UP
|
2015-11-19 20:38:16 -08:00
|
|
|
jr nz, .set_carry
|
2015-12-15 15:59:49 -08:00
|
|
|
ld a, [wMenuJoypad]
|
2015-11-19 20:38:16 -08:00
|
|
|
jr .clear_flags
|
|
|
|
|
|
|
|
.notbreedmon
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
.clear_flags
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.set_carry
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_JoypadAction: ; 4de54 (13:5e54)
|
2015-11-19 20:38:16 -08:00
|
|
|
push af
|
|
|
|
ld a, [wcf64]
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_STAT_PAGES
|
2015-11-19 20:38:16 -08:00
|
|
|
ld c, a
|
|
|
|
pop af
|
2015-12-22 19:19:33 -08:00
|
|
|
bit B_BUTTON_F, a
|
|
|
|
jp nz, .b_button
|
|
|
|
bit D_LEFT_F, a
|
|
|
|
jr nz, .d_left
|
|
|
|
bit D_RIGHT_F, a
|
|
|
|
jr nz, .d_right
|
|
|
|
bit A_BUTTON_F, a
|
|
|
|
jr nz, .a_button
|
|
|
|
bit D_UP_F, a
|
|
|
|
jr nz, .d_up
|
|
|
|
bit D_DOWN_F, a
|
|
|
|
jr nz, .d_down
|
|
|
|
jr .done
|
2015-12-23 06:12:29 -08:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.d_down
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp BOXMON
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nc, .done
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wPartyCount]
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .next_mon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOTPartyCount]
|
2015-12-22 19:19:33 -08:00
|
|
|
.next_mon
|
2015-11-19 20:38:16 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-19 20:38:16 -08:00
|
|
|
inc a
|
|
|
|
cp b
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .done
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .load_mon
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, b
|
|
|
|
inc a
|
2015-12-23 06:12:29 -08:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .load_mon
|
2015-12-23 06:12:29 -08:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.d_up
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .done
|
2015-11-19 20:38:16 -08:00
|
|
|
dec a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurPartyMon], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .load_mon
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, b
|
|
|
|
inc a
|
2015-12-23 06:12:29 -08:00
|
|
|
ld [wPartyMenuCursor], a
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .load_mon
|
2015-12-23 06:12:29 -08:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.a_button
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, c
|
2018-01-11 09:00:01 -08:00
|
|
|
cp BLUE_PAGE ; last page
|
2015-12-22 19:19:33 -08:00
|
|
|
jr z, .b_button
|
|
|
|
.d_right
|
2015-11-19 20:38:16 -08:00
|
|
|
inc c
|
2018-01-11 09:00:01 -08:00
|
|
|
ld a, BLUE_PAGE ; last page
|
2015-11-19 20:38:16 -08:00
|
|
|
cp c
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nc, .set_page
|
2018-01-11 09:00:01 -08:00
|
|
|
ld c, PINK_PAGE ; first page
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .set_page
|
2015-12-23 06:12:29 -08:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.d_left
|
2015-11-19 20:38:16 -08:00
|
|
|
dec c
|
2015-12-22 19:19:33 -08:00
|
|
|
jr nz, .set_page
|
2018-01-11 09:00:01 -08:00
|
|
|
ld c, BLUE_PAGE ; last page
|
2015-12-22 19:19:33 -08:00
|
|
|
jr .set_page
|
2015-12-23 06:12:29 -08:00
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.done
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-22 19:19:33 -08:00
|
|
|
|
|
|
|
.set_page
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wcf64]
|
2015-12-22 19:19:33 -08:00
|
|
|
and %11111100
|
2015-11-19 20:38:16 -08:00
|
|
|
or c
|
|
|
|
ld [wcf64], a
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 4
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-22 19:19:33 -08:00
|
|
|
|
|
|
|
.load_mon
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 0
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 12:01:49 -07:00
|
|
|
.b_button ; 4dee4 (13:5ee4)
|
2015-12-26 18:59:03 -08:00
|
|
|
ld h, 7
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_SetJumptableIndex
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_InitUpperHalf: ; 4deea (13:5eea)
|
|
|
|
call .PlaceHPBar
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBaseDexNo]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [wd265], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 8, 0
|
|
|
|
ld [hl], "№"
|
|
|
|
inc hl
|
|
|
|
ld [hl], "."
|
|
|
|
inc hl
|
|
|
|
hlcoord 10, 0
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
|
|
|
|
ld de, wd265
|
|
|
|
call PrintNum
|
|
|
|
hlcoord 14, 0
|
|
|
|
call PrintLevel
|
2015-12-22 19:19:33 -08:00
|
|
|
ld hl, .NicknamePointers
|
|
|
|
call GetNicknamePointer
|
|
|
|
call CopyNickname
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 8, 2
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 18, 0
|
2015-12-22 19:19:33 -08:00
|
|
|
call .PlaceGenderChar
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 9, 4
|
|
|
|
ld a, "/"
|
|
|
|
ld [hli], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBaseDexNo]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [wd265], a
|
|
|
|
call GetPokemonName
|
|
|
|
call PlaceString
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_PlaceHorizontalDivider
|
|
|
|
call StatsScreen_PlacePageSwitchArrows
|
|
|
|
call StatsScreen_PlaceShinyIcon
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.PlaceHPBar: ; 4df45 (13:5f45)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wTempMonHP
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld b, a
|
|
|
|
ld c, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wTempMonMaxHP
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
|
|
|
ld e, [hl]
|
2018-01-16 11:30:10 -08:00
|
|
|
farcall ComputeHPBarPixels
|
2017-12-09 16:41:03 -08:00
|
|
|
ld hl, wCurHPPal
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetHPPal
|
2015-12-22 19:19:33 -08:00
|
|
|
ld b, SCGB_STATS_SCREEN_HP_PALS
|
2015-11-19 20:38:16 -08:00
|
|
|
call GetSGBLayout
|
|
|
|
call DelayFrame
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.PlaceGenderChar: ; 4df66 (13:5f66)
|
2015-11-19 20:38:16 -08:00
|
|
|
push hl
|
2018-01-16 11:30:10 -08:00
|
|
|
farcall GetGender
|
2015-11-19 20:38:16 -08:00
|
|
|
pop hl
|
|
|
|
ret c
|
|
|
|
ld a, "♂"
|
|
|
|
jr nz, .got_gender
|
|
|
|
ld a, "♀"
|
|
|
|
.got_gender
|
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
; 4df77 (13:5f77)
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.NicknamePointers: ; 4df77
|
2018-01-23 14:39:09 -08:00
|
|
|
dw wPartyMonNicknames
|
|
|
|
dw wOTPartyMonNicknames
|
2015-11-19 20:38:16 -08:00
|
|
|
dw sBoxMonNicknames
|
2015-12-22 19:19:33 -08:00
|
|
|
dw wBufferMonNick
|
2015-11-19 20:38:16 -08:00
|
|
|
; 4df7f
|
|
|
|
|
2018-01-02 07:04:21 -08:00
|
|
|
Unreferenced_Function4df7f: ; 4df7f
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 7, 0
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
ld d, SCREEN_HEIGHT
|
|
|
|
.loop
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $31 ; vertical divider
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [hl], a
|
|
|
|
add hl, bc
|
|
|
|
dec d
|
|
|
|
jr nz, .loop
|
|
|
|
ret
|
|
|
|
; 4df8f
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_PlaceHorizontalDivider: ; 4df8f (13:5f8f)
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 7
|
|
|
|
ld b, SCREEN_WIDTH
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $62 ; horizontal divider (empty HP/exp bar)
|
2015-11-19 20:38:16 -08:00
|
|
|
.loop
|
|
|
|
ld [hli], a
|
|
|
|
dec b
|
|
|
|
jr nz, .loop
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_PlacePageSwitchArrows: ; 4df9b (13:5f9b)
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 12, 6
|
|
|
|
ld [hl], "◀"
|
|
|
|
hlcoord 19, 6
|
|
|
|
ld [hl], "▶"
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_PlaceShinyIcon: ; 4dfa6 (13:5fa6)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wTempMonDVs
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CheckShininess
|
2015-11-19 20:38:16 -08:00
|
|
|
ret nc
|
|
|
|
hlcoord 19, 0
|
2018-01-18 23:30:19 -08:00
|
|
|
ld [hl], "⁂"
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
StatsScreen_LoadGFX: ; 4dfb6 (13:5fb6)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wBaseDexNo]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [wd265], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wCurSpecies], a
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2015-12-22 19:19:33 -08:00
|
|
|
call .ClearBox
|
|
|
|
call .PageTilemap
|
|
|
|
call .LoadPals
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
bit 4, [hl]
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .place_frontpic
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetPalettes
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.place_frontpic
|
|
|
|
call StatsScreen_PlaceFrontpic
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.ClearBox: ; 4dfda (13:5fda)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wcf64]
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_STAT_PAGES
|
2015-11-19 20:38:16 -08:00
|
|
|
ld c, a
|
2015-12-23 06:12:29 -08:00
|
|
|
call StatsScreen_LoadPageIndicators
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 8
|
|
|
|
lb bc, 10, 20
|
|
|
|
call ClearBox
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.LoadPals: ; 4dfed (13:5fed)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wcf64]
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_STAT_PAGES
|
2015-11-19 20:38:16 -08:00
|
|
|
ld c, a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall LoadStatsScreenPals
|
2015-11-19 20:38:16 -08:00
|
|
|
call DelayFrame
|
|
|
|
ld hl, wcf64
|
|
|
|
set 5, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
.PageTilemap: ; 4e002 (13:6002)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [wcf64]
|
2018-01-16 14:27:50 -08:00
|
|
|
maskbits NUM_STAT_PAGES
|
2015-11-19 20:38:16 -08:00
|
|
|
dec a
|
2015-12-21 11:10:16 -08:00
|
|
|
ld hl, .Jumptable
|
2015-11-19 20:38:16 -08:00
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Jumptable: ; 4e00d (13:600d)
|
2018-01-11 09:00:01 -08:00
|
|
|
; entries correspond to *_PAGE constants
|
2015-12-26 18:59:03 -08:00
|
|
|
dw .PinkPage
|
|
|
|
dw .GreenPage
|
|
|
|
dw .BluePage
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.PinkPage: ; 4e013 (13:6013)
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 9
|
|
|
|
ld b, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
predef DrawPlayerHP
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 8, 9
|
2018-01-11 19:16:17 -08:00
|
|
|
ld [hl], $41 ; right HP/exp bar end cap
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .Status_Type
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 12
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonPokerusStatus]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld b, a
|
|
|
|
and $f
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .HasPokerus
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, b
|
|
|
|
and $f0
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .NotImmuneToPkrs
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 8, 8
|
2018-01-11 19:16:17 -08:00
|
|
|
ld [hl], "." ; Pokérus immunity dot
|
2016-04-10 11:42:14 -07:00
|
|
|
.NotImmuneToPkrs:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-12-21 11:10:16 -08:00
|
|
|
cp BOXMON
|
|
|
|
jr z, .StatusOK
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 6, 13
|
|
|
|
push hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wTempMonStatus
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PlaceStatusString
|
2015-11-19 20:38:16 -08:00
|
|
|
pop hl
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .done_status
|
|
|
|
jr .StatusOK
|
2016-04-10 11:42:14 -07:00
|
|
|
.HasPokerus:
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .PkrsStr
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 1, 13
|
|
|
|
call PlaceString
|
2015-12-21 11:10:16 -08:00
|
|
|
jr .done_status
|
2016-04-10 11:42:14 -07:00
|
|
|
.StatusOK:
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .OK_str
|
2015-11-19 20:38:16 -08:00
|
|
|
call PlaceString
|
2015-12-21 11:10:16 -08:00
|
|
|
.done_status
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 1, 15
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PrintMonTypes
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 9, 8
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
ld b, 10
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $31 ; vertical divider
|
2015-12-21 11:10:16 -08:00
|
|
|
.vertical_divider
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec b
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .vertical_divider
|
|
|
|
ld de, .ExpPointStr
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 10, 9
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 17, 14
|
2015-12-21 11:10:16 -08:00
|
|
|
call .PrintNextLevel
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 13, 10
|
|
|
|
lb bc, 3, 7
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wTempMonExp
|
2015-11-19 20:38:16 -08:00
|
|
|
call PrintNum
|
2015-12-21 11:10:16 -08:00
|
|
|
call .CalcExpToNextLevel
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 13, 13
|
|
|
|
lb bc, 3, 7
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wBuffer1
|
2015-11-19 20:38:16 -08:00
|
|
|
call PrintNum
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .LevelUpStr
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 10, 12
|
|
|
|
call PlaceString
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .ToStr
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 14, 14
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 11, 16
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonLevel]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld b, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wTempMonExp + 2
|
2018-01-16 11:30:10 -08:00
|
|
|
predef FillInExpBar
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 10, 16
|
2018-01-11 19:16:17 -08:00
|
|
|
ld [hl], $40 ; left exp bar end cap
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 19, 16
|
2018-01-11 19:16:17 -08:00
|
|
|
ld [hl], $41 ; right exp bar end cap
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.PrintNextLevel: ; 4e0d3 (13:60d3)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonLevel]
|
2015-11-19 20:38:16 -08:00
|
|
|
push af
|
|
|
|
cp MAX_LEVEL
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .AtMaxLevel
|
2015-11-19 20:38:16 -08:00
|
|
|
inc a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonLevel], a
|
2016-04-10 11:42:14 -07:00
|
|
|
.AtMaxLevel:
|
2015-11-19 20:38:16 -08:00
|
|
|
call PrintLevel
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wTempMonLevel], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.CalcExpToNextLevel: ; 4e0e7 (13:60e7)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonLevel]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp MAX_LEVEL
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .AlreadyAtMaxLevel
|
2015-11-19 20:38:16 -08:00
|
|
|
inc a
|
|
|
|
ld d, a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CalcExpAtLevel
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wTempMonExp + 2
|
|
|
|
ld hl, wTempMonExp + 2
|
2015-12-21 11:10:16 -08:00
|
|
|
ld a, [hQuotient + 2]
|
2015-11-19 20:38:16 -08:00
|
|
|
sub [hl]
|
|
|
|
dec hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBuffer3], a
|
2015-12-21 11:10:16 -08:00
|
|
|
ld a, [hQuotient + 1]
|
2015-11-19 20:38:16 -08:00
|
|
|
sbc [hl]
|
|
|
|
dec hl
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBuffer2], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, [hQuotient]
|
|
|
|
sbc [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBuffer1], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
.AlreadyAtMaxLevel:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wBuffer1
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ld [hli], a
|
2016-05-04 08:46:23 -07:00
|
|
|
ld [hli], a
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [hl], a
|
|
|
|
ret
|
|
|
|
; 4e119 (13:6119)
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Status_Type: ; 4e119
|
2015-11-19 20:38:16 -08:00
|
|
|
db "STATUS/"
|
|
|
|
next "TYPE/@"
|
|
|
|
; 4e127
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.OK_str: ; 4e127
|
2015-11-19 20:38:16 -08:00
|
|
|
db "OK @"
|
|
|
|
; 4e12b
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.ExpPointStr: ; 4e12b
|
2015-11-19 20:38:16 -08:00
|
|
|
db "EXP POINTS@"
|
|
|
|
; 4e136
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.LevelUpStr: ; 4e136
|
2015-11-19 20:38:16 -08:00
|
|
|
db "LEVEL UP@"
|
|
|
|
; 4e13f
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.ToStr: ; 4e13f
|
2015-11-19 20:38:16 -08:00
|
|
|
db "TO@"
|
|
|
|
; 4e142
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.PkrsStr: ; 4e142
|
2015-11-19 20:38:16 -08:00
|
|
|
db "#RUS@"
|
|
|
|
; 4e147
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.GreenPage: ; 4e147 (13:6147)
|
|
|
|
ld de, .Item
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 8
|
|
|
|
call PlaceString
|
2015-12-21 11:10:16 -08:00
|
|
|
call .GetItemName
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 8, 8
|
|
|
|
call PlaceString
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, .Move
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 10
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wTempMonMoves
|
2015-11-19 20:38:16 -08:00
|
|
|
ld de, wListMoves_MoveIndicesBuffer
|
|
|
|
ld bc, NUM_MOVES
|
|
|
|
call CopyBytes
|
|
|
|
hlcoord 8, 10
|
|
|
|
ld a, SCREEN_WIDTH * 2
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBuffer1], a
|
2018-01-16 11:30:10 -08:00
|
|
|
predef ListMoves
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 12, 11
|
2015-12-21 11:10:16 -08:00
|
|
|
ld a, SCREEN_WIDTH * 2
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBuffer1], a
|
2018-01-16 11:30:10 -08:00
|
|
|
predef ListMovePP
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.GetItemName: ; 4e189 (13:6189)
|
|
|
|
ld de, .ThreeDashes
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonItem]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld b, a
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall TimeCapsule_ReplaceTeruSama
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, b
|
|
|
|
ld [wd265], a
|
|
|
|
call GetItemName
|
|
|
|
ret
|
|
|
|
; 4e1a0 (13:61a0)
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Item: ; 4e1a0
|
2015-11-19 20:38:16 -08:00
|
|
|
db "ITEM@"
|
|
|
|
; 4e1a5
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.ThreeDashes: ; 4e1a5
|
2015-11-19 20:38:16 -08:00
|
|
|
db "---@"
|
|
|
|
; 4e1a9
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Move: ; 4e1a9
|
2015-11-19 20:38:16 -08:00
|
|
|
db "MOVE@"
|
|
|
|
; 4e1ae
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.BluePage: ; 4e1ae (13:61ae)
|
|
|
|
call .PlaceOTInfo
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 10, 8
|
2015-12-21 11:10:16 -08:00
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
ld b, 10
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $31 ; vertical divider
|
2016-04-10 11:42:14 -07:00
|
|
|
.BluePageVerticalDivider:
|
2015-11-19 20:38:16 -08:00
|
|
|
ld [hl], a
|
|
|
|
add hl, de
|
|
|
|
dec b
|
2015-12-21 11:10:16 -08:00
|
|
|
jr nz, .BluePageVerticalDivider
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 11, 8
|
2015-12-21 11:10:16 -08:00
|
|
|
ld bc, 6
|
2018-01-16 11:30:10 -08:00
|
|
|
predef PrintTempMonStats
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.PlaceOTInfo: ; 4e1cc (13:61cc)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld de, IDNoString
|
|
|
|
hlcoord 0, 9
|
|
|
|
call PlaceString
|
|
|
|
ld de, OTString
|
|
|
|
hlcoord 0, 12
|
|
|
|
call PlaceString
|
|
|
|
hlcoord 2, 10
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wTempMonID
|
2015-11-19 20:38:16 -08:00
|
|
|
call PrintNum
|
2015-12-21 11:10:16 -08:00
|
|
|
ld hl, .OTNamePointers
|
2015-12-22 19:19:33 -08:00
|
|
|
call GetNicknamePointer
|
|
|
|
call CopyNickname
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall CheckNickErrors
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 2, 13
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonCaughtGender]
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .done
|
2015-11-19 20:38:16 -08:00
|
|
|
cp $7f
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .done
|
2015-11-19 20:38:16 -08:00
|
|
|
and $80
|
|
|
|
ld a, "♂"
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .got_gender
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, "♀"
|
2015-12-21 11:10:16 -08:00
|
|
|
.got_gender
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 9, 13
|
|
|
|
ld [hl], a
|
2015-12-21 11:10:16 -08:00
|
|
|
.done
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
; 4e216 (13:6216)
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.OTNamePointers: ; 4e216
|
2018-01-23 14:39:09 -08:00
|
|
|
dw wPartyMonOT
|
|
|
|
dw wOTPartyMonOT
|
2015-11-19 20:38:16 -08:00
|
|
|
dw sBoxMonOT
|
2015-12-21 11:10:16 -08:00
|
|
|
dw wBufferMonOT
|
2015-11-19 20:38:16 -08:00
|
|
|
; 4e21e
|
|
|
|
|
|
|
|
IDNoString: ; 4e21e
|
2015-12-21 11:10:16 -08:00
|
|
|
db "<ID>№.@"
|
2015-11-19 20:38:16 -08:00
|
|
|
|
|
|
|
OTString: ; 4e222
|
|
|
|
db "OT/@"
|
|
|
|
; 4e226
|
|
|
|
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
StatsScreen_PlaceFrontpic: ; 4e226 (13:6226)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wTempMonDVs
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetUnownLetter
|
2015-12-21 11:10:16 -08:00
|
|
|
call StatsScreen_GetAnimationParam
|
|
|
|
jr c, .egg
|
2015-11-19 20:38:16 -08:00
|
|
|
and a
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .no_cry
|
|
|
|
jr .cry
|
|
|
|
|
|
|
|
.egg
|
2015-12-23 06:12:29 -08:00
|
|
|
call .AnimateEgg
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetPalettes
|
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
|
|
|
.no_cry
|
2015-12-23 06:12:29 -08:00
|
|
|
call .AnimateMon
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetPalettes
|
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
|
|
|
.cry
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetPalettes
|
2015-12-23 06:12:29 -08:00
|
|
|
call .AnimateMon
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2018-01-16 20:47:45 -08:00
|
|
|
call PlayMonCry2
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
.AnimateMon: ; 4e253 (13:6253)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
set 5, [hl]
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp UNOWN
|
2015-12-21 11:10:16 -08:00
|
|
|
jr z, .unown
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
call PrepMonFrontpic
|
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
|
|
|
.unown
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
call _PrepMonFrontpic
|
|
|
|
ret
|
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
.AnimateEgg: ; 4e271 (13:6271)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp UNOWN
|
2015-12-23 06:12:29 -08:00
|
|
|
jr z, .unownegg
|
|
|
|
ld a, TRUE
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-12-23 06:12:29 -08:00
|
|
|
call .get_animation
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
.unownegg
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-12-23 06:12:29 -08:00
|
|
|
call .get_animation
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
|
|
|
|
2016-04-10 12:01:49 -07:00
|
|
|
.get_animation ; 4e289 (13:6289)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
call IsAPokemon
|
|
|
|
ret c
|
2015-12-23 06:12:29 -08:00
|
|
|
call StatsScreen_LoadTextBoxSpaceGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $00
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetAnimatedFrontpic
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld d, $0
|
2017-11-02 17:09:27 -07:00
|
|
|
ld e, ANIM_MON_MENU
|
2018-01-16 11:30:10 -08:00
|
|
|
predef LoadMonAnimation
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
StatsScreen_GetAnimationParam: ; 4e2ad (13:62ad)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, .Jumptable
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
|
|
|
.Jumptable: ; 4e2b5 (13:62b5)
|
2015-12-21 11:10:16 -08:00
|
|
|
dw .PartyMon
|
|
|
|
dw .OTPartyMon
|
|
|
|
dw .BoxMon
|
|
|
|
dw .Tempmon
|
|
|
|
dw .Wildmon
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.PartyMon: ; 4e2bf (13:62bf)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
|
|
|
ld hl, wPartyMon1
|
2015-11-19 20:38:16 -08:00
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
|
|
|
call AddNTimes
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
2015-12-21 11:10:16 -08:00
|
|
|
jr .CheckEggFaintedFrzSlp
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.OTPartyMon: ; 4e2cf (13:62cf)
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.BoxMon: ; 4e2d1 (13:62d1)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, sBoxMons
|
|
|
|
ld bc, PARTYMON_STRUCT_LENGTH
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-19 20:38:16 -08:00
|
|
|
call AddNTimes
|
|
|
|
ld b, h
|
|
|
|
ld c, l
|
|
|
|
ld a, BANK(sBoxMons)
|
|
|
|
call GetSRAMBank
|
2015-12-21 11:10:16 -08:00
|
|
|
call .CheckEggFaintedFrzSlp
|
2015-11-19 20:38:16 -08:00
|
|
|
push af
|
|
|
|
call CloseSRAM
|
|
|
|
pop af
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Tempmon: ; 4e2ed (13:62ed)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld bc, wTempMonSpecies
|
2015-12-21 11:10:16 -08:00
|
|
|
jr .CheckEggFaintedFrzSlp ; utterly pointless
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.CheckEggFaintedFrzSlp: ; 4e2f2 (13:62f2)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartySpecies]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp EGG
|
|
|
|
jr z, .egg
|
|
|
|
call CheckFaintedFrzSlp
|
2015-12-21 11:10:16 -08:00
|
|
|
jr c, .FaintedFrzSlp
|
2015-11-19 20:38:16 -08:00
|
|
|
.egg
|
|
|
|
xor a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
.Wildmon: ; 4e301 (13:6301)
|
2015-11-19 20:38:16 -08:00
|
|
|
ld a, $1
|
|
|
|
and a
|
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
|
|
|
.FaintedFrzSlp: ; 4e305 (13:6305)
|
2015-11-19 20:38:16 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
StatsScreen_LoadTextBoxSpaceGFX: ; 4e307 (13:6307)
|
2015-11-19 20:38:16 -08:00
|
|
|
nop
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
push af
|
|
|
|
call DelayFrame
|
|
|
|
ld a, [rVBK]
|
|
|
|
push af
|
|
|
|
ld a, $1
|
|
|
|
ld [rVBK], a
|
|
|
|
ld de, TextBoxSpaceGFX
|
|
|
|
lb bc, BANK(TextBoxSpaceGFX), 1
|
2018-01-13 12:22:16 -08:00
|
|
|
ld hl, vTiles2 tile " "
|
2015-11-19 20:38:16 -08:00
|
|
|
call Get2bpp
|
|
|
|
pop af
|
|
|
|
ld [rVBK], a
|
|
|
|
pop af
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 4e32a (13:632a)
|
|
|
|
|
2018-01-02 07:04:21 -08:00
|
|
|
Unreferenced_4e32a: ; 4e32a
|
2018-01-14 19:56:36 -08:00
|
|
|
; A blank space tile?
|
2015-11-19 20:38:16 -08:00
|
|
|
ds 16
|
|
|
|
; 4e33a
|
|
|
|
|
|
|
|
EggStatsScreen: ; 4e33a
|
|
|
|
xor a
|
|
|
|
ld [hBGMapMode], a
|
2017-12-09 16:41:03 -08:00
|
|
|
ld hl, wCurHPPal
|
2015-11-19 20:38:16 -08:00
|
|
|
call SetHPPal
|
2015-12-22 19:19:33 -08:00
|
|
|
ld b, SCGB_STATS_SCREEN_HP_PALS
|
2015-11-19 20:38:16 -08:00
|
|
|
call GetSGBLayout
|
2015-12-22 19:19:33 -08:00
|
|
|
call StatsScreen_PlaceHorizontalDivider
|
2015-11-19 20:38:16 -08:00
|
|
|
ld de, EggString
|
|
|
|
hlcoord 8, 1
|
|
|
|
call PlaceString
|
|
|
|
ld de, IDNoString
|
|
|
|
hlcoord 8, 3
|
|
|
|
call PlaceString
|
|
|
|
ld de, OTString
|
|
|
|
hlcoord 8, 5
|
|
|
|
call PlaceString
|
|
|
|
ld de, FiveQMarkString
|
|
|
|
hlcoord 11, 3
|
|
|
|
call PlaceString
|
|
|
|
ld de, FiveQMarkString
|
|
|
|
hlcoord 11, 5
|
|
|
|
call PlaceString
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonHappiness] ; egg status
|
2015-11-19 20:38:16 -08:00
|
|
|
ld de, EggSoonString
|
|
|
|
cp $6
|
|
|
|
jr c, .picked
|
|
|
|
ld de, EggCloseString
|
|
|
|
cp $b
|
|
|
|
jr c, .picked
|
|
|
|
ld de, EggMoreTimeString
|
|
|
|
cp $29
|
|
|
|
jr c, .picked
|
|
|
|
ld de, EggALotMoreTimeString
|
|
|
|
.picked
|
|
|
|
hlcoord 1, 9
|
|
|
|
call PlaceString
|
|
|
|
ld hl, wcf64
|
|
|
|
set 5, [hl]
|
|
|
|
call SetPalettes ; pals
|
|
|
|
call DelayFrame
|
|
|
|
hlcoord 0, 0
|
|
|
|
call PrepMonFrontpic
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall HDMATransferTileMapToWRAMBank3
|
2015-12-21 11:10:16 -08:00
|
|
|
call StatsScreen_AnimateEgg
|
2015-11-19 20:38:16 -08:00
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonHappiness]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp 6
|
|
|
|
ret nc
|
|
|
|
ld de, SFX_2_BOOPS
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
|
|
|
; 0x4e3c0
|
|
|
|
|
|
|
|
EggString: ; 4e3c0
|
|
|
|
db "EGG@"
|
|
|
|
|
|
|
|
FiveQMarkString: ; 4e3c4
|
|
|
|
db "?????@"
|
|
|
|
|
|
|
|
EggSoonString: ; 0x4e3ca
|
|
|
|
db "It's making sounds"
|
|
|
|
next "inside. It's going"
|
|
|
|
next "to hatch soon!@"
|
|
|
|
|
|
|
|
EggCloseString: ; 0x4e3fd
|
|
|
|
db "It moves around"
|
|
|
|
next "inside sometimes."
|
|
|
|
next "It must be close"
|
|
|
|
next "to hatching.@"
|
|
|
|
|
|
|
|
EggMoreTimeString: ; 0x4e43d
|
|
|
|
db "Wonder what's"
|
|
|
|
next "inside? It needs"
|
|
|
|
next "more time, though.@"
|
|
|
|
|
|
|
|
EggALotMoreTimeString: ; 0x4e46e
|
|
|
|
db "This EGG needs a"
|
|
|
|
next "lot more time to"
|
|
|
|
next "hatch.@"
|
|
|
|
; 0x4e497
|
|
|
|
|
|
|
|
|
2015-12-21 11:10:16 -08:00
|
|
|
StatsScreen_AnimateEgg: ; 4e497 (13:6497)
|
|
|
|
call StatsScreen_GetAnimationParam
|
2015-11-19 20:38:16 -08:00
|
|
|
ret nc
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wTempMonHappiness]
|
2015-11-19 20:38:16 -08:00
|
|
|
ld e, $7
|
2015-12-21 11:10:16 -08:00
|
|
|
cp 6
|
|
|
|
jr c, .animate
|
2015-11-19 20:38:16 -08:00
|
|
|
ld e, $8
|
2015-12-21 11:10:16 -08:00
|
|
|
cp 11
|
|
|
|
jr c, .animate
|
2015-11-19 20:38:16 -08:00
|
|
|
ret
|
2015-12-21 11:10:16 -08:00
|
|
|
|
|
|
|
.animate
|
2015-11-19 20:38:16 -08:00
|
|
|
push de
|
|
|
|
ld a, $1
|
2015-12-19 11:48:30 -08:00
|
|
|
ld [wBoxAlignment], a
|
2015-12-23 06:12:29 -08:00
|
|
|
call StatsScreen_LoadTextBoxSpaceGFX
|
2017-12-28 04:32:33 -08:00
|
|
|
ld de, vTiles2 tile $00
|
2018-01-16 11:30:10 -08:00
|
|
|
predef GetAnimatedFrontpic
|
2015-11-19 20:38:16 -08:00
|
|
|
pop de
|
|
|
|
hlcoord 0, 0
|
|
|
|
ld d, $0
|
2018-01-16 11:30:10 -08:00
|
|
|
predef LoadMonAnimation
|
2015-11-19 20:38:16 -08:00
|
|
|
ld hl, wcf64
|
|
|
|
set 6, [hl]
|
|
|
|
ret
|
|
|
|
|
2015-12-23 06:12:29 -08:00
|
|
|
StatsScreen_LoadPageIndicators: ; 4e4cd (13:64cd)
|
2015-11-19 20:38:16 -08:00
|
|
|
hlcoord 13, 5
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $36 ; first of 4 small square tiles
|
2015-11-19 20:38:16 -08:00
|
|
|
call .load_square
|
|
|
|
hlcoord 15, 5
|
2018-01-18 18:15:59 -08:00
|
|
|
ld a, $36 ; " " " "
|
2015-11-19 20:38:16 -08:00
|
|
|
call .load_square
|
|
|
|
hlcoord 17, 5
|
2018-01-18 18:15:59 -08:00
|
|
|
ld a, $36 ; " " " "
|
2015-11-19 20:38:16 -08:00
|
|
|
call .load_square
|
|
|
|
ld a, c
|
2018-01-11 09:00:01 -08:00
|
|
|
cp GREEN_PAGE
|
2018-01-11 19:16:17 -08:00
|
|
|
ld a, $3a ; first of 4 large square tiles
|
2018-01-11 09:00:01 -08:00
|
|
|
hlcoord 13, 5 ; PINK_PAGE (< GREEN_PAGE)
|
2015-11-19 20:38:16 -08:00
|
|
|
jr c, .load_square
|
2018-01-11 09:00:01 -08:00
|
|
|
hlcoord 15, 5 ; GREEN_PAGE (= GREEN_PAGE)
|
2015-11-19 20:38:16 -08:00
|
|
|
jr z, .load_square
|
2018-01-11 09:00:01 -08:00
|
|
|
hlcoord 17, 5 ; BLUE_PAGE (> GREEN_PAGE)
|
2016-04-10 12:01:49 -07:00
|
|
|
.load_square ; 4e4f7 (13:64f7)
|
2015-11-19 20:38:16 -08:00
|
|
|
push bc
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hld], a
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
inc a
|
|
|
|
ld [hli], a
|
|
|
|
inc a
|
|
|
|
ld [hl], a
|
|
|
|
pop bc
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
CopyNickname: ; 4e505 (13:6505)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld de, wStringBuffer1
|
2018-01-20 09:25:55 -08:00
|
|
|
ld bc, MON_NAME_LENGTH
|
2018-01-11 19:16:17 -08:00
|
|
|
jr .okay ; utterly pointless
|
2015-11-19 20:38:16 -08:00
|
|
|
.okay
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
cp BOXMON
|
|
|
|
jr nz, .partymon
|
|
|
|
ld a, BANK(sBoxMonNicknames)
|
|
|
|
call GetSRAMBank
|
|
|
|
push de
|
|
|
|
call CopyBytes
|
|
|
|
pop de
|
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
|
|
|
|
.partymon
|
|
|
|
push de
|
|
|
|
call CopyBytes
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2015-12-22 19:19:33 -08:00
|
|
|
GetNicknamePointer: ; 4e528 (13:6528)
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2015-11-19 20:38:16 -08:00
|
|
|
add a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wMonType]
|
2016-05-11 14:16:03 -07:00
|
|
|
cp TEMPMON
|
2015-11-19 20:38:16 -08:00
|
|
|
ret z
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wCurPartyMon]
|
2015-11-19 20:38:16 -08:00
|
|
|
jp SkipNames
|
|
|
|
|
|
|
|
|
|
|
|
CheckFaintedFrzSlp: ; 4e53f
|
|
|
|
ld hl, MON_HP
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
|
|
|
jr z, .fainted_frz_slp
|
|
|
|
ld hl, MON_STATUS
|
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2018-01-09 14:20:47 -08:00
|
|
|
and 1 << FRZ | SLP
|
2015-11-19 20:38:16 -08:00
|
|
|
jr nz, .fainted_frz_slp
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.fainted_frz_slp
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 4e554
|