2018-06-24 17:10:37 -07:00
|
|
|
ProfOaksPC:
|
2016-01-10 14:44:09 -08:00
|
|
|
ld hl, OakPCText1
|
2019-04-08 05:15:10 -07:00
|
|
|
call MenuTextbox
|
2016-01-10 14:44:09 -08:00
|
|
|
call YesNoBox
|
|
|
|
jr c, .shutdown
|
2018-01-24 08:17:05 -08:00
|
|
|
call ProfOaksPCBoot ; player chose "yes"?
|
2016-01-10 14:44:09 -08:00
|
|
|
.shutdown
|
|
|
|
ld hl, OakPCText4
|
|
|
|
call PrintText
|
|
|
|
call JoyWaitAorB
|
|
|
|
call ExitMenu
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
ProfOaksPCBoot:
|
2016-01-10 14:44:09 -08:00
|
|
|
ld hl, OakPCText2
|
|
|
|
call PrintText
|
|
|
|
call Rate
|
|
|
|
call PlaySFX ; sfx loaded by previous Rate function call
|
|
|
|
call JoyWaitAorB
|
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
ProfOaksPCRating:
|
2016-01-10 14:44:09 -08:00
|
|
|
call Rate
|
|
|
|
push de
|
|
|
|
ld de, MUSIC_NONE
|
|
|
|
call PlayMusic
|
|
|
|
pop de
|
|
|
|
call PlaySFX
|
|
|
|
call JoyWaitAorB
|
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
Rate:
|
2016-01-10 14:44:09 -08:00
|
|
|
; calculate Seen/Owned
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPokedexSeen
|
|
|
|
ld b, wEndPokedexSeen - wPokedexSeen
|
2016-01-10 14:44:09 -08:00
|
|
|
call CountSetBits
|
2020-10-29 11:45:40 -07:00
|
|
|
ld [wTempPokedexSeenCount], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wPokedexCaught
|
|
|
|
ld b, wEndPokedexCaught - wPokedexCaught
|
2016-01-10 14:44:09 -08:00
|
|
|
call CountSetBits
|
2020-10-29 11:45:40 -07:00
|
|
|
ld [wTempPokedexCaughtCount], a
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
; print appropriate rating
|
|
|
|
call .UpdateRatingBuffers
|
|
|
|
ld hl, OakPCText3
|
|
|
|
call PrintText
|
|
|
|
call JoyWaitAorB
|
2020-10-29 11:45:40 -07:00
|
|
|
ld a, [wTempPokedexCaughtCount]
|
2016-01-10 14:44:09 -08:00
|
|
|
ld hl, OakRatings
|
|
|
|
call FindOakRating
|
|
|
|
push de
|
|
|
|
call PrintText
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
.UpdateRatingBuffers:
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer3
|
2020-10-29 11:45:40 -07:00
|
|
|
ld de, wTempPokedexSeenCount
|
2016-01-10 14:44:09 -08:00
|
|
|
call .UpdateRatingBuffer
|
2018-01-23 14:39:09 -08:00
|
|
|
ld hl, wStringBuffer4
|
2020-10-29 11:45:40 -07:00
|
|
|
ld de, wTempPokedexCaughtCount
|
2016-01-10 14:44:09 -08:00
|
|
|
call .UpdateRatingBuffer
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
.UpdateRatingBuffer:
|
2016-01-10 14:44:09 -08:00
|
|
|
push hl
|
|
|
|
ld a, "@"
|
|
|
|
ld bc, ITEM_NAME_LENGTH
|
|
|
|
call ByteFill
|
|
|
|
pop hl
|
2019-11-03 17:17:04 -08:00
|
|
|
lb bc, PRINTNUM_LEFTALIGN | 1, 3
|
2016-01-10 14:44:09 -08:00
|
|
|
call PrintNum
|
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
FindOakRating:
|
2016-01-10 14:44:09 -08:00
|
|
|
; return sound effect in de
|
|
|
|
; return text pointer in hl
|
|
|
|
nop
|
|
|
|
ld c, a
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
|
|
|
cp c
|
|
|
|
jr nc, .match
|
|
|
|
rept 4
|
|
|
|
inc hl
|
|
|
|
endr
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
.match
|
|
|
|
ld a, [hli]
|
|
|
|
ld e, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, a
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ret
|
|
|
|
|
2018-01-25 19:19:24 -08:00
|
|
|
INCLUDE "data/events/pokedex_ratings.asm"
|
2016-01-10 14:44:09 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
OakPCText1:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakPCText1
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
OakPCText2:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakPCText2
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
OakPCText3:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakPCText3
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating01:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating01
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating02:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating02
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating03:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating03
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating04:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating04
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating05:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating05
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating06:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating06
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating07:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating07
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating08:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating08
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating09:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating09
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating10:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating10
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating11:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating11
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating12:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating12
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating13:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating13
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating14:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating14
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating15:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating15
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating16:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating16
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating17:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating17
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating18:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating18
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
|
|
|
OakRating19:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakRating19
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2016-01-10 14:44:09 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
OakPCText4:
|
2018-10-28 09:16:55 -07:00
|
|
|
text_far _OakPCText4
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|