aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/GameCorner.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2023-11-20 00:33:27 -0600
committerdannye <33dannye@gmail.com>2023-11-20 20:23:27 -0600
commit298e99d3776580585c3f434e5d93137ae431bdd3 (patch)
treea808c4ffd0fd0f9bd28972bae5236e0d3345c8e5 /scripts/GameCorner.asm
parentAdd sound bits documentation for wOptions (#110) (diff)
parentName 2 unnamed labels I missed in SeafoamIslandsB4F and PokemonMansion3F (#437) (diff)
downloadpokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.gz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.tar.xz
pokeyellow-298e99d3776580585c3f434e5d93137ae431bdd3.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'scripts/GameCorner.asm')
-rw-r--r--scripts/GameCorner.asm388
1 files changed, 199 insertions, 189 deletions
diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm
index b2d4d96a..3fd58f60 100644
--- a/scripts/GameCorner.asm
+++ b/scripts/GameCorner.asm
@@ -1,12 +1,12 @@
GameCorner_Script:
- call CeladonGameCornerScript_48bcf
- call CeladonGameCornerScript_48bec
+ call GameCornerSelectLuckySlotMachine
+ call GameCornerSetRocketHideoutDoorTile
call EnableAutoTextBoxDrawing
ld hl, GameCorner_ScriptPointers
ld a, [wGameCornerCurScript]
jp CallFunctionInTable
-CeladonGameCornerScript_48bcf:
+GameCornerSelectLuckySlotMachine:
ld hl, wCurrentMapScriptFlags
bit 6, [hl]
res 6, [hl]
@@ -14,16 +14,16 @@ CeladonGameCornerScript_48bcf:
call Random
ldh a, [hRandomAdd]
cp $7
- jr nc, .asm_48be2
+ jr nc, .not_max
ld a, $8
-.asm_48be2
+.not_max
srl a
srl a
srl a
ld [wLuckySlotHiddenObjectIndex], a
ret
-CeladonGameCornerScript_48bec:
+GameCornerSetRocketHideoutDoorTile:
ld hl, wCurrentMapScriptFlags
bit 5, [hl]
res 5, [hl]
@@ -35,57 +35,58 @@ CeladonGameCornerScript_48bec:
lb bc, 2, 8
predef_jump ReplaceTileBlock
-CeladonGameCornerScript_48c07:
- xor a
+GameCornerReenterMapAfterPlayerLoss:
+ xor a ; SCRIPT_GAMECORNER_DEFAULT
ld [wJoyIgnore], a
ld [wGameCornerCurScript], a
ld [wCurMapScript], a
ret
GameCorner_ScriptPointers:
- dw CeladonGameCornerScript0
- dw CeladonGameCornerScript1
- dw CeladonGameCornerScript2
+ def_script_pointers
+ dw_const GameCornerDefaultScript, SCRIPT_GAMECORNER_DEFAULT
+ dw_const GameCornerRocketBattleScript, SCRIPT_GAMECORNER_ROCKET_BATTLE
+ dw_const GameCornerRocketExitScript, SCRIPT_GAMECORNER_ROCKET_EXIT
-CeladonGameCornerScript0:
+GameCornerDefaultScript:
ret
-CeladonGameCornerScript1:
+GameCornerRocketBattleScript:
ld a, [wIsInBattle]
cp $ff
- jp z, CeladonGameCornerScript_48c07
- ld a, $f0
+ jp z, GameCornerReenterMapAfterPlayerLoss
+ ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
- ld a, $d
+ ld a, TEXT_GAMECORNER_ROCKET_AFTER_BATTLE
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld a, $b
+ ld a, GAMECORNER_ROCKET
ldh [hSpriteIndex], a
call SetSpriteMovementBytesToFF
- ld de, MovementData_48c5a
+ ld de, GameCornerMovement_Rocket_WalkAroundPlayer
ld a, [wYCoord]
cp 6
- jr nz, .asm_48c43
- ld de, MovementData_48c63
- jr .asm_48c4d
-.asm_48c43
+ jr nz, .not_direct_movement
+ ld de, GameCornerMovement_Rocket_WalkDirect
+ jr .got_rocket_movement
+.not_direct_movement
ld a, [wXCoord]
cp 8
jr nz, .pikachu
- ld de, MovementData_48c63
- jr .asm_48c4d
+ ld de, GameCornerMovement_Rocket_WalkDirect
+ jr .got_rocket_movement
.pikachu
- callfar Func_f1f23
- ld de, MovementData_48c5a
-.asm_48c4d
- ld a, $b
+ callfar GameCornerPikachuMovementScript
+ ld de, GameCornerMovement_Rocket_WalkAroundPlayer
+.got_rocket_movement
+ ld a, GAMECORNER_ROCKET
ldh [hSpriteIndex], a
call MoveSprite
- ld a, $2
+ ld a, SCRIPT_GAMECORNER_ROCKET_EXIT
ld [wGameCornerCurScript], a
ret
-MovementData_48c5a:
+GameCornerMovement_Rocket_WalkAroundPlayer:
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
@@ -96,7 +97,7 @@ MovementData_48c5a:
db NPC_MOVEMENT_RIGHT
db -1 ; end
-MovementData_48c63:
+GameCornerMovement_Rocket_WalkDirect:
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
@@ -104,7 +105,7 @@ MovementData_48c63:
db NPC_MOVEMENT_RIGHT
db -1 ; end
-CeladonGameCornerScript2:
+GameCornerRocketExitScript:
ld a, [wd730]
bit 0, a
ret nz
@@ -116,53 +117,60 @@ CeladonGameCornerScript2:
ld hl, wCurrentMapScriptFlags
set 5, [hl]
set 6, [hl]
- ld a, $0
+ ld a, SCRIPT_GAMECORNER_DEFAULT
ld [wGameCornerCurScript], a
ret
GameCorner_TextPointers:
- dw CeladonGameCornerText1
- dw CeladonGameCornerText2
- dw CeladonGameCornerText3
- dw CeladonGameCornerText4
- dw CeladonGameCornerText5
- dw CeladonGameCornerText6
- dw CeladonGameCornerText7
- dw CeladonGameCornerText8
- dw CeladonGameCornerText9
- dw CeladonGameCornerText10
- dw CeladonGameCornerText11
- dw CeladonGameCornerText12
- dw CeladonGameCornerText13
+ def_text_pointers
+ dw_const GameCornerBeauty1Text, TEXT_GAMECORNER_BEAUTY1
+ dw_const GameCornerClerkText, TEXT_GAMECORNER_CLERK
+ dw_const GameCornerMiddleAgedMan1Text, TEXT_GAMECORNER_MIDDLE_AGED_MAN1
+ dw_const GameCornerBeauty2Text, TEXT_GAMECORNER_BEAUTY2
+ dw_const GameCornerFishingGuru1Text, TEXT_GAMECORNER_FISHING_GURU1
+ dw_const GameCornerMiddleAgedWomanText, TEXT_GAMECORNER_MIDDLE_AGED_WOMAN
+ dw_const GameCornerGymGuideText, TEXT_GAMECORNER_GYM_GUIDE
+ dw_const GameCornerGamblerText, TEXT_GAMECORNER_GAMBLER
+ dw_const GameCornerMiddleAgedMan2Text, TEXT_GAMECORNER_MIDDLE_AGED_MAN2
+ dw_const GameCornerFishingGuru2Text, TEXT_GAMECORNER_FISHING_GURU2
+ dw_const GameCornerRocketText, TEXT_GAMECORNER_ROCKET
+ dw_const GameCornerPosterText, TEXT_GAMECORNER_POSTER
+ dw_const GameCornerRocketAfterBattleText, TEXT_GAMECORNER_ROCKET_AFTER_BATTLE
-CeladonGameCornerText1:
- text_far _CeladonGameCornerText1
+GameCornerBeauty1Text:
+ text_far _GameCornerBeauty1Text
text_end
-CeladonGameCornerText2:
+GameCornerClerkText:
text_asm
- call CeladonGameCornerScript_48f1e
- ld hl, CeladonGameCornerText_48d22
+ ; Show player's coins
+ call GameCornerDrawCoinBox
+ ld hl, .DoYouNeedSomeGameCoins
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_48d0f
+ jr nz, .declined
+ ; Can only get more coins if you
+ ; - have the Coin Case
ld b, COIN_CASE
call IsItemInBag
- jr z, .asm_48d19
+ jr z, .no_coin_case
+ ; - have room in the Coin Case for at least 9 coins
call Has9990Coins
- jr nc, .asm_48d14
+ jr nc, .coin_case_full
+ ; - have at least 1000 yen
xor a
ldh [hMoney], a
ldh [hMoney + 2], a
ld a, $10
ldh [hMoney + 1], a
call HasEnoughMoney
- jr nc, .asm_48cdb
- ld hl, CeladonGameCornerText_48d31
- jr .asm_48d1c
-.asm_48cdb
+ jr nc, .buy_coins
+ ld hl, .CantAffordTheCoins
+ jr .print_ret
+.buy_coins
+ ; Spend 1000 yen
xor a
ldh [hMoney], a
ldh [hMoney + 2], a
@@ -172,6 +180,7 @@ CeladonGameCornerText2:
ld de, wPlayerMoney + 2
ld c, $3
predef SubBCDPredef
+ ; Receive 50 coins
xor a
ldh [hUnusedCoinsByte], a
ldh [hCoins], a
@@ -181,64 +190,65 @@ CeladonGameCornerText2:
ld hl, hCoins + 1
ld c, $2
predef AddBCDPredef
- call CeladonGameCornerScript_48f1e
- ld hl, CeladonGameCornerText_48d27
- jr .asm_48d1c
-.asm_48d0f
- ld hl, CeladonGameCornerText_48d2c
- jr .asm_48d1c
-.asm_48d14
- ld hl, CeladonGameCornerText_48d36
- jr .asm_48d1c
-.asm_48d19
- ld hl, CeladonGameCornerText_48d3b
-.asm_48d1c
+ ; Update display
+ call GameCornerDrawCoinBox
+ ld hl, .ThanksHereAre50Coins
+ jr .print_ret
+.declined
+ ld hl, .PleaseComePlaySometime
+ jr .print_ret
+.coin_case_full
+ ld hl, .CoinCaseIsFull
+ jr .print_ret
+.no_coin_case
+ ld hl, .DontHaveCoinCase
+.print_ret
call PrintText
jp TextScriptEnd
-CeladonGameCornerText_48d22:
- text_far _CeladonGameCornerText_48d22
+.DoYouNeedSomeGameCoins:
+ text_far _GameCornerClerkDoYouNeedSomeGameCoinsText
text_end
-CeladonGameCornerText_48d27:
- text_far _CeladonGameCornerText_48d27
+.ThanksHereAre50Coins:
+ text_far _GameCornerClerkThanksHereAre50CoinsText
text_end
-CeladonGameCornerText_48d2c:
- text_far _CeladonGameCornerText_48d2c
+.PleaseComePlaySometime:
+ text_far _GameCornerClerkPleaseComePlaySometimeText
text_end
-CeladonGameCornerText_48d31:
- text_far _CeladonGameCornerText_48d31
+.CantAffordTheCoins:
+ text_far _GameCornerClerkCantAffordTheCoinsText
text_end
-CeladonGameCornerText_48d36:
- text_far _CeladonGameCornerText_48d36
+.CoinCaseIsFull:
+ text_far _GameCornerClerkCoinCaseIsFullText
text_end
-CeladonGameCornerText_48d3b:
- text_far _CeladonGameCornerText_48d3b
+.DontHaveCoinCase:
+ text_far _GameCornerClerkDontHaveCoinCaseText
text_end
-CeladonGameCornerText3:
- text_far _CeladonGameCornerText3
+GameCornerMiddleAgedMan1Text:
+ text_far _GameCornerMiddleAgedMan1Text
text_end
-CeladonGameCornerText4:
- text_far _CeladonGameCornerText4
+GameCornerBeauty2Text:
+ text_far _GameCornerBeauty2Text
text_end
-CeladonGameCornerText5:
+GameCornerFishingGuru1Text:
text_asm
CheckEvent EVENT_GOT_10_COINS
- jr nz, .asm_48d89
- ld hl, CeladonGameCornerText_48d9c
+ jr nz, .alreadyGotNpcCoins
+ ld hl, .WantToPlayText
call PrintText
ld b, COIN_CASE
call IsItemInBag
- jr z, .asm_48d93
+ jr z, .dontHaveCoinCase
call Has9990Coins
- jr nc, .asm_48d8e
+ jr nc, .coinCaseFull
xor a
ldh [hUnusedCoinsByte], a
ldh [hCoins], a
@@ -251,74 +261,74 @@ CeladonGameCornerText5:
SetEvent EVENT_GOT_10_COINS
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, Received10CoinsText
- jr .asm_48d96
-.asm_48d89
- ld hl, CeladonGameCornerText_48dac
- jr .asm_48d96
-.asm_48d8e
- ld hl, CeladonGameCornerText_48da7
- jr .asm_48d96
-.asm_48d93
- ld hl, CeladonGameCornerText_48f19
-.asm_48d96
+ ld hl, .Received10CoinsText
+ jr .print_ret
+.alreadyGotNpcCoins
+ ld hl, .WinsComeAndGoText
+ jr .print_ret
+.coinCaseFull
+ ld hl, .DontNeedMyCoinsText
+ jr .print_ret
+.dontHaveCoinCase
+ ld hl, GameCornerOopsForgotCoinCaseText
+.print_ret
call PrintText
jp TextScriptEnd
-CeladonGameCornerText_48d9c:
- text_far _CeladonGameCornerText_48d9c
+.WantToPlayText:
+ text_far _GameCornerFishingGuru1WantToPlayText
text_end
-Received10CoinsText:
- text_far _Received10CoinsText
+.Received10CoinsText:
+ text_far _GameCornerFishingGuru1Received10CoinsText
sound_get_item_1
text_end
-CeladonGameCornerText_48da7:
- text_far _CeladonGameCornerText_48da7
+.DontNeedMyCoinsText:
+ text_far _GameCornerFishingGuru1DontNeedMyCoinsText
text_end
-CeladonGameCornerText_48dac:
- text_far _CeladonGameCornerText_48dac
+.WinsComeAndGoText:
+ text_far _GameCornerFishingGuru1WinsComeAndGoText
text_end
-CeladonGameCornerText6:
- text_far _CeladonGameCornerText6
+GameCornerMiddleAgedWomanText:
+ text_far _GameCornerMiddleAgedWomanText
text_end
-CeladonGameCornerText7:
+GameCornerGymGuideText:
text_asm
CheckEvent EVENT_BEAT_ERIKA
- ld hl, CeladonGameCornerText_48dca
- jr z, .asm_48dc4
- ld hl, CeladonGameCornerText_48dcf
-.asm_48dc4
+ ld hl, GameCornerGymGuideChampInMakingText
+ jr z, .not_defeated
+ ld hl, GameCornerGymGuideTheyOfferRarePokemonText
+.not_defeated
call PrintText
jp TextScriptEnd
-CeladonGameCornerText_48dca:
- text_far _CeladonGameCornerText_48dca
+GameCornerGymGuideChampInMakingText:
+ text_far _GameCornerGymGuideChampInMakingText
text_end
-CeladonGameCornerText_48dcf:
- text_far _CeladonGameCornerText_48dcf
+GameCornerGymGuideTheyOfferRarePokemonText:
+ text_far _GameCornerGymGuideTheyOfferRarePokemonText
text_end
-CeladonGameCornerText8:
- text_far _CeladonGameCornerText8
+GameCornerGamblerText:
+ text_far _GameCornerGamblerText
text_end
-CeladonGameCornerText9:
+GameCornerMiddleAgedMan2Text:
text_asm
CheckEvent EVENT_GOT_20_COINS_2
- jr nz, .asm_48e13
- ld hl, CeladonGameCornerText_48e26
+ jr nz, .alreadyGotNpcCoins
+ ld hl, .WantSomeCoinsText
call PrintText
ld b, COIN_CASE
call IsItemInBag
- jr z, .asm_48e1d
+ jr z, .dontHaveCoinCase
call Has9990Coins
- jr nc, .asm_48e18
+ jr nc, .coinCaseFull
xor a
ldh [hUnusedCoinsByte], a
ldh [hCoins], a
@@ -329,48 +339,48 @@ CeladonGameCornerText9:
ld c, $2
predef AddBCDPredef
SetEvent EVENT_GOT_20_COINS_2
- ld hl, Received20CoinsText
- jr .asm_48e20
-.asm_48e13
- ld hl, CeladonGameCornerText_48e36
- jr .asm_48e20
-.asm_48e18
- ld hl, CeladonGameCornerText_48e31
- jr .asm_48e20
-.asm_48e1d
- ld hl, CeladonGameCornerText_48f19
-.asm_48e20
+ ld hl, .Received20CoinsText
+ jr .print_ret
+.alreadyGotNpcCoins
+ ld hl, .INeedMoreCoinsText
+ jr .print_ret
+.coinCaseFull
+ ld hl, .YouHaveLotsOfCoinsText
+ jr .print_ret
+.dontHaveCoinCase
+ ld hl, GameCornerOopsForgotCoinCaseText
+.print_ret
call PrintText
jp TextScriptEnd
-CeladonGameCornerText_48e26:
- text_far _CeladonGameCornerText_48e26
+.WantSomeCoinsText:
+ text_far _GameCornerMiddleAgedMan2WantSomeCoinsText
text_end
-Received20CoinsText:
- text_far _Received20CoinsText
+.Received20CoinsText:
+ text_far _GameCornerMiddleAgedMan2Received20CoinsText
sound_get_item_1
text_end
-CeladonGameCornerText_48e31:
- text_far _CeladonGameCornerText_48e31
+.YouHaveLotsOfCoinsText:
+ text_far _GameCornerMiddleAgedMan2YouHaveLotsOfCoinsText
text_end
-CeladonGameCornerText_48e36:
- text_far _CeladonGameCornerText_48e36
+.INeedMoreCoinsText:
+ text_far _GameCornerMiddleAgedMan2INeedMoreCoinsText
text_end
-CeladonGameCornerText10:
+GameCornerFishingGuru2Text:
text_asm
CheckEvent EVENT_GOT_20_COINS
- jr nz, .asm_48e75
- ld hl, CeladonGameCornerText_48e88
+ jr nz, .alreadyGotNpcCoins
+ ld hl, .ThrowingMeOffText
call PrintText
ld b, COIN_CASE
call IsItemInBag
- jr z, .asm_48e7f
+ jr z, .dontHaveCoinCase
call Has9990Coins
- jr z, .asm_48e7a
+ jr z, .coinCaseFull
xor a
ldh [hUnusedCoinsByte], a
ldh [hCoins], a
@@ -381,46 +391,46 @@ CeladonGameCornerText10:
ld c, $2
predef AddBCDPredef
SetEvent EVENT_GOT_20_COINS
- ld hl, CeladonGameCornerText_48e8d
- jr .asm_48e82
-.asm_48e75
- ld hl, CeladonGameCornerText_48e98
- jr .asm_48e82
-.asm_48e7a
- ld hl, CeladonGameCornerText_48e93
- jr .asm_48e82
-.asm_48e7f
- ld hl, CeladonGameCornerText_48f19
-.asm_48e82
+ ld hl, .Received20CoinsText
+ jr .print_ret
+.alreadyGotNpcCoins
+ ld hl, .CloselyWatchTheReelsText
+ jr .print_ret
+.coinCaseFull
+ ld hl, .YouGotYourOwnCoinsText
+ jr .print_ret
+.dontHaveCoinCase
+ ld hl, GameCornerOopsForgotCoinCaseText
+.print_ret
call PrintText
jp TextScriptEnd
-CeladonGameCornerText_48e88:
- text_far _CeladonGameCornerText_48e88
+.ThrowingMeOffText:
+ text_far _GameCornerFishingGuru2ThrowingMeOffText
text_end
-CeladonGameCornerText_48e8d:
- text_far _CeladonGameCornerText_48e8d
+.Received20CoinsText:
+ text_far _GameCornerFishingGuru2Received20CoinsText
sound_get_item_1
text_end
-CeladonGameCornerText_48e93:
- text_far _CeladonGameCornerText_48e93
+.YouGotYourOwnCoinsText:
+ text_far _GameCornerFishingGuru2YouGotYourOwnCoinsText
text_end
-CeladonGameCornerText_48e98:
- text_far _CeladonGameCornerText_48e98
+.CloselyWatchTheReelsText:
+ text_far _GameCornerFishingGuru2CloselyWatchTheReelsText
text_end
-CeladonGameCornerText11:
+GameCornerRocketText:
text_asm
- ld hl, CeladonGameCornerText_48ece
+ ld hl, .ImGuardingThisPosterText
call PrintText
ld hl, wd72d
set 6, [hl]
set 7, [hl]
- ld hl, CeladonGameCornerText_48ed3
- ld de, CeladonGameCornerText_48ed3
+ ld hl, .BattleEndText
+ ld de, .BattleEndText
call SaveEndBattleTextPointers
ldh a, [hSpriteIndex]
ld [wSpriteIndex], a
@@ -430,27 +440,27 @@ CeladonGameCornerText11:
ldh [hJoyHeld], a
ldh [hJoyPressed], a
ldh [hJoyReleased], a
- ld a, $1
+ ld a, SCRIPT_GAMECORNER_ROCKET_BATTLE
ld [wGameCornerCurScript], a
jp TextScriptEnd
-CeladonGameCornerText_48ece:
- text_far _CeladonGameCornerText_48ece
+.ImGuardingThisPosterText:
+ text_far _GameCornerRocketImGuardingThisPosterText
text_end
-CeladonGameCornerText_48ed3:
- text_far _CeladonGameCornerText_48ed3
+.BattleEndText:
+ text_far _GameCornerRocketBattleEndText
text_end
-CeladonGameCornerText13:
- text_far _CeladonGameCornerText_48ed8
+GameCornerRocketAfterBattleText:
+ text_far _GameCornerRocketAfterBattleText
text_end
-CeladonGameCornerText12:
+GameCornerPosterText:
text_asm
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, CeladonGameCornerText_48f09
+ ld hl, .SwitchBehindPosterText
call PrintText
call WaitForSoundToFinish
ld a, SFX_GO_INSIDE
@@ -463,19 +473,19 @@ CeladonGameCornerText12:
predef ReplaceTileBlock
jp TextScriptEnd
-CeladonGameCornerText_48f09:
- text_far _CeladonGameCornerText_48f09
+.SwitchBehindPosterText:
+ text_far _GameCornerPosterSwitchBehindPosterText
text_asm
ld a, SFX_SWITCH
call PlaySound
call WaitForSoundToFinish
jp TextScriptEnd
-CeladonGameCornerText_48f19:
- text_far _CeladonGameCornerText_48f19
+GameCornerOopsForgotCoinCaseText:
+ text_far _GameCornerOopsForgotCoinCaseText
text_end
-CeladonGameCornerScript_48f1e:
+GameCornerDrawCoinBox:
ld hl, wd730
set 6, [hl]
hlcoord 11, 0