From 4efb3e307cd6b4bf267ab0d509f8e5ab498f798e Mon Sep 17 00:00:00 2001 From: Rangi Date: Fri, 6 Nov 2020 10:34:05 -0500 Subject: Sync more with pokered --- scripts/AgathasRoom.asm | 1 - scripts/BikeShop.asm | 3 -- scripts/BrunosRoom.asm | 1 - scripts/CeladonMansion3F.asm | 7 ++- scripts/CeladonMartRoof.asm | 2 +- scripts/CeruleanMelaniesHouse.asm | 106 ++++++++++++++++++++++++++++++++++++++ scripts/CeruleanTradeHouse.asm | 106 -------------------------------------- scripts/CinnabarGym.asm | 2 +- scripts/LancesRoom.asm | 9 ++-- scripts/MtMoonB2F.asm | 1 - scripts/OaksLab.asm | 17 ++---- scripts/PalletTown.asm | 14 +++-- scripts/PewterGym.asm | 1 - scripts/Route22Gate.asm | 2 +- scripts/Route25.asm | 1 - 15 files changed, 125 insertions(+), 148 deletions(-) create mode 100755 scripts/CeruleanMelaniesHouse.asm delete mode 100755 scripts/CeruleanTradeHouse.asm (limited to 'scripts') diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm index 9aa957f5..3c5740e9 100755 --- a/scripts/AgathasRoom.asm +++ b/scripts/AgathasRoom.asm @@ -20,7 +20,6 @@ AgathaShowOrHideExitBlock: jp .setExitBlock .blockExitToNextRoom ld a, $3b - .setExitBlock ld [wNewTileBlockID], a lb bc, 0, 2 diff --git a/scripts/BikeShop.asm b/scripts/BikeShop.asm index e4345e8e..0c5357d2 100755 --- a/scripts/BikeShop.asm +++ b/scripts/BikeShop.asm @@ -14,7 +14,6 @@ BikeShopText1: ld hl, BikeShopText_1d82f call PrintText jp .Done - .asm_260d4 ld b, BIKE_VOUCHER call IsItemInBag @@ -31,12 +30,10 @@ BikeShopText1: ld hl, BikeShopText_1d824 call PrintText jr .Done - .BagFull ld hl, BikeShopText_1d834 call PrintText jr .Done - .asm_41190 ld hl, BikeShopText_1d810 call PrintText diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm index e5ecc1af..578cbb98 100755 --- a/scripts/BrunosRoom.asm +++ b/scripts/BrunosRoom.asm @@ -20,7 +20,6 @@ BrunoShowOrHideExitBlock: jp .setExitBlock .blockExitToNextRoom ld a, $24 - .setExitBlock ld [wNewTileBlockID], a lb bc, 0, 2 diff --git a/scripts/CeladonMansion3F.asm b/scripts/CeladonMansion3F.asm index 0cea70cc..ae1718a0 100755 --- a/scripts/CeladonMansion3F.asm +++ b/scripts/CeladonMansion3F.asm @@ -22,7 +22,7 @@ CeladonMansion3F_TextPointers: ProgrammerText: text_asm call CeladonMansion3_PokedexCount - cp 150 + cp NUM_POKEMON - 1 ; discount Mew ld hl, CeladonMansion3Text_486f5 jr nc, .print ld hl, CeladonMansion3Text_486f0 @@ -41,7 +41,7 @@ CeladonMansion3Text_486f5: GraphicArtistText: text_asm call CeladonMansion3_PokedexCount - cp 150 + cp NUM_POKEMON - 1 ; discount Mew jr nc, .completed ld hl, CeladonMansion3Text_48757 jr .print @@ -103,7 +103,7 @@ CeladonMansion3Text_4876b: WriterText: text_asm call CeladonMansion3_PokedexCount - cp 150 + cp NUM_POKEMON - 1 ; discount Mew ld hl, CeladonMansion3Text_48789 jr nc, .print ld hl, CeladonMansion3Text_48784 @@ -122,7 +122,6 @@ CeladonMansion3Text_48789: DirectorText: text_asm call CeladonMansion3_PokedexCount - ; check pokédex cp NUM_POKEMON - 1 ; discount Mew jr nc, .completed_dex ld hl, .GameDesignerText diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index 1d39670d..473f5f09 100755 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -72,7 +72,7 @@ CeladonMartRoofScript_GiveDrinkToGirl: ld hl, wd730 res 6, [hl] call HandleMenuInput - bit BIT_B_BUTTON, a ; pressed b + bit BIT_B_BUTTON, a ret nz ld hl, wFilteredBagItems ld a, [wCurrentMenuItem] diff --git a/scripts/CeruleanMelaniesHouse.asm b/scripts/CeruleanMelaniesHouse.asm new file mode 100755 index 00000000..ca006506 --- /dev/null +++ b/scripts/CeruleanMelaniesHouse.asm @@ -0,0 +1,106 @@ +CeruleanMelaniesHouse_Script: + call EnableAutoTextBoxDrawing + ret + +CeruleanMelaniesHouse_TextPointers: + dw CeruleanHouse1Text1 + dw CeruleanHouse1Text2 + dw CeruleanHouse1Text3 + dw CeruleanHouse1Text4 + +CeruleanHouse1Text1: + text_asm + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + CheckEvent EVENT_GOT_BULBASAUR_IN_CERULEAN + jr nz, .asm_1cfbf + ld hl, CeruleanHouse1Text_1cfc8 + call PrintText + ld a, [wPikachuHappiness] + cp 147 + jr c, .asm_1cfb3 + ld hl, CeruleanHouse1Text_1cfce + call PrintText + call YesNoChoice + ld a, [wCurrentMenuItem] + and a + jr nz, .asm_1cfb6 + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld a, BULBASAUR + ld [wd11e], a + ld [wcf91], a + call GetMonName + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + lb bc, BULBASAUR, 10 + call GivePokemon + jr nc, .asm_1cfb3 + ld a, [wAddedToParty] + and a + call z, WaitForTextScrollButtonPress + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld hl, CeruleanHouse1Text_1cfd3 + call PrintText + ld a, HS_CERULEAN_BULBASAUR + ld [wMissableObjectIndex], a + predef HideObject + SetEvent EVENT_GOT_BULBASAUR_IN_CERULEAN +.asm_1cfb3 + jp TextScriptEnd + +.asm_1cfb6 + ld hl, CeruleanHouse1Text_1cfdf + call PrintText + jp TextScriptEnd + +.asm_1cfbf + ld hl, CeruleanHouse1Text_1cfd9 + call PrintText + jp TextScriptEnd + +CeruleanHouse1Text_1cfc8: + text_far MelanieText1 + text_waitbutton + text_end + +CeruleanHouse1Text_1cfce: + text_far MelanieText2 + text_end + +CeruleanHouse1Text_1cfd3: + text_far MelanieText3 + text_waitbutton + text_end + +CeruleanHouse1Text_1cfd9: + text_far MelanieText4 + text_waitbutton + text_end + +CeruleanHouse1Text_1cfdf: + text_far MelanieText5 + text_waitbutton + text_end + +CeruleanHouse1Text2: + text_far MelanieBulbasaurText + text_asm + ld a, BULBASAUR + call PlayCry + jp TextScriptEnd + +CeruleanHouse1Text3: + text_far MelanieOddishText + text_asm + ld a, ODDISH + call PlayCry + jp TextScriptEnd + +CeruleanHouse1Text4: + text_far MelanieSandshrewText + text_asm + ld a, SANDSHREW + call PlayCry + jp TextScriptEnd diff --git a/scripts/CeruleanTradeHouse.asm b/scripts/CeruleanTradeHouse.asm deleted file mode 100755 index a6820fdb..00000000 --- a/scripts/CeruleanTradeHouse.asm +++ /dev/null @@ -1,106 +0,0 @@ -CeruleanTradeHouse_Script: - call EnableAutoTextBoxDrawing - ret - -CeruleanTradeHouse_TextPointers: - dw CeruleanHouse1Text1 - dw CeruleanHouse1Text2 - dw CeruleanHouse1Text3 - dw CeruleanHouse1Text4 - -CeruleanHouse1Text1: - text_asm - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - CheckEvent EVENT_GOT_BULBASAUR_IN_CERULEAN - jr nz, .asm_1cfbf - ld hl, CeruleanHouse1Text_1cfc8 - call PrintText - ld a, [wPikachuHappiness] - cp 147 - jr c, .asm_1cfb3 - ld hl, CeruleanHouse1Text_1cfce - call PrintText - call YesNoChoice - ld a, [wCurrentMenuItem] - and a - jr nz, .asm_1cfb6 - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, BULBASAUR - ld [wd11e], a - ld [wcf91], a - call GetMonName - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - lb bc, BULBASAUR, 10 - call GivePokemon - jr nc, .asm_1cfb3 - ld a, [wAddedToParty] - and a - call z, WaitForTextScrollButtonPress - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, CeruleanHouse1Text_1cfd3 - call PrintText - ld a, HS_CERULEAN_BULBASAUR - ld [wMissableObjectIndex], a - predef HideObject - SetEvent EVENT_GOT_BULBASAUR_IN_CERULEAN -.asm_1cfb3 - jp TextScriptEnd - -.asm_1cfb6 - ld hl, CeruleanHouse1Text_1cfdf - call PrintText - jp TextScriptEnd - -.asm_1cfbf - ld hl, CeruleanHouse1Text_1cfd9 - call PrintText - jp TextScriptEnd - -CeruleanHouse1Text_1cfc8: - text_far MelanieText1 - text_waitbutton - text_end - -CeruleanHouse1Text_1cfce: - text_far MelanieText2 - text_end - -CeruleanHouse1Text_1cfd3: - text_far MelanieText3 - text_waitbutton - text_end - -CeruleanHouse1Text_1cfd9: - text_far MelanieText4 - text_waitbutton - text_end - -CeruleanHouse1Text_1cfdf: - text_far MelanieText5 - text_waitbutton - text_end - -CeruleanHouse1Text2: - text_far MelanieBulbasaurText - text_asm - ld a, BULBASAUR - call PlayCry - jp TextScriptEnd - -CeruleanHouse1Text3: - text_far MelanieOddishText - text_asm - ld a, ODDISH - call PlayCry - jp TextScriptEnd - -CeruleanHouse1Text4: - text_far MelanieSandshrewText - text_asm - ld a, SANDSHREW - call PlayCry - jp TextScriptEnd diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm index 529b3be2..7c015a64 100755 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -134,7 +134,7 @@ CinnabarGymScript2: cp $ff jp z, CinnabarGymScript_75792 ld a, [wTrainerHeaderFlagBit] - sub 2 + sub $2 ld c, a ld b, FLAG_TEST EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm index 68d2020e..174a1505 100755 --- a/scripts/LancesRoom.asm +++ b/scripts/LancesRoom.asm @@ -18,22 +18,21 @@ LanceShowOrHideEntranceBlocks: ; open entrance ld a, $31 ld b, $32 - jp .LanceSetEntranceBlocks - + jp .setEntranceBlocks .closeEntrance ld a, $72 ld b, $73 -.LanceSetEntranceBlocks +.setEntranceBlocks ; Replaces the tile blocks so the player can't leave. push bc ld [wNewTileBlockID], a lb bc, 6, 2 - call .LanceSetEntranceBlock + call .SetEntranceBlock pop bc ld a, b ld [wNewTileBlockID], a lb bc, 6, 3 -.LanceSetEntranceBlock +.SetEntranceBlock: predef_jump ReplaceTileBlock ResetLanceScript: diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm index a02d7d42..b2bed1a4 100755 --- a/scripts/MtMoonB2F.asm +++ b/scripts/MtMoonB2F.asm @@ -649,4 +649,3 @@ MtMoon3EndBattleText5: MtMoon3AfterBattleText5: text_far _MtMoon3AfterBattleText5 text_end - diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index e8ef4cbe..a369abed 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -201,13 +201,13 @@ OaksLabScript7: OaksLabScript8: ld a, $1 ldh [hSpriteIndexOrTextID], a - ld de, .SonyPushesPlayerAwayFromEeveeBall + ld de, .RivalPushesPlayerAwayFromEeveeBall call MoveSprite ld a, $9 ld [wOaksLabCurScript], a ret -.SonyPushesPlayerAwayFromEeveeBall +.RivalPushesPlayerAwayFromEeveeBall db $00 db $07 db $07 @@ -593,7 +593,7 @@ OaksLabScript20: ld b, 0 ld c, a ld hl, wNPCMovementDirections2 - xor a + xor a ; NPC_MOVEMENT_DOWN call FillMemory ld [hl], $ff call StopAllMusic @@ -641,7 +641,6 @@ OaksLabScript_RemoveParcel: inc hl inc c jr .loop - .foundParcel ld hl, wNumBagItems ld a, c @@ -664,7 +663,6 @@ OaksLabScript_1c8b9: ld a, $30 ld b, 11 jr .asm_1c8f6 - .asm_1c8d3 cp 1 jr nz, .asm_1c8e2 @@ -673,7 +671,6 @@ OaksLabScript_1c8b9: ld a, $30 ld b, 9 jr .asm_1c8f6 - .asm_1c8e2 ld a, $3 ld [wNPCMovementDirections2Index], a @@ -683,7 +680,6 @@ OaksLabScript_1c8b9: jr nz, .asm_1c8f4 ld a, $40 jr .asm_1c8f6 - .asm_1c8f4 ld a, $20 .asm_1c8f6 @@ -817,7 +813,6 @@ OaksLabText3: ld [wDoNotWaitForButtonPressAfterDisplayingText], a predef DisplayDexRating jp .asm_1ca6f - .asm_1c9ec ld b, POKE_BALL call IsItemInBag @@ -840,12 +835,10 @@ OaksLabText3: ld hl, OaksLabText_1ca72 call PrintText jr .asm_1ca6f - .asm_1ca23 ld hl, OaksLabText_1ca77 call PrintText jr .asm_1ca6f - .asm_1ca2b ld b, OAKS_PARCEL call IsItemInBag @@ -853,7 +846,6 @@ OaksLabText3: ld hl, OaksLabText_1ca7c call PrintText jr .asm_1ca6f - .asm_1ca3a ld hl, OaksLabDeliverParcelText call PrintText @@ -861,12 +853,10 @@ OaksLabText3: ld a, $13 ld [wOaksLabCurScript], a jr .asm_1ca6f - .asm_1ca4a ld hl, OaksLabAroundWorldText call PrintText jr .asm_1ca6f - .asm_1ca52 CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK jr nz, .asm_1ca69 @@ -875,7 +865,6 @@ OaksLabText3: ld hl, OaksLabGivePokeballsText call PrintText jr .asm_1ca6f - .asm_1ca69 ld hl, OaksLabPleaseVisitText call PrintText diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index 28f93411..db2de0d1 100755 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -179,7 +179,7 @@ PalletTownScript6: ld [wSpriteIndex], a xor a ld [wNPCMovementScriptFunctionNum], a - ld a, $1 + ld a, 1 ld [wNPCMovementScriptPointerTableNum], a ldh a, [hLoadedROMBank] ld [wNPCMovementScriptBank], a @@ -191,7 +191,7 @@ PalletTownScript6: PalletTownScript7: ld a, [wNPCMovementScriptPointerTableNum] - and a + and a ; is the movement script over? ret nz ; trigger the next script @@ -201,10 +201,9 @@ PalletTownScript7: PalletTownScript8: CheckEvent EVENT_DAISY_WALKING - jr nz, .asm_18f9e - and $3 ; (EVENT_GOT_TOWN_MAP | EVENT_ENTERED_BLUES_HOUSE) - cp $3 - jr nz, .asm_18f9e + jr nz, .next + CheckBothEventsSet EVENT_GOT_TOWN_MAP, EVENT_ENTERED_BLUES_HOUSE, 1 + jr nz, .next SetEvent EVENT_DAISY_WALKING ld a, HS_DAISY_SITTING ld [wMissableObjectIndex], a @@ -212,8 +211,7 @@ PalletTownScript8: ld a, HS_DAISY_WALKING ld [wMissableObjectIndex], a predef_jump ShowObject - -.asm_18f9e +.next CheckEvent EVENT_GOT_POKEBALLS_FROM_OAK ret z SetEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS_2 diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm index 76a58b71..c8dac1eb 100755 --- a/scripts/PewterGym.asm +++ b/scripts/PewterGym.asm @@ -202,7 +202,6 @@ PewterGymText3: call PrintText .asm_5c512 jp TextScriptEnd - .asm_5c3fa ld hl, PewterGymText_5c41c call PrintText diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm index adbefe8a..e9dab015 100755 --- a/scripts/Route22Gate.asm +++ b/scripts/Route22Gate.asm @@ -62,7 +62,7 @@ Route22Gate_TextPointers: Route22GateText1: text_asm ld a, [wObtainedBadges] - bit 0, a ; BOULDERBADGE + bit BIT_BOULDERBADGE, a jr nz, .asm_1e6f6 ld hl, Route22GateText_1e704 call PrintText diff --git a/scripts/Route25.asm b/scripts/Route25.asm index 400ac9ed..10f907b2 100755 --- a/scripts/Route25.asm +++ b/scripts/Route25.asm @@ -29,7 +29,6 @@ Route25Script_515e1: ld [wMissableObjectIndex], a predef ShowObject jr .asm_5165c - .asm_51638 CheckEventAfterBranchReuseHL EVENT_GOT_SS_TICKET, EVENT_MET_BILL_2 jr z, .asm_5165c -- cgit v1.2.3