2018-06-24 14:09:41 +00:00
|
|
|
|
PokemonCenterPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_CheckPartyForPokemon
|
|
|
|
|
ret c
|
|
|
|
|
call PC_PlayBootSound
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_BootedUpPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayText
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_AccessWhosePC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayTextWaitMenu
|
|
|
|
|
ld hl, .TopMenu
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call LoadMenuHeader
|
2015-11-17 02:46:36 +00:00
|
|
|
|
.loop
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call .ChooseWhichPCListToUse
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld [wWhichIndexSet], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call DoNthMenu
|
|
|
|
|
jr c, .shutdown
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wMenuSelection]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .JumpTable
|
|
|
|
|
call MenuJumptable
|
|
|
|
|
jr nc, .loop
|
|
|
|
|
|
|
|
|
|
.shutdown
|
|
|
|
|
call PC_PlayShutdownSound
|
|
|
|
|
call ExitMenu
|
2015-12-25 03:58:42 +00:00
|
|
|
|
call CloseWindow
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.TopMenu:
|
2018-01-14 10:59:56 +00:00
|
|
|
|
db MENU_BACKUP_TILES | MENU_NO_CLICK_SFX ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
|
menu_coords 0, 0, 15, 12
|
2018-01-23 21:08:43 +00:00
|
|
|
|
dw .MenuData
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2018-01-23 21:08:43 +00:00
|
|
|
|
.MenuData:
|
2018-01-14 10:59:56 +00:00
|
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 0 ; items
|
|
|
|
|
dw .WhichPC
|
|
|
|
|
dw PlaceNthMenuStrings
|
|
|
|
|
dw .JumpTable
|
|
|
|
|
|
2018-05-19 02:18:00 +00:00
|
|
|
|
PCPC_PLAYERS_PC EQU 0
|
|
|
|
|
PCPC_BILLS_PC EQU 1
|
|
|
|
|
PCPC_OAKS_PC EQU 2
|
|
|
|
|
PCPC_HALL_OF_FAME EQU 3
|
|
|
|
|
PCPC_TURN_OFF EQU 4
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.JumpTable:
|
2018-05-19 02:18:00 +00:00
|
|
|
|
; entries correspond to PCPC_* constants
|
|
|
|
|
dw PlayersPC, .String_PlayersPC
|
|
|
|
|
dw BillsPC, .String_BillsPC
|
|
|
|
|
dw OaksPC, .String_OaksPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
dw HallOfFamePC, .String_HallOfFame
|
2018-05-19 02:18:00 +00:00
|
|
|
|
dw TurnOffPC, .String_TurnOff
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.String_PlayersPC: db "<PLAYER>'s PC@"
|
|
|
|
|
.String_BillsPC: db "BILL's PC@"
|
|
|
|
|
.String_OaksPC: db "PROF.OAK's PC@"
|
|
|
|
|
.String_HallOfFame: db "HALL OF FAME@"
|
|
|
|
|
.String_TurnOff: db "TURN OFF@"
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.WhichPC:
|
2018-05-19 02:18:00 +00:00
|
|
|
|
; before Pokédex
|
|
|
|
|
db 3
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
|
|
|
|
; before Hall Of Fame
|
2018-05-19 02:18:00 +00:00
|
|
|
|
db 4
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_OAKS_PC
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
|
|
|
|
; postgame
|
2018-05-19 02:18:00 +00:00
|
|
|
|
db 5
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_OAKS_PC
|
|
|
|
|
db PCPC_HALL_OF_FAME
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.ChooseWhichPCListToUse:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call CheckReceivedDex
|
|
|
|
|
jr nz, .got_dex
|
2018-05-19 02:18:00 +00:00
|
|
|
|
ld a, 0 ; before Pokédex
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.got_dex
|
|
|
|
|
ld a, [wHallOfFameCount]
|
|
|
|
|
and a
|
2018-05-19 02:18:00 +00:00
|
|
|
|
ld a, 1 ; before Hall Of Fame
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret z
|
2018-05-19 02:18:00 +00:00
|
|
|
|
ld a, 2 ; postgame
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_CheckPartyForPokemon:
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wPartyCount]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret nz
|
|
|
|
|
ld de, SFX_CHOOSE_PC_OPTION
|
|
|
|
|
call PlaySFX
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld hl, .MustHavePokemonToUse
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayText
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.MustHavePokemonToUse:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; Bzzzzt! You must have a #MON to use this!
|
|
|
|
|
text_jump UnknownText_0x1c1328
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
BillsPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_AccessedBillsPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayText
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall _BillsPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PlayersPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_AccessedOwnPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayText
|
|
|
|
|
ld b, $0
|
|
|
|
|
call _PlayersPC
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
OaksPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_AccessedOaksPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_DisplayText
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall ProfOaksPC
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
HallOfFamePC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_PlayChoosePCSound
|
|
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall _HallOfFamePC
|
2015-12-02 02:54:11 +00:00
|
|
|
|
call CloseSubmenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
TurnOffPC:
|
2017-12-11 03:34:42 +00:00
|
|
|
|
ld hl, PokecenterPCText_LinkClosed
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PrintText
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_PlayBootSound:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld de, SFX_BOOT_PC
|
|
|
|
|
jr PC_WaitPlaySFX
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_PlayShutdownSound:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld de, SFX_SHUT_DOWN_PC
|
|
|
|
|
call PC_WaitPlaySFX
|
|
|
|
|
call WaitSFX
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_PlayChoosePCSound:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld de, SFX_CHOOSE_PC_OPTION
|
|
|
|
|
jr PC_WaitPlaySFX
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_PlaySwapItemsSound:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld de, SFX_SWITCH_POKEMON
|
|
|
|
|
call PC_WaitPlaySFX
|
|
|
|
|
ld de, SFX_SWITCH_POKEMON
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_WaitPlaySFX:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push de
|
|
|
|
|
call WaitSFX
|
|
|
|
|
pop de
|
|
|
|
|
call PlaySFX
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
_PlayersHousePC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call PC_PlayBootSound
|
|
|
|
|
ld hl, UnknownText_0x156ff
|
|
|
|
|
call PC_DisplayText
|
|
|
|
|
ld b, $1
|
|
|
|
|
call _PlayersPC
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_156f9
|
|
|
|
|
call OverworldTextModeSwitch
|
2015-11-25 15:16:29 +00:00
|
|
|
|
call ApplyTilemap
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call UpdateSprites
|
|
|
|
|
call PC_PlayShutdownSound
|
|
|
|
|
ld c, $0
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.asm_156f9
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ld c, $1
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
UnknownText_0x156ff:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; turned on the PC.
|
|
|
|
|
text_jump UnknownText_0x1c1353
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
_PlayersPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, b
|
2015-12-19 01:07:09 +00:00
|
|
|
|
ld [wWhichIndexSet], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, UnknownText_0x157cc
|
|
|
|
|
call PC_DisplayTextWaitMenu
|
|
|
|
|
call Function15715
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
Function15715:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld [wPCItemsCursor], a
|
|
|
|
|
ld [wPCItemsScrollPosition], a
|
2018-01-23 00:10:09 +00:00
|
|
|
|
ld hl, PlayersPCMenuData
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call LoadMenuHeader
|
2015-11-17 02:46:36 +00:00
|
|
|
|
.asm_15722
|
|
|
|
|
call UpdateTimePals
|
|
|
|
|
call DoNthMenu
|
|
|
|
|
jr c, .asm_15731
|
|
|
|
|
call MenuJumptable
|
|
|
|
|
jr nc, .asm_15722
|
|
|
|
|
jr .asm_15732
|
|
|
|
|
|
|
|
|
|
.asm_15731
|
|
|
|
|
xor a
|
|
|
|
|
|
|
|
|
|
.asm_15732
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayersPCMenuData:
|
2018-01-14 10:59:56 +00:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 0, 0 ; top left corner coords (y, x)
|
|
|
|
|
db 12, 15 ; bottom right corner coords (y, x)
|
2018-01-23 21:08:43 +00:00
|
|
|
|
dw .PlayersPCMenuData
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 1 ; default selected option
|
|
|
|
|
|
2018-01-23 21:08:43 +00:00
|
|
|
|
.PlayersPCMenuData:
|
2018-01-14 10:59:56 +00:00
|
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 0 ; # items?
|
2018-01-23 00:10:09 +00:00
|
|
|
|
dw .PlayersPCMenuList1
|
2015-11-17 02:46:36 +00:00
|
|
|
|
dw PlaceNthMenuStrings
|
2018-01-23 00:10:09 +00:00
|
|
|
|
dw .PlayersPCMenuPointers
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2018-05-19 02:18:00 +00:00
|
|
|
|
PLAYERSPC_WITHDRAW_ITEM EQU 0
|
|
|
|
|
PLAYERSPC_DEPOSIT_ITEM EQU 1
|
|
|
|
|
PLAYERSPC_TOSS_ITEM EQU 2
|
|
|
|
|
PLAYERSPC_MAIL_BOX EQU 3
|
|
|
|
|
PLAYERSPC_DECORATION EQU 4
|
|
|
|
|
PLAYERSPC_TURN_OFF EQU 5
|
|
|
|
|
PLAYERSPC_LOG_OFF EQU 6
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.PlayersPCMenuPointers:
|
2018-05-19 02:18:00 +00:00
|
|
|
|
; entries correspond to PLAYERSPC_* constants
|
2018-01-23 00:10:09 +00:00
|
|
|
|
dw PlayerWithdrawItemMenu, .WithdrawItem
|
|
|
|
|
dw PlayerDepositItemMenu, .DepositItem
|
|
|
|
|
dw PlayerTossItemMenu, .TossItem
|
|
|
|
|
dw PlayerMailBoxMenu, .MailBox
|
|
|
|
|
dw PlayerDecorationMenu, .Decoration
|
|
|
|
|
dw PlayerLogOffMenu, .LogOff
|
|
|
|
|
dw PlayerLogOffMenu, .TurnOff
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.WithdrawItem: db "WITHDRAW ITEM@"
|
|
|
|
|
.DepositItem: db "DEPOSIT ITEM@"
|
|
|
|
|
.TossItem: db "TOSS ITEM@"
|
|
|
|
|
.MailBox: db "MAIL BOX@"
|
|
|
|
|
.Decoration: db "DECORATION@"
|
|
|
|
|
.TurnOff: db "TURN OFF@"
|
|
|
|
|
.LogOff: db "LOG OFF@"
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2018-01-23 00:10:09 +00:00
|
|
|
|
.PlayersPCMenuList1:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 5
|
2018-05-19 02:18:00 +00:00
|
|
|
|
db PLAYERSPC_WITHDRAW_ITEM
|
|
|
|
|
db PLAYERSPC_DEPOSIT_ITEM
|
|
|
|
|
db PLAYERSPC_TOSS_ITEM
|
|
|
|
|
db PLAYERSPC_MAIL_BOX
|
|
|
|
|
db PLAYERSPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2018-01-23 00:10:09 +00:00
|
|
|
|
.PlayersPCMenuList2:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 6
|
2018-05-19 02:18:00 +00:00
|
|
|
|
db PLAYERSPC_WITHDRAW_ITEM
|
|
|
|
|
db PLAYERSPC_DEPOSIT_ITEM
|
|
|
|
|
db PLAYERSPC_TOSS_ITEM
|
|
|
|
|
db PLAYERSPC_MAIL_BOX
|
|
|
|
|
db PLAYERSPC_DECORATION
|
|
|
|
|
db PLAYERSPC_LOG_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_DisplayTextWaitMenu:
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wOptions]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wOptions], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call MenuTextBox
|
|
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wOptions], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
UnknownText_0x157cc:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; What do you want to do?
|
|
|
|
|
text_jump UnknownText_0x1c1368
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerWithdrawItemMenu:
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall ClearPCItemScreen
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.loop
|
|
|
|
|
call PCItemsJoypad
|
|
|
|
|
jr c, .quit
|
|
|
|
|
call .Submenu
|
|
|
|
|
jr .loop
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.quit
|
2015-12-02 02:54:11 +00:00
|
|
|
|
call CloseSubmenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.Submenu:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; check if the item has a quantity
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall _CheckTossableItem
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .askquantity
|
|
|
|
|
|
|
|
|
|
; items without quantity are always ×1
|
|
|
|
|
ld a, 1
|
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
|
|
|
|
jr .withdraw
|
|
|
|
|
|
|
|
|
|
.askquantity
|
|
|
|
|
ld hl, .HowManyText
|
|
|
|
|
call MenuTextBox
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall SelectQuantityToToss
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call ExitMenu
|
|
|
|
|
call ExitMenu
|
|
|
|
|
jr c, .done
|
|
|
|
|
|
|
|
|
|
.withdraw
|
|
|
|
|
ld a, [wItemQuantityChangeBuffer]
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wBuffer1], a ; quantity
|
|
|
|
|
ld a, [wCurItemQuantity]
|
|
|
|
|
ld [wBuffer2], a
|
|
|
|
|
ld hl, wNumItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call ReceiveItem
|
|
|
|
|
jr nc, .PackFull
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer2]
|
|
|
|
|
ld [wCurItemQuantity], a
|
|
|
|
|
ld hl, wPCItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call TossItem
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef PartyMonItemName
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .WithdrewText
|
|
|
|
|
call MenuTextBox
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PackFull:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .NoRoomText
|
|
|
|
|
call MenuTextBoxBackup
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.done
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.HowManyText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCHowManyWithdrawText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.WithdrewText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCWithdrewItemsText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.NoRoomText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCNoRoomWithdrawText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerTossItemMenu:
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall ClearPCItemScreen
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.loop
|
|
|
|
|
call PCItemsJoypad
|
|
|
|
|
jr c, .quit
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld de, wPCItems
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall TossItemFromPC
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr .loop
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.quit
|
2015-12-02 02:54:11 +00:00
|
|
|
|
call CloseSubmenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerDecorationMenu:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
farcall _PlayerDecorationMenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerLogOffMenu:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerDepositItemMenu:
|
2016-03-02 03:31:21 +00:00
|
|
|
|
call .CheckItemsInBag
|
|
|
|
|
jr c, .nope
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call DisableSpriteUpdates
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall DepositSellInitPackBuffers
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.loop
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall DepositSellPack
|
2018-01-11 20:36:11 +00:00
|
|
|
|
ld a, [wPackUsedItem]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr z, .close
|
|
|
|
|
call .TryDepositItem
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall CheckRegisteredItem
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr .loop
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.close
|
2015-12-02 02:54:11 +00:00
|
|
|
|
call CloseSubmenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.nope
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.CheckItemsInBag:
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall HasNoItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret nc
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld hl, .NoItemsInBag
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call MenuTextBoxBackup
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NoItemsInBag:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; No items here!
|
|
|
|
|
text_jump UnknownText_0x1c13df
|
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.TryDepositItem:
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld a, [wSpriteUpdatesEnabled]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
|
|
|
|
ld a, $0
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall CheckItemMenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
2015-12-27 02:59:03 +00:00
|
|
|
|
ld hl, .dw
|
2015-11-17 02:46:36 +00:00
|
|
|
|
rst JumpTable
|
|
|
|
|
pop af
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.dw
|
2018-05-19 02:18:00 +00:00
|
|
|
|
; entries correspond to ITEMMENU_* constants
|
|
|
|
|
dw .tossable ; ITEMMENU_NOUSE
|
2015-11-17 02:46:36 +00:00
|
|
|
|
dw .no_toss
|
|
|
|
|
dw .no_toss
|
|
|
|
|
dw .no_toss
|
2018-05-19 02:18:00 +00:00
|
|
|
|
dw .tossable ; ITEMMENU_CURRENT
|
|
|
|
|
dw .tossable ; ITEMMENU_PARTY
|
|
|
|
|
dw .tossable ; ITEMMENU_CLOSE
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.no_toss
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.tossable
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer2]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
2016-03-02 03:31:21 +00:00
|
|
|
|
call .DepositItem_
|
2015-11-17 02:46:36 +00:00
|
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wBuffer2], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wBuffer1], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.DepositItem_:
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall _CheckTossableItem
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
|
|
|
|
and a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr z, .AskQuantity
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, $1
|
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr .DepositItem
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.AskQuantity:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .HowManyText
|
|
|
|
|
call MenuTextBox
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall SelectQuantityToToss
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
|
|
|
|
call ExitMenu
|
|
|
|
|
call ExitMenu
|
|
|
|
|
pop af
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr c, .DeclinedToDeposit
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.DepositItem:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld a, [wItemQuantityChangeBuffer]
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld [wBuffer1], a
|
|
|
|
|
ld a, [wCurItemQuantity]
|
|
|
|
|
ld [wBuffer2], a
|
|
|
|
|
ld hl, wPCItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call ReceiveItem
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr nc, .NoRoomInPC
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2018-01-23 22:39:09 +00:00
|
|
|
|
ld a, [wBuffer2]
|
|
|
|
|
ld [wCurItemQuantity], a
|
|
|
|
|
ld hl, wNumItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call TossItem
|
2018-01-16 19:30:10 +00:00
|
|
|
|
predef PartyMonItemName
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .DepositText
|
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.NoRoomInPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld hl, .NoRoomText
|
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.DeclinedToDeposit:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.HowManyText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCHowManyDepositText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.DepositText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCDepositItemsText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
.NoRoomText:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
text_jump _PlayersPCNoRoomDepositText
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PlayerMailBoxMenu:
|
2018-01-23 00:10:09 +00:00
|
|
|
|
farcall _PlayerMailBoxMenu
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PCItemsJoypad:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld [wSwitchItem], a
|
|
|
|
|
.loop
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld a, [wSpriteUpdatesEnabled]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
push af
|
|
|
|
|
ld a, $0
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld hl, .PCItemsMenuData
|
2018-01-23 21:08:43 +00:00
|
|
|
|
call CopyMenuHeader
|
2015-11-17 02:46:36 +00:00
|
|
|
|
hlcoord 0, 0
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld b, 10
|
|
|
|
|
ld c, 18
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call TextBox
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld a, [wPCItemsCursor]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
ld [wMenuCursorBuffer], a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld a, [wPCItemsScrollPosition]
|
2015-11-23 21:04:53 +00:00
|
|
|
|
ld [wMenuScrollPosition], a
|
2015-12-18 03:31:16 +00:00
|
|
|
|
call ScrollingMenu
|
2015-11-23 21:04:53 +00:00
|
|
|
|
ld a, [wMenuScrollPosition]
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld [wPCItemsScrollPosition], a
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuCursorY]
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld [wPCItemsCursor], a
|
2015-11-17 02:46:36 +00:00
|
|
|
|
pop af
|
2015-11-25 15:16:29 +00:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld a, [wSwitchItem]
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
jr nz, .moving_stuff_around
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuJoypad]
|
2016-03-02 03:31:21 +00:00
|
|
|
|
cp B_BUTTON
|
|
|
|
|
jr z, .b_1
|
|
|
|
|
cp A_BUTTON
|
|
|
|
|
jr z, .a_1
|
|
|
|
|
cp SELECT
|
|
|
|
|
jr z, .select_1
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.moving_stuff_around
|
2015-12-15 23:59:49 +00:00
|
|
|
|
ld a, [wMenuJoypad]
|
2016-03-02 03:31:21 +00:00
|
|
|
|
cp B_BUTTON
|
|
|
|
|
jr z, .b_2
|
|
|
|
|
cp A_BUTTON
|
|
|
|
|
jr z, .a_select_2
|
|
|
|
|
cp SELECT
|
|
|
|
|
jr z, .a_select_2
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.b_2
|
2015-11-17 02:46:36 +00:00
|
|
|
|
xor a
|
2016-03-02 03:31:21 +00:00
|
|
|
|
ld [wSwitchItem], a
|
|
|
|
|
jr .next
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.a_select_2
|
|
|
|
|
call PC_PlaySwapItemsSound
|
|
|
|
|
.select_1
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall SwitchItemsInBag
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.next
|
|
|
|
|
jp .loop
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.a_1
|
2017-12-24 17:47:30 +00:00
|
|
|
|
farcall ScrollingMenu_ClearLeftColumn
|
2015-12-18 03:31:16 +00:00
|
|
|
|
call PlaceHollowCursor
|
2015-11-17 02:46:36 +00:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-03-02 03:31:21 +00:00
|
|
|
|
.b_1
|
2015-11-17 02:46:36 +00:00
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
|
.PCItemsMenuData:
|
2018-01-15 04:43:51 +00:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
|
menu_coords 4, 1, 18, 10
|
2018-01-23 21:08:43 +00:00
|
|
|
|
dw .MenuData
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2018-01-23 21:08:43 +00:00
|
|
|
|
.MenuData:
|
2018-01-14 10:59:56 +00:00
|
|
|
|
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
|
2015-11-17 02:46:36 +00:00
|
|
|
|
db 4, 8 ; rows/cols?
|
|
|
|
|
db 2 ; horizontal spacing?
|
2018-01-23 22:39:09 +00:00
|
|
|
|
dbw 0, wPCItems
|
2015-11-17 02:46:36 +00:00
|
|
|
|
dba PlaceMenuItemName
|
|
|
|
|
dba PlaceMenuItemQuantity
|
2015-11-23 21:04:53 +00:00
|
|
|
|
dba UpdateItemDescription
|
2015-11-17 02:46:36 +00:00
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
|
PC_DisplayText:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
call MenuTextBox
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_BootedUpPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; turned on the PC.
|
|
|
|
|
text_jump UnknownText_0x1c144d
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_AccessWhosePC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; Access whose PC?
|
|
|
|
|
text_jump UnknownText_0x1c1462
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_AccessedBillsPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; BILL's PC accessed. #MON Storage System opened.
|
|
|
|
|
text_jump UnknownText_0x1c1474
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_AccessedOwnPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; Accessed own PC. Item Storage System opened.
|
|
|
|
|
text_jump UnknownText_0x1c14a4
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_AccessedOaksPC:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; PROF.OAK's PC accessed. #DEX Rating System opened.
|
|
|
|
|
text_jump UnknownText_0x1c14d2
|
|
|
|
|
db "@"
|
|
|
|
|
|
2018-06-25 00:10:37 +00:00
|
|
|
|
PokecenterPCText_LinkClosed:
|
2015-11-17 02:46:36 +00:00
|
|
|
|
; … Link closed…
|
|
|
|
|
text_jump UnknownText_0x1c1505
|
|
|
|
|
db "@"
|