pokecrystal-board/engine/pokemon/stats_screen.asm

1142 lines
17 KiB
NASM
Raw Normal View History

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
NUM_STAT_PAGES EQU const_value + -1
2018-01-11 09:00:01 -08:00
2018-06-24 07:09:41 -07:00
BattleStatsScreenInit:
2015-11-19 20:38:16 -08:00
ld a, [wLinkMode]
cp LINK_MOBILE
jr nz, StatsScreenInit
2015-11-19 20:38:16 -08:00
ld a, [wBattleMode]
2015-11-19 20:38:16 -08:00
and a
jr z, StatsScreenInit
jr _MobileStatsScreenInit
2015-11-19 20:38:16 -08:00
2018-06-24 07:09:41 -07:00
StatsScreenInit:
2015-11-19 20:38:16 -08:00
ld hl, StatsScreenMain
jr StatsScreenInit_gotaddress
2018-06-24 07:09:41 -07:00
_MobileStatsScreenInit:
ld hl, StatsScreenMobile
2015-11-19 20:38:16 -08:00
jr StatsScreenInit_gotaddress
2018-06-24 07:09:41 -07:00
StatsScreenInit_gotaddress:
ldh a, [hMapAnims]
2015-11-19 20:38:16 -08:00
push af
xor a
ldh [hMapAnims], a ; disable overworld tile animations
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
ld [wBoxAlignment], a
2015-11-19 20:38:16 -08:00
pop af
ldh [hMapAnims], a
2015-11-19 20:38:16 -08:00
ret
StatsScreenMain:
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
2018-06-24 07:09:41 -07:00
.loop
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 ; check for keys?
2015-11-19 20:38:16 -08:00
ld a, [wJumptableIndex]
bit 7, a
jr z, .loop
ret
2018-06-24 07:09:41 -07:00
StatsScreenMobile:
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
2018-06-24 07:09:41 -07:00
StatsScreenPointerTable:
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
2018-06-24 07:09:41 -07:00
StatsScreen_WaitAnim:
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
2018-06-24 07:09:41 -07:00
StatsScreen_SetJumptableIndex:
2015-11-19 20:38:16 -08:00
ld a, [wJumptableIndex]
and $80
or h
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
StatsScreen_Exit:
2015-11-19 20:38:16 -08:00
ld hl, wJumptableIndex
set 7, [hl]
ret
2018-06-24 07:09:41 -07:00
MonStatsInit:
2015-11-19 20:38:16 -08:00
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
2018-06-24 07:09:41 -07:00
EggStatsInit:
2015-11-19 20:38:16 -08:00
call EggStatsScreen
ld a, [wJumptableIndex]
inc a
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
EggStatsJoypad:
2015-12-22 19:19:33 -08:00
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
2018-06-24 07:09:41 -07:00
StatsScreen_LoadPage:
2015-12-22 19:19:33 -08:00
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
2018-06-24 07:09:41 -07:00
MonStatsJoypad:
2015-12-22 19:19:33 -08:00
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
2018-06-24 07:09:41 -07:00
StatsScreenWaitCry:
2015-11-19 20:38:16 -08:00
call IsSFXPlaying
ret nc
ld a, [wJumptableIndex]
inc a
ld [wJumptableIndex], a
ret
2018-06-24 07:09:41 -07:00
StatsScreen_CopyToTempMon:
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
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
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
2018-06-24 07:09:41 -07:00
StatsScreen_GetJoypad:
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
ldh a, [hJoyPressed]
2015-11-19 20:38:16 -08:00
.clear_flags
and a
ret
.set_carry
scf
ret
2018-06-24 07:09:41 -07:00
StatsScreen_JoypadAction:
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
2018-06-24 07:09:41 -07:00
.b_button
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
2018-06-24 07:09:41 -07:00
StatsScreen_InitUpperHalf:
2015-12-22 19:19:33 -08:00
call .PlaceHPBar
2015-11-19 20:38:16 -08:00
xor a
ldh [hBGMapMode], a
2018-01-23 14:39:09 -08:00
ld a, [wBaseDexNo]
ld [wDeciramBuffer], 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, wDeciramBuffer
2015-11-19 20:38:16 -08:00
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]
ld [wNamedObjectIndexBuffer], a
2015-11-19 20:38:16 -08:00
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
2018-06-24 07:09:41 -07:00
.PlaceHPBar:
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]
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
2018-06-24 07:09:41 -07:00
.PlaceGenderChar:
2015-11-19 20:38:16 -08:00
push hl
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
2018-06-24 07:09:41 -07:00
.NicknamePointers:
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
2018-06-24 07:09:41 -07:00
Unreferenced_Function4df7f:
2015-11-19 20:38:16 -08:00
hlcoord 7, 0
ld bc, SCREEN_WIDTH
ld d, SCREEN_HEIGHT
.loop
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
2018-06-24 07:09:41 -07:00
StatsScreen_PlaceHorizontalDivider:
2015-11-19 20:38:16 -08:00
hlcoord 0, 7
ld b, SCREEN_WIDTH
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
2018-06-24 07:09:41 -07:00
StatsScreen_PlacePageSwitchArrows:
2015-11-19 20:38:16 -08:00
hlcoord 12, 6
ld [hl], "◀"
hlcoord 19, 6
ld [hl], "▶"
ret
2018-06-24 07:09:41 -07:00
StatsScreen_PlaceShinyIcon:
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
2018-06-24 07:09:41 -07:00
StatsScreen_LoadGFX:
2018-01-23 14:39:09 -08:00
ld a, [wBaseDexNo]
ld [wTempSpecies], a
2018-01-23 14:39:09 -08:00
ld [wCurSpecies], a
2015-11-19 20:38:16 -08:00
xor a
ldh [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
2018-06-24 07:09:41 -07:00
.ClearBox:
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
2018-06-24 07:09:41 -07:00
.LoadPals:
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
2018-06-24 07:09:41 -07:00
.PageTilemap:
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
2018-06-24 07:09:41 -07:00
.Jumptable:
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
2018-06-24 07:09:41 -07:00
.PinkPage:
2015-11-19 20:38:16 -08:00
hlcoord 0, 9
ld b, $0
predef DrawPlayerHP
2015-11-19 20:38:16 -08:00
hlcoord 8, 9
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
ld [hl], "." ; Pokérus immunity dot
.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
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
.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
.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
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
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
predef FillInExpBar
2015-11-19 20:38:16 -08:00
hlcoord 10, 16
ld [hl], $40 ; left exp bar end cap
2015-11-19 20:38:16 -08:00
hlcoord 19, 16
ld [hl], $41 ; right exp bar end cap
2015-11-19 20:38:16 -08:00
ret
2018-06-24 07:09:41 -07:00
.PrintNextLevel:
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
.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
2018-06-24 07:09:41 -07:00
.CalcExpToNextLevel:
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
ldh a, [hQuotient + 3]
2015-11-19 20:38:16 -08:00
sub [hl]
dec hl
2018-01-23 14:39:09 -08:00
ld [wBuffer3], a
ldh a, [hQuotient + 2]
2015-11-19 20:38:16 -08:00
sbc [hl]
dec hl
2018-01-23 14:39:09 -08:00
ld [wBuffer2], a
ldh a, [hQuotient + 1]
2015-11-19 20:38:16 -08:00
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
.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
ld [hli], a
2015-11-19 20:38:16 -08:00
ld [hl], a
ret
2018-06-24 07:09:41 -07:00
.Status_Type:
2015-11-19 20:38:16 -08:00
db "STATUS/"
next "TYPE/@"
2018-06-24 07:09:41 -07:00
.OK_str:
2015-11-19 20:38:16 -08:00
db "OK @"
2018-06-24 07:09:41 -07:00
.ExpPointStr:
2015-11-19 20:38:16 -08:00
db "EXP POINTS@"
2018-06-24 07:09:41 -07:00
.LevelUpStr:
2015-11-19 20:38:16 -08:00
db "LEVEL UP@"
2018-06-24 07:09:41 -07:00
.ToStr:
2015-11-19 20:38:16 -08:00
db "TO@"
2018-06-24 07:09:41 -07:00
.PkrsStr:
2015-11-19 20:38:16 -08:00
db "#RUS@"
2018-06-24 07:09:41 -07:00
.GreenPage:
2015-12-21 11:10:16 -08:00
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
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
predef ListMovePP
2015-11-19 20:38:16 -08:00
ret
2018-06-24 07:09:41 -07:00
.GetItemName:
2015-12-21 11:10:16 -08:00
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 [wNamedObjectIndexBuffer], a
2015-11-19 20:38:16 -08:00
call GetItemName
ret
2018-06-24 07:09:41 -07:00
.Item:
2015-11-19 20:38:16 -08:00
db "ITEM@"
2018-06-24 07:09:41 -07:00
.ThreeDashes:
2015-11-19 20:38:16 -08:00
db "---@"
2018-06-24 07:09:41 -07:00
.Move:
2015-11-19 20:38:16 -08:00
db "MOVE@"
2018-06-24 07:09:41 -07:00
.BluePage:
2015-12-21 11:10:16 -08:00
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
ld a, $31 ; vertical divider
.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
predef PrintTempMonStats
2015-11-19 20:38:16 -08:00
ret
2018-06-24 07:09:41 -07:00
.PlaceOTInfo:
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
farcall CorrectNickErrors
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
2018-06-24 07:09:41 -07:00
.OTNamePointers:
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
2018-06-24 07:09:41 -07:00
IDNoString:
2015-12-21 11:10:16 -08:00
db "<ID>№.@"
2015-11-19 20:38:16 -08:00
2018-06-24 07:09:41 -07:00
OTString:
2015-11-19 20:38:16 -08:00
db "OT/@"
2018-06-24 07:09:41 -07:00
StatsScreen_PlaceFrontpic:
2018-01-23 14:39:09 -08:00
ld hl, wTempMonDVs
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]
call PlayMonCry2
2015-11-19 20:38:16 -08:00
ret
2018-06-24 07:09:41 -07:00
.AnimateMon:
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
ld [wBoxAlignment], a
2015-11-19 20:38:16 -08:00
hlcoord 0, 0
call _PrepMonFrontpic
ret
2018-06-24 07:09:41 -07:00
.AnimateEgg:
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
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
ld [wBoxAlignment], a
2015-12-23 06:12:29 -08:00
call .get_animation
2015-11-19 20:38:16 -08:00
ret
2018-06-24 07:09:41 -07:00
.get_animation
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
predef GetAnimatedFrontpic
2015-11-19 20:38:16 -08:00
hlcoord 0, 0
ld d, $0
ld e, ANIM_MON_MENU
predef LoadMonAnimation
2015-11-19 20:38:16 -08:00
ld hl, wcf64
set 6, [hl]
ret
2018-06-24 07:09:41 -07:00
StatsScreen_GetAnimationParam:
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
2018-06-24 07:09:41 -07:00
.Jumptable:
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
2018-06-24 07:09:41 -07:00
.PartyMon:
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
2018-06-24 07:09:41 -07:00
.OTPartyMon:
2015-11-19 20:38:16 -08:00
xor a
ret
2018-06-24 07:09:41 -07:00
.BoxMon:
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
2018-06-24 07:09:41 -07:00
.Tempmon:
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
2018-06-24 07:09:41 -07:00
.CheckEggFaintedFrzSlp:
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
2018-06-24 07:09:41 -07:00
.Wildmon:
2015-11-19 20:38:16 -08:00
ld a, $1
and a
ret
2015-12-21 11:10:16 -08:00
2018-06-24 07:09:41 -07:00
.FaintedFrzSlp:
2015-11-19 20:38:16 -08:00
xor a
ret
2018-06-24 07:09:41 -07:00
StatsScreen_LoadTextBoxSpaceGFX:
2015-11-19 20:38:16 -08:00
nop
push hl
push de
push bc
push af
call DelayFrame
ldh a, [rVBK]
2015-11-19 20:38:16 -08:00
push af
ld a, $1
ldh [rVBK], a
2015-11-19 20:38:16 -08:00
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
ldh [rVBK], a
2015-11-19 20:38:16 -08:00
pop af
pop bc
pop de
pop hl
ret
2018-06-24 07:09:41 -07:00
Unreferenced_4e32a:
; A blank space tile?
2015-11-19 20:38:16 -08:00
ds 16
2018-06-24 07:09:41 -07:00
EggStatsScreen:
2015-11-19 20:38:16 -08:00
xor a
ldh [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
2018-06-24 07:09:41 -07:00
EggString:
2015-11-19 20:38:16 -08:00
db "EGG@"
2018-06-24 07:09:41 -07:00
FiveQMarkString:
2015-11-19 20:38:16 -08:00
db "?????@"
EggSoonString:
2015-11-19 20:38:16 -08:00
db "It's making sounds"
next "inside. It's going"
next "to hatch soon!@"
EggCloseString:
2015-11-19 20:38:16 -08:00
db "It moves around"
next "inside sometimes."
next "It must be close"
next "to hatching.@"
EggMoreTimeString:
2015-11-19 20:38:16 -08:00
db "Wonder what's"
next "inside? It needs"
next "more time, though.@"
EggALotMoreTimeString:
2015-11-19 20:38:16 -08:00
db "This EGG needs a"
next "lot more time to"
next "hatch.@"
2018-06-24 07:09:41 -07:00
StatsScreen_AnimateEgg:
2015-12-21 11:10:16 -08:00
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
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
predef GetAnimatedFrontpic
2015-11-19 20:38:16 -08:00
pop de
hlcoord 0, 0
ld d, $0
predef LoadMonAnimation
2015-11-19 20:38:16 -08:00
ld hl, wcf64
set 6, [hl]
ret
2018-06-24 07:09:41 -07:00
StatsScreen_LoadPageIndicators:
2015-11-19 20:38:16 -08:00
hlcoord 13, 5
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
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)
2018-06-24 07:09:41 -07:00
.load_square
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
2018-06-24 07:09:41 -07:00
CopyNickname:
2018-01-23 14:39:09 -08:00
ld de, wStringBuffer1
2018-01-20 09:25:55 -08:00
ld bc, MON_NAME_LENGTH
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
2018-06-24 07:09:41 -07:00
GetNicknamePointer:
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
2018-06-24 07:09:41 -07:00
CheckFaintedFrzSlp:
2015-11-19 20:38:16 -08:00
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