summaryrefslogtreecommitdiff
path: root/engine/menu/bills_pc.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/menu/bills_pc.asm')
-rw-r--r--engine/menu/bills_pc.asm121
1 files changed, 82 insertions, 39 deletions
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm
index 384ab485..57699b8f 100644
--- a/engine/menu/bills_pc.asm
+++ b/engine/menu/bills_pc.asm
@@ -11,18 +11,15 @@ DisplayPCMainMenu::
and a
jr nz, .leaguePCAvailable
coord hl, 0, 0
- ld b, 8
- ld c, 14
+ lb bc, 8, 14
jr .next
.noOaksPC
coord hl, 0, 0
- ld b, 6
- ld c, 14
+ lb bc, 6, 14
jr .next
.leaguePCAvailable
coord hl, 0, 0
- ld b, 10
- ld c, 14
+ lb bc, 10, 14
.next
call TextBoxBorder
call UpdateSprites
@@ -92,7 +89,7 @@ OaksPCText: db "PROF.OAK's PC@"
PKMNLeaguePCText: db $4a, "LEAGUE@"
LogOffPCText: db "LOG OFF@"
-BillsPC_:: ; 0x214c2
+BillsPC_::
ld hl, wd730
set 6, [hl]
xor a
@@ -119,10 +116,13 @@ BillsPCMenu:
lb bc, BANK(PokeballTileGraphics), $01
call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer
+ coord hl, 0, 12
+ lb bc, 4, 18
+ call TextBoxBorder
coord hl, 0, 0
- ld b, 10
- ld c, 12
+ lb bc, 12, 12
call TextBoxBorder
+ call UpdateSprites
coord hl, 2, 2
ld de, BillsPCMenuText
call PlaceString
@@ -133,7 +133,7 @@ BillsPCMenu:
ld [hli], a ; wTopMenuItemX
inc hl
inc hl
- ld a, 4
+ ld a, 5
ld [hli], a ; wMaxMenuItem
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
@@ -144,11 +144,8 @@ BillsPCMenu:
ld [hli], a ; wListScrollOffset
ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a
- ld hl, WhatText
- call PrintText
coord hl, 9, 14
- ld b, 2
- ld c, 9
+ lb bc, 2, 9
call TextBoxBorder
ld a, [wCurrentBoxNum]
and $7f
@@ -184,6 +181,8 @@ BillsPCMenu:
jp z, BillsPCRelease ; release
cp $3
jp z, BillsPCChangeBox ; change box
+ cp $4
+ jp z, BillsPCPrintBox
ExitBillsPC:
ld a, [wFlags_0xcd60]
@@ -204,6 +203,10 @@ ExitBillsPC:
res 6, [hl]
ret
+BillsPCPrintBox:
+ callab PrintPCBox
+ jp BillsPCMenu
+
BillsPCDeposit:
ld a, [wPartyCount]
dec a
@@ -222,11 +225,26 @@ BillsPCDeposit:
ld hl, wPartyCount
call DisplayMonListMenu
jp c, BillsPCMenu
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_215ad
+ call CheckPikachuFollowingPlayer
+ jr z, .asm_215ad
+ ld hl, SleepingPikachuText2
+ call PrintText
+ jp BillsPCMenu
+.asm_215ad
call DisplayDepositWithdrawMenu
jp nc, BillsPCMenu
+ callab IsThisPartymonStarterPikachu_Party
+ jr nc, .asm_215c9
+ ld e, $1b
+ callab PlayPikachuSoundClip
+ jr .asm_215cf
+.asm_215c9
ld a, [wcf91]
- call GetCryData
- call PlaySoundWaitForCurrent
+ call PlayCry
+.asm_215cf
+ callabd_ModifyPikachuHappiness PIKAHAPPY_DEPOSITED
ld a, PARTY_TO_BOX
ld [wMoveMonType], a
call MoveMon
@@ -236,7 +254,7 @@ BillsPCDeposit:
call WaitForSoundToFinish
ld hl, wBoxNumString
ld a, [wCurrentBoxNum]
- and $7f
+ and " "
cp 9
jr c, .singleDigitBoxNum
sub 9
@@ -248,11 +266,15 @@ BillsPCDeposit:
add "1"
.next
ld [hli], a
- ld [hl], $50
+ ld [hl], "@"
ld hl, MonWasStoredText
call PrintText
jp BillsPCMenu
+SleepingPikachuText2:
+ TX_FAR _SleepingPikachuText2
+ db "@"
+
BillsPCWithdraw:
ld a, [wNumInBox]
and a
@@ -276,9 +298,15 @@ BillsPCWithdraw:
ld a, [wWhichPokemon]
ld hl, wBoxMonNicks
call GetPartyMonName
+ callab IsThisPartymonStarterPikachu_Box
+ jr nc, .asm_21660
+ ld e, $22
+ callab PlayPikachuSoundClip
+ jr .asm_21666
+.asm_21660
ld a, [wcf91]
- call GetCryData
- call PlaySoundWaitForCurrent
+ call PlayCry
+.asm_21666
xor a ; BOX_TO_PARTY
ld [wMoveMonType], a
call MoveMon
@@ -301,6 +329,8 @@ BillsPCRelease:
ld hl, wNumInBox
call DisplayMonListMenu
jp c, BillsPCMenu
+ callab IsThisPartymonStarterPikachu_Box
+ jr c, .asm_216cb
ld hl, OnceReleasedText
call PrintText
call YesNoChoice
@@ -317,6 +347,16 @@ BillsPCRelease:
call PrintText
jp BillsPCMenu
+.asm_216cb
+ ld a, [wWhichPokemon]
+ ld hl, wBoxMonNicks
+ call GetPartyMonName
+ ld e, $27
+ callab PlayPikachuSoundClip
+ ld hl, PikachuUnhappyText
+ call PrintText
+ jp BillsPCMenu
+
BillsPCChangeBox:
callba ChangeBox
jp BillsPCMenu
@@ -343,6 +383,7 @@ BillsPCMenuText:
next "DEPOSIT ", $4a
next "RELEASE ", $4a
next "CHANGE BOX"
+ next "PRINT BOX"
next "SEE YA!"
db "@"
@@ -382,12 +423,11 @@ HMMoveArray:
db SURF
db STRENGTH
db FLASH
- db -1
+ db $ff
DisplayDepositWithdrawMenu:
coord hl, 9, 10
- ld b, 6
- ld c, 9
+ lb bc, 6, 9
call TextBoxBorder
ld a, [wParentMenuItem]
and a ; was the Deposit or Withdraw item selected in the parent menu?
@@ -457,51 +497,55 @@ StatsCancelPCText:
db "STATS"
next "CANCEL@"
-SwitchOnText: ; 0x217e9
+SwitchOnText:
TX_FAR _SwitchOnText
db "@"
-WhatText: ; 0x217ee
+WhatText:
TX_FAR _WhatText
db "@"
-DepositWhichMonText: ; 0x217f3
+DepositWhichMonText:
TX_FAR _DepositWhichMonText
db "@"
-MonWasStoredText: ; 0x217f8
+MonWasStoredText:
TX_FAR _MonWasStoredText
db "@"
-CantDepositLastMonText: ; 0x217fd
+CantDepositLastMonText:
TX_FAR _CantDepositLastMonText
db "@"
-BoxFullText: ; 0x21802
+BoxFullText:
TX_FAR _BoxFullText
db "@"
-MonIsTakenOutText: ; 0x21807
+MonIsTakenOutText:
TX_FAR _MonIsTakenOutText
db "@"
-NoMonText: ; 0x2180c
+NoMonText:
TX_FAR _NoMonText
db "@"
-CantTakeMonText: ; 0x21811
+CantTakeMonText:
TX_FAR _CantTakeMonText
db "@"
-ReleaseWhichMonText: ; 0x21816
+PikachuUnhappyText:
+ TX_FAR _PikachuUnhappyText
+ db "@"
+
+ReleaseWhichMonText:
TX_FAR _ReleaseWhichMonText
db "@"
-OnceReleasedText: ; 0x2181b
+OnceReleasedText:
TX_FAR _OnceReleasedText
db "@"
-MonWasReleasedText: ; 0x21820
+MonWasReleasedText:
TX_FAR _MonWasReleasedText
db "@"
@@ -509,7 +553,7 @@ CableClubLeftGameboy::
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wPlayerFacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_RIGHT
ret nz
ld a, [wCurMap]
@@ -526,7 +570,7 @@ CableClubRightGameboy::
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wPlayerFacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_LEFT
ret nz
ld a, [wCurMap]
@@ -543,7 +587,7 @@ JustAMomentText::
TX_FAR _JustAMomentText
db "@"
- ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction
+ ld a, [wPlayerFacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
@@ -551,4 +595,3 @@ JustAMomentText::
OpenBillsPCText::
db $FD ; FuncTX_BillsPC
-