pokecrystal-board/engine/events/prof_oaks_pc.asm
Rangi 32ed487a47 Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts:
#	audio/engine.asm
#	constants/gfx_constants.asm
#	constants/map_data_constants.asm
#	constants/pokemon_data_constants.asm
#	constants/sprite_constants.asm
#	constants/wram_constants.asm
#	data/maps/data.asm
#	engine/battle/ai/scoring.asm
#	engine/battle/core.asm
#	engine/battle/effect_commands.asm
#	engine/battle/misc.asm
#	engine/battle_anims/getpokeballwobble.asm
#	engine/breeding.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/events/battle_tower/battle_tower.asm
#	engine/events/battle_tower/rules.asm
#	engine/events/buena.asm
#	engine/events/bug_contest/contest_2.asm
#	engine/events/daycare.asm
#	engine/events/dratini.asm
#	engine/events/halloffame.asm
#	engine/events/happiness_egg.asm
#	engine/events/kurt.asm
#	engine/events/lucky_number.asm
#	engine/events/magnet_train.asm
#	engine/events/overworld.asm
#	engine/events/pokerus/pokerus.asm
#	engine/events/print_unown.asm
#	engine/events/print_unown_2.asm
#	engine/events/unown_walls.asm
#	engine/item_effects.asm
#	engine/link.asm
#	engine/mon_menu.asm
#	engine/player_object.asm
#	engine/routines/playslowcry.asm
#	engine/scripting.asm
#	engine/search.asm
#	engine/search2.asm
#	engine/specials.asm
#	engine/start_menu.asm
#	engine/timeset.asm
#	home/battle_vars.asm
#	home/map.asm
#	maps/GoldenrodUndergroundSwitchRoomEntrances.asm
#	maps/IlexForest.asm
#	maps/KrissHouse2F.asm
#	maps/Route39Barn.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_5f.asm
#	wram.asm
2018-02-03 19:42:56 -05:00

194 lines
2.6 KiB
NASM
Executable File

ProfOaksPC: ; 0x265d3
ld hl, OakPCText1
call MenuTextBox
call YesNoBox
jr c, .shutdown
call ProfOaksPCBoot ; player chose "yes"?
.shutdown
ld hl, OakPCText4
call PrintText
call JoyWaitAorB
call ExitMenu
ret
ProfOaksPCBoot ; 0x265ee
ld hl, OakPCText2
call PrintText
call Rate
call PlaySFX ; sfx loaded by previous Rate function call
call JoyWaitAorB
call WaitSFX
ret
ProfOaksPCRating: ; 0x26601
call Rate
push de
ld de, MUSIC_NONE
call PlayMusic
pop de
call PlaySFX
call JoyWaitAorB
call WaitSFX
ret
Rate: ; 0x26616
; calculate Seen/Owned
ld hl, wPokedexSeen
ld b, wEndPokedexSeen - wPokedexSeen
call CountSetBits
ld [wd002], a
ld hl, wPokedexCaught
ld b, wEndPokedexCaught - wPokedexCaught
call CountSetBits
ld [wd003], a
; print appropriate rating
call .UpdateRatingBuffers
ld hl, OakPCText3
call PrintText
call JoyWaitAorB
ld a, [wd003]
ld hl, OakRatings
call FindOakRating
push de
call PrintText
pop de
ret
.UpdateRatingBuffers: ; 0x26647
ld hl, wStringBuffer3
ld de, wd002
call .UpdateRatingBuffer
ld hl, wStringBuffer4
ld de, wd003
call .UpdateRatingBuffer
ret
.UpdateRatingBuffer: ; 0x2665a
push hl
ld a, "@"
ld bc, ITEM_NAME_LENGTH
call ByteFill
pop hl
lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum
ret
FindOakRating: ; 0x2666b
; 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
INCLUDE "data/events/pokedex_ratings.asm"
OakPCText1: ; 0x266de
text_jump _OakPCText1
db "@"
OakPCText2: ; 0x266e3
text_jump _OakPCText2
db "@"
OakPCText3: ; 0x266e8
text_jump _OakPCText3
db "@"
OakRating01:
text_jump _OakRating01
db "@"
OakRating02:
text_jump _OakRating02
db "@"
OakRating03:
text_jump _OakRating03
db "@"
OakRating04:
text_jump _OakRating04
db "@"
OakRating05:
text_jump _OakRating05
db "@"
OakRating06:
text_jump _OakRating06
db "@"
OakRating07:
text_jump _OakRating07
db "@"
OakRating08:
text_jump _OakRating08
db "@"
OakRating09:
text_jump _OakRating09
db "@"
OakRating10:
text_jump _OakRating10
db "@"
OakRating11:
text_jump _OakRating11
db "@"
OakRating12:
text_jump _OakRating12
db "@"
OakRating13:
text_jump _OakRating13
db "@"
OakRating14:
text_jump _OakRating14
db "@"
OakRating15:
text_jump _OakRating15
db "@"
OakRating16:
text_jump _OakRating16
db "@"
OakRating17:
text_jump _OakRating17
db "@"
OakRating18:
text_jump _OakRating18
db "@"
OakRating19:
text_jump _OakRating19
db "@"
OakPCText4: ; 0x2674c
text_jump _OakPCText4
db "@"