diff options
Diffstat (limited to 'scripts/OaksLab.asm')
-rwxr-xr-x | scripts/OaksLab.asm | 911 |
1 files changed, 417 insertions, 494 deletions
diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 11abdf65..04f31d2a 100755 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -7,7 +7,8 @@ OaksLab_Script: ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, OaksLab_ScriptPointers ld a, [wOaksLabCurScript] - jp CallFunctionInTable + call CallFunctionInTable + ret OaksLab_ScriptPointers: dw OaksLabScript0 @@ -29,6 +30,10 @@ OaksLab_ScriptPointers: dw OaksLabScript16 dw OaksLabScript17 dw OaksLabScript18 + dw OaksLabScript19 + dw OaksLabScript20 + dw OaksLabScript21 + dw OaksLabScript22 OaksLabScript0: CheckEvent EVENT_OAK_APPEARED_IN_PALLET @@ -47,7 +52,7 @@ OaksLabScript0: ret OaksLabScript1: - ld a, $8 + ld a, $6 ld [H_SPRITEINDEX], a ld de, OakEntryMovement call MoveSprite @@ -90,7 +95,7 @@ OaksLabScript3: xor a ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - ld a, $5 + ld a, $3 ld [H_SPRITEINDEX], a xor a ld [hSpriteFacingDirection], a @@ -115,7 +120,6 @@ OaksLabScript4: ld a, SPRITE_FACING_UP ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - call UpdateSprites ld hl, wFlags_D733 res 1, [hl] call PlayDefaultMusic @@ -125,24 +129,28 @@ OaksLabScript4: ret OaksLabScript5: + SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON ld a, $fc ld [wJoyIgnore], a - ld a, $11 + ld a, $d ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 - ld a, $12 + ld a, $e ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 - ld a, $13 + ld a, $2 + ld [wSpriteStateData1 + 1 * $10 + 1], a + ld a, SPRITE_FACING_UP + ld [wSpriteStateData1 + 1 * $10 + 9], a + ld a, $f ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 - ld a, $14 + ld a, $10 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON xor a ld [wJoyIgnore], a @@ -154,7 +162,7 @@ OaksLabScript6: ld a, [wYCoord] cp $6 ret nz - ld a, $5 + ld a, $3 ld [H_SPRITEINDEX], a xor a ; SPRITE_FACING_DOWN ld [hSpriteFacingDirection], a @@ -165,7 +173,7 @@ OaksLabScript6: ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call UpdateSprites - ld a, $c + ld a, $a ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 @@ -191,176 +199,130 @@ OaksLabScript7: ret OaksLabScript8: - ld a, [wPlayerStarter] - cp STARTER1 - jr z, .Charmander - cp STARTER2 - jr z, .Squirtle - jr .Bulbasaur -.Charmander - ld de, .MiddleBallMovement1 - ld a, [wYCoord] - cp $4 ; is the player standing below the table? - jr z, .moveBlue - ld de, .MiddleBallMovement2 - jr .moveBlue - -.MiddleBallMovement1 - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_UP - db $FF - -.MiddleBallMovement2 - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db $FF - -.Squirtle - ld de, .RightBallMovement1 - ld a, [wYCoord] - cp $4 ; is the player standing below the table? - jr z, .moveBlue - ld de, .RightBallMovement2 - jr .moveBlue - -.RightBallMovement1 - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_UP - db $FF - -.RightBallMovement2 - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db NPC_MOVEMENT_RIGHT - db $FF - -.Bulbasaur - ld de, .LeftBallMovement1 - ld a, [wXCoord] - cp $9 ; is the player standing to the right of the table? - jr nz, .moveBlue - push hl - ld a, $1 - ld [H_SPRITEINDEX], a - ld a, $4 - ld [H_SPRITEDATAOFFSET], a - call GetPointerWithinSpriteStateData1 - push hl - ld [hl], $4c - inc hl - inc hl - ld [hl], $0 - pop hl - inc h - ld [hl], $8 - inc hl - ld [hl], $9 - ld de, .LeftBallMovement2 ; the rival is not currently onscreen, so account for that - pop hl - jr .moveBlue - -.LeftBallMovement1 - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_RIGHT ; not yet terminated! -.LeftBallMovement2 - db NPC_MOVEMENT_RIGHT - db $FF - -.moveBlue ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a + ld de, .SonyPushesPlayerAwayFromEeveeBall call MoveSprite - ld a, $9 ld [wOaksLabCurScript], a ret +.SonyPushesPlayerAwayFromEeveeBall + db $00 + db $07 + db $07 + db $07 + db $FF + OaksLabScript9: ld a, [wd730] bit 0, a - ret nz - ld a, $fc - ld [wJoyIgnore], a + jr nz, .asm_1c564 + ld a, HS_STARTER_BALL_1 + ld [wMissableObjectIndex], a + predef HideObject ld a, $1 ld [H_SPRITEINDEX], a ld a, SPRITE_FACING_UP ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - ld a, $d - ld [hSpriteIndexOrTextID], a - call DisplayTextID - ld a, [wRivalStarterBallSpriteIndex] - cp $2 - jr nz, .rivalDidNotChoseBall1 - ld a, HS_STARTER_BALL_1 - jr .hideBallAndContinue -.rivalDidNotChoseBall1 - cp $3 - jr nz, .rivalChoseBall3 - ld a, HS_STARTER_BALL_2 - jr .hideBallAndContinue -.rivalChoseBall3 - ld a, HS_STARTER_BALL_3 -.hideBallAndContinue - ld [wMissableObjectIndex], a - predef HideObject - call Delay3 - ld a, [wRivalStarterTemp] + ld a, 1 ld [wRivalStarter], a - ld [wcf91], a + ld a, EEVEE ld [wd11e], a call GetMonName + ld a, $FF ^ (A_BUTTON | B_BUTTON) + ld [wJoyIgnore], a + ld a, $11 + ld [hSpriteIndexOrTextID], a + call DisplayTextID + + ld a, $a + ld [wOaksLabCurScript], a + ret + +.asm_1c564 + ld a, [wYCoord] + cp $4 + ret nz + ld a, [wNPCNumScriptedSteps] + cp 1 + ret nz + ld a, PLAYER_DIR_LEFT + ld [wPlayerMovingDirection], a + ld a, $2 + ld [wSimulatedJoypadStatesIndex], a + ld a, D_RIGHT + ld [wSimulatedJoypadStatesEnd], a + ld [wSimulatedJoypadStatesEnd + 1], a + call StartSimulatingJoypadStates + ret + +OaksLabScript10: + ld a, [wYCoord] + cp $4 + jr z, .asm_1c599 ld a, $1 - ld [H_SPRITEINDEX], a - ld a, SPRITE_FACING_UP - ld [hSpriteFacingDirection], a - call SetSpriteFacingDirectionAndDelay - ld a, $e + ld [wSimulatedJoypadStatesIndex], a + ld a, D_LEFT + ld [wSimulatedJoypadStatesEnd], a + jr .asm_1c5a6 + +.asm_1c599 + ld hl, wSimulatedJoypadStatesEnd + ld de, OaksLabRLE_PlayerWalksToOak + call DecodeRLEList + dec a + ld [wSimulatedJoypadStatesIndex], a +.asm_1c5a6 + call StartSimulatingJoypadStates + ld a, $b + ld [wOaksLabCurScript], a + ret + +OaksLabRLE_PlayerWalksToOak: + db D_UP, 2 + db D_LEFT, 3 + db D_DOWN, 1 + db D_LEFT, 1 + db $FF + +OaksLabScript11: + ld a, [wSimulatedJoypadStatesIndex] + and a + ret nz + ld a, $12 ld [hSpriteIndexOrTextID], a call DisplayTextID - SetEvent EVENT_GOT_STARTER xor a ld [wJoyIgnore], a - ld a, $a + ld a, $c ld [wOaksLabCurScript], a ret -OaksLabScript10: +OaksLabScript12: ld a, [wYCoord] cp $6 ret nz + ld a, PLAYER_DIR_UP + ld [wPlayerMovingDirection], a ld a, $1 - ld [H_SPRITEINDEX], a - xor a ; SPRITE_FACING_DOWN + ld [hSpriteIndexOrTextID], a + xor a ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - ld a, PLAYER_DIR_UP - ld [wPlayerMovingDirection], a ld c, BANK(Music_MeetRival) ld a, MUSIC_MEET_RIVAL call PlayMusic - ld a, $f + ld a, $b ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 ld [hNPCPlayerRelativePosPerspective], a ld a, $1 swap a - ld [hNPCSpriteOffset], a + ld [hNPCPlayerYDistance], a predef CalcPositionOfPlayerRelativeToNPC ld a, [hNPCPlayerYDistance] dec a @@ -368,40 +330,25 @@ OaksLabScript10: predef FindPathToPlayer ld de, wNPCMovementDirections2 ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a call MoveSprite - - ld a, $b + ld a, $d ld [wOaksLabCurScript], a ret -OaksLabScript11: +OaksLabScript13: ld a, [wd730] bit 0, a ret nz - - ; define which team rival uses, and fight it + ld a, $1 + ld [wSpriteIndex], a + call GetSpritePosition1 ld a, OPP_SONY1 ld [wCurOpponent], a - ld a, [wRivalStarter] - cp STARTER2 - jr nz, .NotSquirtle ld a, $1 - jr .done -.NotSquirtle - cp STARTER3 - jr nz, .Charmander - ld a, $2 - jr .done -.Charmander - ld a, $3 -.done ld [wTrainerNo], a - ld a, $1 - ld [wSpriteIndex], a - call GetSpritePosition1 - ld hl, OaksLabText_1d3be - ld de, OaksLabText_1d3c3 + ld hl, OaksLabRivalDefeatedText + ld de, OaksLabRivalBeatYouText call SaveEndBattleTextPointers ld hl, wd72d set 6, [hl] @@ -410,12 +357,28 @@ OaksLabScript11: ld [wJoyIgnore], a ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a - ld a, $c + ld a, $e ld [wOaksLabCurScript], a ret -OaksLabScript12: - ld a, $f0 +OaksLabScript14: + ld a, $ff + ld [wJoyIgnore], a + + ; If you beat your rival here, his Eevee will evolve into + ; Jolteon if you beat him on Route 22, or Flareon if you + ; skip or lose that battle. + ; Otherwise, it will evolve into Vaporeon. + ld a, [wBattleResult] + and a + ld b, $3 + jr nz, .asm_1c660 + ld b, $2 +.asm_1c660 + ld a, b + ld [wRivalStarter], a + + ld a, $ff ^ (A_BUTTON | B_BUTTON) ld [wJoyIgnore], a ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a @@ -423,66 +386,64 @@ OaksLabScript12: ld a, $1 ld [wSpriteIndex], a call SetSpritePosition1 - ld a, $1 - ld [H_SPRITEINDEX], a - xor a ; SPRITE_FACING_DOWN - ld [hSpriteFacingDirection], a - call SetSpriteFacingDirectionAndDelay + ld a, $2 + ld [wSpriteStateData1 + 1 * $10 + 1], a + xor a + ld [wSpriteStateData1 + 1 * $10 + 9], a predef HealParty SetEvent EVENT_BATTLED_RIVAL_IN_OAKS_LAB - - ld a, $d + ld a, $f ld [wOaksLabCurScript], a ret -OaksLabScript13: +OaksLabScript15: ld c, 20 call DelayFrames - ld a, $10 + ld a, $c ld [hSpriteIndexOrTextID], a call DisplayTextID callba Music_RivalAlternateStart ld a, $1 - ld [H_SPRITEINDEX], a - ld de, .RivalExitMovement + ld [hSpriteIndexOrTextID], a + ld de, .OaksLabMovement_RivalWalksOut1 call MoveSprite ld a, [wXCoord] cp $4 - ; move left or right depending on where the player is standing - jr nz, .moveLeft + jr nz, .asm_1c6bb ld a, NPC_MOVEMENT_RIGHT - jr .next -.moveLeft + jr .asm_1c6bd + +.asm_1c6bb ld a, NPC_MOVEMENT_LEFT -.next +.asm_1c6bd ld [wNPCMovementDirections], a - - ld a, $e + ld a, $10 ld [wOaksLabCurScript], a ret -.RivalExitMovement - db $E0 ; change sprite facing direction - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db NPC_MOVEMENT_DOWN - db $FF +.OaksLabMovement_RivalWalksOut1 + db $e0 + db $00 + db $04 + db $04 + db $04 + db $04 + db $04 + db $ff -OaksLabScript14: +OaksLabScript16: ld a, [wd730] bit 0, a jr nz, .checkRivalPosition + ld a, $ff ^ (A_BUTTON | B_BUTTON) + ld [wJoyIgnore], a ld a, HS_OAKS_LAB_RIVAL ld [wMissableObjectIndex], a predef HideObject - xor a - ld [wJoyIgnore], a - call PlayDefaultMusic ; reset to map music - ld a, $12 + call PlayDefaultMusic + ld a, $11 ld [wOaksLabCurScript], a - jr .done + ret ; make the player keep facing the rival as he walks away .checkRivalPosition ld a, [wNPCNumScriptedSteps] @@ -492,32 +453,54 @@ OaksLabScript14: cp $4 jr nz, .turnPlayerLeft ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + 9], a jr .done .turnPlayerLeft ld a, SPRITE_FACING_LEFT - ld [wSpriteStateData1 + 9], a jr .done .turnPlayerDown cp $4 ret nz - xor a ; ld a, SPRITE_FACING_DOWN - ld [wSpriteStateData1 + 9], a + xor a .done + ld [wSpritePlayerStateData1FacingDirection], a ret -OaksLabScript15: +OaksLabScript17: +; Pikachu comes out + ld a, SPRITE_FACING_UP + ld [wSpritePlayerStateData1FacingDirection], a + ld a, $2 + ld [wPikachuSpawnState], a + callba SchedulePikachuSpawnForAfterText + call EnablePikachuOverworldSpriteDrawing + ld a, $1a + ld [hSpriteIndexOrTextID], a + call DisplayTextID + ld a, $12 + ld [wOaksLabCurScript], a + ret + +OaksLabScript18: + ld a, $1b + ld [hSpriteIndexOrTextID], a + call DisplayTextID + xor a + ld [wJoyIgnore], a + ld a, $16 + ld [wOaksLabCurScript], a + ret + +OaksLabScript19: xor a ld [hJoyHeld], a call EnableAutoTextBoxDrawing - ld a, $ff - ld [wNewSoundID], a - call PlaySound + call StopAllMusic callba Music_RivalAlternateStart - ld a, $15 + ld a, $13 ld [hSpriteIndexOrTextID], a call DisplayTextID - call OaksLabScript_1d02b + callab Func_f1be0 + call OaksLabScript_1c8b9 ld a, HS_OAKS_LAB_RIVAL ld [wMissableObjectIndex], a predef ShowObject @@ -530,50 +513,50 @@ OaksLabScript15: call FillMemory ld [hl], $ff ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a ld de, wNPCMovementDirections2 call MoveSprite - - ld a, $10 + ld a, $14 ld [wOaksLabCurScript], a ret -OaksLabScript_1cefd: +OaksLabScript_1c78e: ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a ld a, SPRITE_FACING_UP ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay - ld a, $8 - ld [H_SPRITEINDEX], a - xor a ; SPRITE_FACING_DOWN + ld a, $6 + ld [hSpriteIndexOrTextID], a + xor a ld [hSpriteFacingDirection], a - jp SetSpriteFacingDirectionAndDelay + call SetSpriteFacingDirectionAndDelay + ret -OaksLabScript16: +OaksLabScript20: ld a, [wd730] bit 0, a ret nz call EnableAutoTextBoxDrawing call PlayDefaultMusic - ld a, $fc + ld a, $ff ^ (A_BUTTON | B_BUTTON) ld [wJoyIgnore], a - call OaksLabScript_1cefd - ld a, $16 + call OaksLabScript_1c78e + ld a, $14 ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame - call OaksLabScript_1cefd - ld a, $17 + call OaksLabScript_1c78e + ld a, $15 ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame - call OaksLabScript_1cefd - ld a, $18 + call OaksLabScript_1c78e + ld a, $16 ld [hSpriteIndexOrTextID], a call DisplayTextID call DelayFrame - ld a, $19 + ld a, $17 ld [hSpriteIndexOrTextID], a call DisplayTextID call Delay3 @@ -583,20 +566,22 @@ OaksLabScript16: ld a, HS_POKEDEX_2 ld [wMissableObjectIndex], a predef HideObject - call OaksLabScript_1cefd - ld a, $1a + call OaksLabScript_1c78e + ld a, $18 ld [hSpriteIndexOrTextID], a call DisplayTextID ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a ld a, SPRITE_FACING_RIGHT ld [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay call Delay3 - ld a, $1b + ld a, $19 ld [hSpriteIndexOrTextID], a call DisplayTextID SetEvent EVENT_GOT_POKEDEX + ld a, $1 + ld [wViridianCityCurScript], a SetEvent EVENT_OAK_GOT_PARCEL ld a, HS_LYING_OLD_MAN ld [wMissableObjectIndex], a @@ -608,23 +593,20 @@ OaksLabScript16: ld b, 0 ld c, a ld hl, wNPCMovementDirections2 - xor a ; NPC_MOVEMENT_DOWN + xor a call FillMemory ld [hl], $ff - ld a, $ff - ld [wNewSoundID], a - call PlaySound + call StopAllMusic callba Music_RivalAlternateStart ld a, $1 - ld [H_SPRITEINDEX], a + ld [hSpriteIndexOrTextID], a ld de, wNPCMovementDirections2 call MoveSprite - - ld a, $11 + ld a, $15 ld [wOaksLabCurScript], a ret -OaksLabScript17: +OaksLabScript21: ld a, [wd730] bit 0, a ret nz @@ -638,21 +620,18 @@ OaksLabScript17: ld a, HS_ROUTE_22_RIVAL_1 ld [wMissableObjectIndex], a predef ShowObject - ld a, $5 - ld [wPalletTownCurScript], a xor a ld [wJoyIgnore], a - - ld a, $12 + ld a, $16 ld [wOaksLabCurScript], a ret -OaksLabScript18: +OaksLabScript22: ret OaksLabScript_RemoveParcel: ld hl, wBagItems - ld bc, $0000 + ld bc, 0 .loop ld a, [hli] cp $ff @@ -662,47 +641,52 @@ OaksLabScript_RemoveParcel: inc hl inc c jr .loop + .foundParcel ld hl, wNumBagItems ld a, c ld [wWhichPokemon], a - ld a, $1 + ld a, 1 ld [wItemQuantity], a - jp RemoveItemFromInventory + call RemoveItemFromInventory + ret -OaksLabScript_1d02b: +OaksLabScript_1c8b9: ld a, $7c ld [$ffeb], a ld a, $8 ld [$ffee], a ld a, [wYCoord] - cp $3 - jr nz, .asm_1d045 + cp 3 + jr nz, .asm_1c8d3 ld a, $4 ld [wNPCMovementDirections2Index], a ld a, $30 ld b, $b - jr .asm_1d068 -.asm_1d045 + jr .asm_1c8f6 + +.asm_1c8d3 cp $1 - jr nz, .asm_1d054 + jr nz, .asm_1c8e2 ld a, $2 ld [wNPCMovementDirections2Index], a ld a, $30 ld b, $9 - jr .asm_1d068 -.asm_1d054 + jr .asm_1c8f6 + +.asm_1c8e2 ld a, $3 ld [wNPCMovementDirections2Index], a ld b, $a ld a, [wXCoord] cp $4 - jr nz, .asm_1d066 + jr nz, .asm_1c8f4 ld a, $40 - jr .asm_1d068 -.asm_1d066 + jr .asm_1c8f6 + +.asm_1c8f4 ld a, $20 -.asm_1d068 +.asm_1c8f6 ld [$ffec], a ld a, b ld [$ffed], a @@ -716,7 +700,7 @@ OaksLabScript_1d076: ld a, l ld [wMapTextPtr], a ld a, h - ld [wMapTextPtr+1], a + ld [wMapTextPtr + 1], a ret OaksLab_TextPointers: @@ -758,8 +742,6 @@ OaksLab_TextPointers2: dw OaksLabText7 dw OaksLabText8 dw OaksLabText9 - dw OaksLabText10 - dw OaksLabText11 OaksLabText1: TX_ASM @@ -769,7 +751,7 @@ OaksLabText1: call PrintText jr .done .beforeChooseMon - bit 2, a + CheckEventReuseA EVENT_GOT_STARTER jr nz, .afterChooseMon ld hl, OaksLabText40 call PrintText @@ -794,42 +776,12 @@ OaksLabText41: OaksLabText2: TX_ASM - ld a, STARTER2 - ld [wRivalStarterTemp], a - ld a, $3 - ld [wRivalStarterBallSpriteIndex], a - ld a, STARTER1 - ld b, $2 - jr OaksLabScript_1d133 - -OaksLabText3: - TX_ASM - ld a, STARTER3 - ld [wRivalStarterTemp], a - ld a, $4 - ld [wRivalStarterBallSpriteIndex], a - ld a, STARTER2 - ld b, $3 - jr OaksLabScript_1d133 - -OaksLabText4: - TX_ASM - ld a, STARTER1 - ld [wRivalStarterTemp], a - ld a, $2 - ld [wRivalStarterBallSpriteIndex], a - ld a, STARTER3 - ld b, $4 - -OaksLabScript_1d133: - ld [wcf91], a - ld [wd11e], a - ld a, b - ld [wSpriteIndex], a - CheckEvent EVENT_GOT_STARTER - jp nz, OaksLabScript_1d22d - CheckEventReuseA EVENT_OAK_ASKED_TO_CHOOSE_MON - jr nz, OaksLabScript_1d157 + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + CheckEvent EVENT_OAK_ASKED_TO_CHOOSE_MON + jr nz, OaksLabScript_1c9ac + ld a, $0 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld hl, OaksLabText39 call PrintText jp TextScriptEnd @@ -838,209 +790,107 @@ OaksLabText39: TX_FAR _OaksLabText39 db "@" -OaksLabScript_1d157: - ld a, $5 - ld [H_SPRITEINDEX], a - ld a, $9 - ld [H_SPRITEDATAOFFSET], a - call GetPointerWithinSpriteStateData1 - ld [hl], SPRITE_FACING_DOWN - ld a, $1 - ld [H_SPRITEINDEX], a - ld a, $9 - ld [H_SPRITEDATAOFFSET], a - call GetPointerWithinSpriteStateData1 - ld [hl], SPRITE_FACING_RIGHT - ld hl, wd730 - set 6, [hl] - predef StarterDex - ld hl, wd730 - res 6, [hl] - call ReloadMapData - ld c, 10 - call DelayFrames - ld a, [wSpriteIndex] - cp $2 - jr z, OaksLabLookAtCharmander - cp $3 - jr z, OaksLabLookAtSquirtle - jr OaksLabLookAtBulbasaur - -OaksLabLookAtCharmander: - ld hl, OaksLabCharmanderText - jr OaksLabMonChoiceMenu -OaksLabCharmanderText: - TX_FAR _OaksLabCharmanderText - db "@" - -OaksLabLookAtSquirtle: - ld hl, OaksLabSquirtleText - jr OaksLabMonChoiceMenu -OaksLabSquirtleText: - TX_FAR _OaksLabSquirtleText - db "@" - -OaksLabLookAtBulbasaur: - ld hl, OaksLabBulbasaurText - jr OaksLabMonChoiceMenu -OaksLabBulbasaurText: - TX_FAR _OaksLabBulbasaurText - db "@" - -OaksLabMonChoiceMenu: - call PrintText - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - call YesNoChoice ; yes/no menu - ld a, [wCurrentMenuItem] - and a - jr nz, OaksLabMonChoiceEnd - ld a, [wcf91] - ld [wPlayerStarter], a - ld [wd11e], a - call GetMonName - ld a, [wSpriteIndex] - cp $2 - jr nz, .asm_1d1db - ld a, HS_STARTER_BALL_1 - jr .asm_1d1e5 -.asm_1d1db - cp $3 - jr nz, .asm_1d1e3 - ld a, HS_STARTER_BALL_2 - jr .asm_1d1e5 -.asm_1d1e3 - ld a, HS_STARTER_BALL_3 -.asm_1d1e5 - ld [wMissableObjectIndex], a - predef HideObject +OaksLabScript_1c9ac: ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, OaksLabMonEnergeticText - call PrintText - ld hl, OaksLabReceivedMonText - call PrintText - xor a ; PLAYER_PARTY_DATA - ld [wMonDataLocation], a - ld a, 5 - ld [wCurEnemyLVL], a - ld a, [wcf91] - ld [wd11e], a - call AddPartyMon - ld hl, wd72e - set 3, [hl] - ld a, $fc - ld [wJoyIgnore], a + ld [wEmotionBubbleSpriteIndex], a + xor a ; EXCLAMATION_BUBBLE + ld [wWhichEmotionBubble], a + predef EmotionBubble ld a, $8 ld [wOaksLabCurScript], a -OaksLabMonChoiceEnd: - jp TextScriptEnd - -OaksLabMonEnergeticText: - TX_FAR _OaksLabMonEnergeticText - db "@" - -OaksLabReceivedMonText: - TX_FAR _OaksLabReceivedMonText - TX_SFX_KEY_ITEM - db "@" - -OaksLabScript_1d22d: - ld a, $5 - ld [H_SPRITEINDEX], a - ld a, $9 - ld [H_SPRITEDATAOFFSET], a - call GetPointerWithinSpriteStateData1 - ld [hl], $0 - ld hl, OaksLabLastMonText - call PrintText jp TextScriptEnd -OaksLabLastMonText: - TX_FAR _OaksLabLastMonText - db "@" - -OaksLabText32: -OaksLabText5: +OaksLabText3: TX_ASM CheckEvent EVENT_PALLET_AFTER_GETTING_POKEBALLS - jr nz, .asm_1d266 + jr nz, .asm_1c9d9 ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld a, [wNumSetBits] cp 2 - jr c, .asm_1d279 - CheckEvent EVENT_GOT_POKEDEX - jr z, .asm_1d279 -.asm_1d266 - ld hl, OaksLabText_1d31d + jr c, .asm_1c9ec +.asm_1c9d9 + ld hl, OaksLabText_1ca9f call PrintText ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a predef DisplayDexRating - jp .asm_1d2ed -.asm_1d279 + jp .asm_1ca6f + +.asm_1c9ec ld b, POKE_BALL call IsItemInBag - jr nz, .asm_1d2e7 + jr nz, .asm_1ca69 + ld hl, wPokedexOwned + ld b, wPokedexOwnedEnd - wPokedexOwned + call CountSetBits + ld a, [wNumSetBits] + cp 2 + jr nc, .asm_1ca69 CheckEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE - jr nz, .asm_1d2d0 + jr nz, .asm_1ca52 CheckEvent EVENT_GOT_POKEDEX - jr nz, .asm_1d2c8 + jr nz, .asm_1ca4a CheckEventReuseA EVENT_BATTLED_RIVAL_IN_OAKS_LAB - jr nz, .asm_1d2a9 + jr nz, .asm_1ca2b ld a, [wd72e] bit 3, a - jr nz, .asm_1d2a1 - ld hl, OaksLabText_1d2f0 + jr nz, .asm_1ca23 + ld hl, OaksLabText_1ca72 call PrintText - jr .asm_1d2ed -.asm_1d2a1 - ld hl, OaksLabText_1d2f5 + jr .asm_1ca6f + +.asm_1ca23 + ld hl, OaksLabText_1ca77 call PrintText - jr .asm_1d2ed -.asm_1d2a9 + jr .asm_1ca6f + +.asm_1ca2b ld b, OAKS_PARCEL call IsItemInBag - jr nz, .asm_1d2b8 - ld hl, OaksLabText_1d2fa + jr nz, .asm_1ca3a + ld hl, OaksLabText_1ca7c call PrintText - jr .asm_1d2ed -.asm_1d2b8 + jr .asm_1ca6f + +.asm_1ca3a ld hl, OaksLabDeliverParcelText call PrintText call OaksLabScript_RemoveParcel - ld a, $f + ld a, $13 ld [wOaksLabCurScript], a - jr .asm_1d2ed -.asm_1d2c8 + jr .asm_1ca6f + +.asm_1ca4a ld hl, OaksLabAroundWorldText call PrintText - jr .asm_1d2ed -.asm_1d2d0 + jr .asm_1ca6f + +.asm_1ca52 CheckAndSetEvent EVENT_GOT_POKEBALLS_FROM_OAK - jr nz, .asm_1d2e7 + jr nz, .asm_1ca69 lb bc, POKE_BALL, 5 call GiveItem ld hl, OaksLabGivePokeballsText call PrintText - jr .asm_1d2ed -.asm_1d2e7 + jr .asm_1ca6f + +.asm_1ca69 ld hl, OaksLabPleaseVisitText call PrintText -.asm_1d2ed +.asm_1ca6f jp TextScriptEnd -OaksLabText_1d2f0: - TX_FAR _OaksLabText_1d2f0 +OaksLabText_1ca72: + TX_FAR _OaksLabPikachuText db "@" -OaksLabText_1d2f5: +OaksLabText_1ca77: TX_FAR _OaksLabText_1d2f5 db "@" -OaksLabText_1d2fa: +OaksLabText_1ca7c: TX_FAR _OaksLabText_1d2fa db "@" @@ -1064,36 +914,36 @@ OaksLabPleaseVisitText: TX_FAR _OaksLabPleaseVisitText db "@" -OaksLabText_1d31d: +OaksLabText_1ca9f: TX_FAR _OaksLabText_1d31d db "@" -OaksLabText7: -OaksLabText6: +OaksLabText4: +OaksLabText5: TX_ASM - ld hl, OaksLabText_1d32c + ld hl, OaksLabText_1caae call PrintText jp TextScriptEnd -OaksLabText_1d32c: +OaksLabText_1caae: TX_FAR _OaksLabText_1d32c db "@" -OaksLabText8: +OaksLabText6: TX_FAR _OaksLabText8 db "@" -OaksLabText9: +OaksLabText7: TX_ASM - ld hl, OaksLabText_1d340 + ld hl, OaksLabText_1cac2 call PrintText jp TextScriptEnd -OaksLabText_1d340: +OaksLabText_1cac2: TX_FAR _OaksLabText_1d340 db "@" -OaksLabText17: +OaksLabText13: TX_ASM ld hl, OaksLabRivalWaitingText call PrintText @@ -1103,7 +953,7 @@ OaksLabRivalWaitingText: TX_FAR _OaksLabRivalWaitingText db "@" -OaksLabText18: +OaksLabText14: TX_ASM ld hl, OaksLabChooseMonText call PrintText @@ -1113,7 +963,7 @@ OaksLabChooseMonText: TX_FAR _OaksLabChooseMonText db "@" -OaksLabText19: +OaksLabText15: TX_ASM ld hl, OaksLabRivalInterjectionText call PrintText @@ -1123,7 +973,7 @@ OaksLabRivalInterjectionText: TX_FAR _OaksLabRivalInterjectionText db "@" -OaksLabText20: +OaksLabText16: TX_ASM ld hl, OaksLabBePatientText call PrintText @@ -1133,38 +983,89 @@ OaksLabBePatientText: TX_FAR _OaksLabBePatientText db "@" -OaksLabText12: +OaksLabText17: TX_ASM - ld hl, OaksLabLeavingText + ld hl, OaksLabRivalTakesText1 + call PrintText + ld hl, OaksLabRivalTakesText2 + call PrintText + ld hl, OaksLabRivalTakesText3 + call PrintText + ld hl, OaksLabRivalTakesText4 + call PrintText + ld hl, OaksLabRivalTakesText5 call PrintText jp TextScriptEnd -OaksLabLeavingText: - TX_FAR _OaksLabLeavingText +OaksLabRivalTakesText1: + TX_FAR _OaksLabRivalTakesText1 db "@" -OaksLabText13: +OaksLabRivalTakesText2: + TX_FAR _OaksLabRivalTakesText2 + TX_SFX_KEY_ITEM + db "@" + +OaksLabRivalTakesText3: + TX_FAR _OaksLabRivalTakesText3 + db "@" + +OaksLabRivalTakesText4: + TX_FAR _OaksLabRivalTakesText4 + db "@" + +OaksLabRivalTakesText5: + TX_FAR _OaksLabRivalTakesText5 + db "@" + +OaksLabText18: TX_ASM - ld hl, OaksLabRivalPickingMonText + ld a, PIKACHU + ld [wPlayerStarter], a + ld [wd11e], a + call GetMonName + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld hl, OaksLabOakGivesText call PrintText + ld hl, OaksLabRecievedText + call PrintText + xor a + ld [wMonDataLocation], a + ld a, 5 + ld [wCurEnemyLVL], a + ld a, PIKACHU + ld [wd11e], a + ld [wcf91], a + call AddPartyMon + ld a, 163 + ld [wPartyMon1CatchRate], a + call DisablePikachuOverworldSpriteDrawing + SetEvent EVENT_GOT_STARTER + ld hl, wd72e + set 3, [hl] jp TextScriptEnd -OaksLabRivalPickingMonText: - TX_FAR _OaksLabRivalPickingMonText +OaksLabOakGivesText: + TX_FAR _OaksLabOakGivesText db "@" -OaksLabText14: +OaksLabRecievedText: + TX_FAR _OaksLabReceivedText + TX_SFX_KEY_ITEM + db "@" + +OaksLabText10: TX_ASM - ld hl, OaksLabRivalReceivedMonText + ld hl, OaksLabLeavingText call PrintText jp TextScriptEnd -OaksLabRivalReceivedMonText: - TX_FAR _OaksLabRivalReceivedMonText - TX_SFX_KEY_ITEM +OaksLabLeavingText: + TX_FAR _OaksLabLeavingText db "@" -OaksLabText15: +OaksLabText11: TX_ASM ld hl, OaksLabRivalChallengeText call PrintText @@ -1174,15 +1075,15 @@ OaksLabRivalChallengeText: TX_FAR _OaksLabRivalChallengeText db "@" -OaksLabText_1d3be: +OaksLabRivalDefeatedText: TX_FAR _OaksLabText_1d3be db "@" -OaksLabText_1d3c3: +OaksLabRivalBeatYouText: TX_FAR _OaksLabText_1d3c3 db "@" -OaksLabText16: +OaksLabText12: TX_ASM ld hl, OaksLabRivalToughenUpText call PrintText @@ -1192,42 +1093,64 @@ OaksLabRivalToughenUpText: TX_FAR _OaksLabRivalToughenUpText db "@" -OaksLabText21: +OaksLabText26: + TX_ASM + ldpikacry e, PikachuCry2 + callab PlayPikachuSoundClip + ld hl, OaksLabPikachuDislikesPokeballsText1 + call PrintText + jp TextScriptEnd + +OaksLabPikachuDislikesPokeballsText1: + TX_FAR _OaksLabPikachuDislikesPokeballsText1 + db "@" + +OaksLabText27: + TX_ASM + ld hl, OaksLabPikachuDislikesPokeballsText2 + call PrintText + jp TextScriptEnd + +OaksLabPikachuDislikesPokeballsText2: + TX_FAR _OaksLabPikachuDislikesPokeballsText2 + db "@" + +OaksLabText19: TX_FAR _OaksLabText21 db "@" -OaksLabText22: +OaksLabText20: TX_FAR _OaksLabText22 db "@" -OaksLabText23: +OaksLabText21: TX_FAR _OaksLabText23 db "@" -OaksLabText24: +OaksLabText22: TX_FAR _OaksLabText24 db "@" -OaksLabText25: +OaksLabText23: TX_FAR _OaksLabText25 TX_SFX_KEY_ITEM db "@" -OaksLabText26: +OaksLabText24: TX_FAR _OaksLabText26 db "@" -OaksLabText27: +OaksLabText25: TX_FAR _OaksLabText27 db "@" -OaksLabText11: -OaksLabText10: +OaksLabText8: +OaksLabText9: TX_ASM - ld hl, OaksLabText_1d405 + ld hl, OaksLabText_1c31d call PrintText jp TextScriptEnd -OaksLabText_1d405: +OaksLabText_1c31d: TX_FAR _OaksLabText_1d405 db "@" |