diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index 0fed29d5..afde0190 100644 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -244,4 +244,5 @@ DEF SHOW EQU $15 const HS_OLD_SEA_CHART ; E8 X const HS_POKEMON_MANSION_B2F_ITEM_1 ; E9 const HS_POKEMON_MANSION_B2F_ITEM_2 ; EA + const HS_ROUTE_1_OAK ; EB DEF NUM_HS_OBJECTS EQU const_value diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index 693861b5..14177149 100644 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -15,7 +15,7 @@ MapHSPointers: dw NoHS dw SaffronCityHS dw NoHS - dw NoHS + dw Route1HS dw Route2HS dw NoHS dw Route4HS @@ -575,6 +575,8 @@ FarawayIslandInsideHS: PokemonMansionB2FHS: db POKEMON_MANSION_B2F, $03, SHOW db POKEMON_MANSION_B2F, $04, SHOW +Route1HS: + db ROUTE_1, $03, HIDE ; PROF OAK fight. To test, change to SHOW. - PvK db $FF, $01, SHOW ; end assert_table_length NUM_HS_OBJECTS + 1 diff --git a/data/maps/objects/Route1.asm b/data/maps/objects/Route1.asm index b4ae442c..e480c20b 100644 --- a/data/maps/objects/Route1.asm +++ b/data/maps/objects/Route1.asm @@ -9,6 +9,7 @@ Route1_Object: def_object_events object_event 5, 24, SPRITE_YOUNGSTER, WALK, UP_DOWN, 1 ; person object_event 15, 13, SPRITE_YOUNGSTER, WALK, LEFT_RIGHT, 2 ; person + object_event 10, 25, SPRITE_OAK, STAY, RIGHT, 4 ; oak def_warps_to ROUTE_1 diff --git a/ram/wram.asm b/ram/wram.asm index 546db26b..49d4403d 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -2047,7 +2047,7 @@ wBillsHouseCurScript:: db wRoute5GateCurScript:: db wPowerPlantCurScript:: ; overload wRoute7GateCurScript:: db - ds 1 +wRoute1CurScript:: db ; pls work - for oak wSSAnne2FCurScript:: db wSeafoamIslandsB3FCurScript:: db wRoute23CurScript:: db diff --git a/scan_includes.exe.stackdump b/scan_includes.exe.stackdump index 265acfc3..0393dd6d 100644 --- a/scan_includes.exe.stackdump +++ b/scan_includes.exe.stackdump @@ -1,15 +1,15 @@ Exception: STATUS_ACCESS_VIOLATION at rip=00100401246 -rax=FFFFFFF7FFF8CD51 rbx=0000000000000066 rcx=0000000800000010 -rdx=0000000000000000 rsi=00000008000631C8 rdi=0000000000000000 +rax=FFFFFFF7FFF8CD51 rbx=0000000000000818 rcx=0000000800000010 +rdx=0000000000000000 rsi=0000000800059544 rdi=0000000000000000 r8 =00000000FFFFC7C4 r9 =0000000000000000 r10=0000000100000000 r11=0000000100401282 r12=00000008000732B0 r13=0000000100403148 r14=0000000000000000 r15=0000000000000001 rbp=0000000100403156 rsp=00000000FFFFCA60 -program=C:\cygwin64\home\chipp\kep-hack\tools\scan_includes.exe, pid 42, thread main +program=C:\cygwin64\home\chipp\kep-hack\tools\scan_includes.exe, pid 2248, thread main cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B Stack trace: Frame Function Args -00100403156 00100401246 (008000631C8, 00000000022, 00100403166, 000FFFFCB90) +00100403156 00100401246 (00800059544, 00000000022, 00100403166, 000FFFFCB90) 00100403156 00100401409 (00000000000, 00100000001, 00180227860, 00100407000) 00100403178 00100401C87 (00000000020, 00000000000, 00180049B11, 00180048A70) 000FFFFCD30 00180049B7D (00000000000, 00000000000, 00000000000, 00000000000) diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index fd13719b..44289232 100644 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -97,6 +97,9 @@ HallofFameRoomScript1: ld a, HS_CERULEAN_CAVE_GUY ld [wMissableObjectIndex], a predef HideObject + ld a, HS_ROUTE_1_OAK + ld [wMissableObjectIndex], a + predef ShowObject ld a, $2 ld [wHallOfFameCurScript], a ret diff --git a/scripts/Route1.asm b/scripts/Route1.asm index bd9afea3..d08c2744 100644 --- a/scripts/Route1.asm +++ b/scripts/Route1.asm @@ -1,10 +1,14 @@ Route1_Script: jp EnableAutoTextBoxDrawing + ld hl, Route1_ScriptPointers + ld a, [wRoute1CurScript] + jp CallFunctionInTable Route1_TextPointers: dw Route1Text1 dw Route1Text2 dw Route1Text3 + dw Route1OakText Route1Text1: text_asm @@ -50,3 +54,80 @@ Route1Text2: Route1Text3: text_far _Route1Text3 text_end + +; oak stuff begins here + +; text +Route1OakText: + text_asm + ld hl, OakBeforeBattleText + call PrintText + +; call YesNoChoice ; this whole bit doesn't work for some reason +; ld a, [wCurrentMenuItem] +; and a +; ld hl, OakYes +; jr nz, .got_text +; ld hl, OakNo +;.got_text + + ld hl, wd72d + set 6, [hl] + set 7, [hl] + + call Delay3 + ld a, OPP_PROF_OAK + ld [wCurOpponent], a + + ; select which team to use during the encounter + ld a, [wRivalStarter] + cp STARTER2 + jr nz, .NotSquirtle + ld a, $3 + jr .done +.NotSquirtle + cp STARTER3 + jr nz, .Charmander + ld a, $1 + jr .done +.Charmander + ld a, $2 +.done + ld [wTrainerNo], a + ld a, 1 + ld [wIsTrainerBattle], a + + ld a, $2 + ld [wRoute1CurScript], a + + ld hl, OakDefeatedText + ld de, OakWonText + call SaveEndBattleTextPointers + jp TextScriptEnd + +OakBeforeBattleText: + text_far _OakBeforeBattleText + text_end + +OakDefeatedText: + text_far _OakDefeatedText + text_end + +OakWonText: + text_far _OakWonText + text_end + +OakYes: + text_far _OakYes + text_end + +OakNo: + text_far _OakNo + text_end + +; useful thing +StarterMons_Oak: +; starter the rival picked, oak trainer number. way easier than storing oak's "choice" + db STARTER1, 2 ; Venusaur + db STARTER2, 3 ; Charizard + db STARTER3, 1 ; Totartle \ No newline at end of file diff --git a/text/Route1.asm b/text/Route1.asm index c7a05cd4..3ec18a80 100644 --- a/text/Route1.asm +++ b/text/Route1.asm @@ -48,3 +48,53 @@ _Route1Text3:: line "PALLET TOWN -" cont "VIRIDIAN CITY" done + +_OakBeforeBattleText:: + text "OAK: Oh, my!" + + para "It seems you" + line "caught me during" + cont "during my lunch" + cont "hour!" + + para ", you" + line "have truly come" + cont "into your own!" + + para "Your #MON" + line "LEAGUE challenge" + cont "has reignited" + cont "a spirit that" + cont "left me a long" + cont "time ago..." + + para "How about we" + line "spar a bit?" + cont "What say you?" + + done + +_OakDefeatedText:: + text "Hmm..." + + para "I still have a" + line "lot to learn!" + prompt + +_OakWonText:: + text "Back in my day," + line "I was a serious" + cont "TRAINER!" + prompt + +_OakYes:: + text "Back in my day," + line "I was a serious" + cont "TRAINER! Prepare" + cont "yourself, !" + prompt + +_OakNo:: + text "Maybe another" + line "time!" + done \ No newline at end of file