From fe1e76466b293c83e6cd3a7d4639fb3c49da26ad Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Wed, 7 Jan 2026 22:05:20 -0500 Subject: Use macros to enforce "missable/hide/show object" constraints, and rename them to "toggleable objects" (#557) --- data/predef_pointers.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/predef_pointers.asm') diff --git a/data/predef_pointers.asm b/data/predef_pointers.asm index e6968c46..19c3ea8f 100644 --- a/data/predef_pointers.asm +++ b/data/predef_pointers.asm @@ -32,7 +32,7 @@ PredefPointers:: add_predef ApplyOutOfBattlePoisonDamage add_predef AnyPartyAlive add_predef ShowObject - add_predef ShowObject2 + add_predef ShowObject2 ; identical to ShowObject add_predef ReplaceTileBlock add_predef InitPlayerData2 add_predef LoadTilesetHeader @@ -75,7 +75,7 @@ PredefPointers:: add_predef WriteMonMoves add_predef SaveMenu add_predef LoadSGB - add_predef MarkTownVisitedAndLoadMissableObjects + add_predef MarkTownVisitedAndLoadToggleableObjects add_predef SetPartyMonTypes add_predef CanLearnTM add_predef TMToMove -- cgit v1.3.1-sl0p From 0e49aef88ef94b9d3e80d89e4eb718e9425045df Mon Sep 17 00:00:00 2001 From: Rangi <35663410+Rangi42@users.noreply.github.com> Date: Wed, 7 Jan 2026 22:05:37 -0500 Subject: Use macros to enforce "hidden object" constraints, and rename them to "hidden events" (#559) --- data/events/hidden_events.asm | 599 ++++++++++++++++++ data/events/hidden_objects.asm | 668 --------------------- data/predef_pointers.asm | 2 +- engine/events/hidden_events/bench_guys.asm | 107 ++++ engine/events/hidden_events/bills_house_pc.asm | 134 +++++ engine/events/hidden_events/blues_room.asm | 13 + engine/events/hidden_events/book_or_sculpture.asm | 21 + engine/events/hidden_events/bookshelves.asm | 39 ++ engine/events/hidden_events/cinnabar_gym_quiz.asm | 200 ++++++ engine/events/hidden_events/elevator.asm | 3 + engine/events/hidden_events/fighting_dojo.asm | 23 + engine/events/hidden_events/gym_statues.asm | 39 ++ engine/events/hidden_events/indigo_plateau_hq.asm | 10 + .../hidden_events/indigo_plateau_statues.asm | 24 + engine/events/hidden_events/magazines.asm | 8 + engine/events/hidden_events/museum_fossils.asm | 51 ++ engine/events/hidden_events/new_bike.asm | 7 + engine/events/hidden_events/oaks_lab_email.asm | 10 + engine/events/hidden_events/oaks_lab_posters.asm | 29 + engine/events/hidden_events/pokecenter_pc.asm | 11 + engine/events/hidden_events/pokemon_stuff.asm | 3 + engine/events/hidden_events/reds_room.asm | 14 + .../events/hidden_events/route_15_binoculars.asm | 14 + engine/events/hidden_events/safari_game.asm | 83 +++ engine/events/hidden_events/school_blackboard.asm | 224 +++++++ engine/events/hidden_events/school_notebooks.asm | 65 ++ engine/events/hidden_events/town_map.asm | 22 + .../events/hidden_events/vermilion_gym_trash.asm | 169 ++++++ engine/events/hidden_items.asm | 10 +- engine/events/hidden_objects/bench_guys.asm | 107 ---- engine/events/hidden_objects/bills_house_pc.asm | 134 ----- engine/events/hidden_objects/blues_room.asm | 13 - engine/events/hidden_objects/book_or_sculpture.asm | 21 - engine/events/hidden_objects/bookshelves.asm | 39 -- engine/events/hidden_objects/cinnabar_gym_quiz.asm | 200 ------ engine/events/hidden_objects/elevator.asm | 3 - engine/events/hidden_objects/fighting_dojo.asm | 23 - engine/events/hidden_objects/gym_statues.asm | 39 -- engine/events/hidden_objects/indigo_plateau_hq.asm | 10 - .../hidden_objects/indigo_plateau_statues.asm | 24 - engine/events/hidden_objects/magazines.asm | 8 - engine/events/hidden_objects/museum_fossils.asm | 51 -- engine/events/hidden_objects/new_bike.asm | 7 - engine/events/hidden_objects/oaks_lab_email.asm | 10 - engine/events/hidden_objects/oaks_lab_posters.asm | 29 - engine/events/hidden_objects/pokecenter_pc.asm | 11 - engine/events/hidden_objects/pokemon_stuff.asm | 3 - engine/events/hidden_objects/reds_room.asm | 14 - .../events/hidden_objects/route_15_binoculars.asm | 14 - engine/events/hidden_objects/safari_game.asm | 83 --- engine/events/hidden_objects/school_blackboard.asm | 224 ------- engine/events/hidden_objects/school_notebooks.asm | 65 -- engine/events/hidden_objects/town_map.asm | 22 - .../events/hidden_objects/vermilion_gym_trash.asm | 169 ------ engine/overworld/hidden_events.asm | 133 ++++ engine/overworld/hidden_objects.asm | 133 ---- engine/slots/game_corner_slots.asm | 6 +- home.asm | 2 +- home/hidden_events.asm | 39 ++ home/hidden_objects.asm | 39 -- home/overworld.asm | 4 +- layout.link | 10 +- main.asm | 62 +- ram/hram.asm | 2 +- ram/wram.asm | 12 +- scripts/GameCorner.asm | 2 +- scripts/SafariZoneGate.asm | 2 +- 67 files changed, 2151 insertions(+), 2220 deletions(-) create mode 100644 data/events/hidden_events.asm delete mode 100644 data/events/hidden_objects.asm create mode 100644 engine/events/hidden_events/bench_guys.asm create mode 100644 engine/events/hidden_events/bills_house_pc.asm create mode 100644 engine/events/hidden_events/blues_room.asm create mode 100644 engine/events/hidden_events/book_or_sculpture.asm create mode 100644 engine/events/hidden_events/bookshelves.asm create mode 100644 engine/events/hidden_events/cinnabar_gym_quiz.asm create mode 100644 engine/events/hidden_events/elevator.asm create mode 100644 engine/events/hidden_events/fighting_dojo.asm create mode 100644 engine/events/hidden_events/gym_statues.asm create mode 100644 engine/events/hidden_events/indigo_plateau_hq.asm create mode 100644 engine/events/hidden_events/indigo_plateau_statues.asm create mode 100644 engine/events/hidden_events/magazines.asm create mode 100644 engine/events/hidden_events/museum_fossils.asm create mode 100644 engine/events/hidden_events/new_bike.asm create mode 100644 engine/events/hidden_events/oaks_lab_email.asm create mode 100644 engine/events/hidden_events/oaks_lab_posters.asm create mode 100644 engine/events/hidden_events/pokecenter_pc.asm create mode 100644 engine/events/hidden_events/pokemon_stuff.asm create mode 100644 engine/events/hidden_events/reds_room.asm create mode 100644 engine/events/hidden_events/route_15_binoculars.asm create mode 100644 engine/events/hidden_events/safari_game.asm create mode 100644 engine/events/hidden_events/school_blackboard.asm create mode 100644 engine/events/hidden_events/school_notebooks.asm create mode 100644 engine/events/hidden_events/town_map.asm create mode 100644 engine/events/hidden_events/vermilion_gym_trash.asm delete mode 100644 engine/events/hidden_objects/bench_guys.asm delete mode 100644 engine/events/hidden_objects/bills_house_pc.asm delete mode 100644 engine/events/hidden_objects/blues_room.asm delete mode 100644 engine/events/hidden_objects/book_or_sculpture.asm delete mode 100644 engine/events/hidden_objects/bookshelves.asm delete mode 100644 engine/events/hidden_objects/cinnabar_gym_quiz.asm delete mode 100644 engine/events/hidden_objects/elevator.asm delete mode 100644 engine/events/hidden_objects/fighting_dojo.asm delete mode 100644 engine/events/hidden_objects/gym_statues.asm delete mode 100644 engine/events/hidden_objects/indigo_plateau_hq.asm delete mode 100644 engine/events/hidden_objects/indigo_plateau_statues.asm delete mode 100644 engine/events/hidden_objects/magazines.asm delete mode 100644 engine/events/hidden_objects/museum_fossils.asm delete mode 100644 engine/events/hidden_objects/new_bike.asm delete mode 100644 engine/events/hidden_objects/oaks_lab_email.asm delete mode 100644 engine/events/hidden_objects/oaks_lab_posters.asm delete mode 100644 engine/events/hidden_objects/pokecenter_pc.asm delete mode 100644 engine/events/hidden_objects/pokemon_stuff.asm delete mode 100644 engine/events/hidden_objects/reds_room.asm delete mode 100644 engine/events/hidden_objects/route_15_binoculars.asm delete mode 100644 engine/events/hidden_objects/safari_game.asm delete mode 100644 engine/events/hidden_objects/school_blackboard.asm delete mode 100644 engine/events/hidden_objects/school_notebooks.asm delete mode 100644 engine/events/hidden_objects/town_map.asm delete mode 100644 engine/events/hidden_objects/vermilion_gym_trash.asm create mode 100644 engine/overworld/hidden_events.asm delete mode 100644 engine/overworld/hidden_objects.asm create mode 100644 home/hidden_events.asm delete mode 100644 home/hidden_objects.asm (limited to 'data/predef_pointers.asm') diff --git a/data/events/hidden_events.asm b/data/events/hidden_events.asm new file mode 100644 index 00000000..89c74923 --- /dev/null +++ b/data/events/hidden_events.asm @@ -0,0 +1,599 @@ +DEF num_hidden_event_maps = 0 + +MACRO hidden_event_map + db \1 ; map id + DEF HIDDENEVENTMAP{num_hidden_event_maps} EQUS "\1" + DEF num_hidden_event_maps += 1 +ENDM + +HiddenEventMaps: + hidden_event_map REDS_HOUSE_2F + hidden_event_map BLUES_HOUSE + hidden_event_map OAKS_LAB + hidden_event_map VIRIDIAN_POKECENTER + hidden_event_map VIRIDIAN_MART + hidden_event_map VIRIDIAN_SCHOOL_HOUSE + hidden_event_map VIRIDIAN_GYM + hidden_event_map MUSEUM_1F + hidden_event_map PEWTER_GYM + hidden_event_map PEWTER_MART + hidden_event_map PEWTER_POKECENTER + hidden_event_map CERULEAN_POKECENTER + hidden_event_map CERULEAN_GYM + hidden_event_map CERULEAN_MART + hidden_event_map LAVENDER_POKECENTER + hidden_event_map VERMILION_POKECENTER + hidden_event_map VERMILION_GYM + hidden_event_map CELADON_MANSION_2F + hidden_event_map CELADON_POKECENTER + hidden_event_map CELADON_GYM + hidden_event_map GAME_CORNER + hidden_event_map CELADON_HOTEL + hidden_event_map FUCHSIA_POKECENTER + hidden_event_map FUCHSIA_GYM + hidden_event_map CINNABAR_GYM + hidden_event_map CINNABAR_POKECENTER + hidden_event_map SAFFRON_GYM + hidden_event_map MT_MOON_POKECENTER + hidden_event_map ROCK_TUNNEL_POKECENTER + hidden_event_map TRADE_CENTER + hidden_event_map COLOSSEUM + hidden_event_map VIRIDIAN_FOREST + hidden_event_map MT_MOON_B2F + hidden_event_map INDIGO_PLATEAU + hidden_event_map ROUTE_25 + hidden_event_map ROUTE_9 + hidden_event_map SS_ANNE_KITCHEN + hidden_event_map SS_ANNE_B1F_ROOMS + hidden_event_map ROCKET_HIDEOUT_B1F + hidden_event_map ROCKET_HIDEOUT_B3F + hidden_event_map ROCKET_HIDEOUT_B4F + hidden_event_map SAFFRON_POKECENTER + hidden_event_map POKEMON_TOWER_5F + hidden_event_map ROUTE_13 + hidden_event_map SAFARI_ZONE_GATE + hidden_event_map SAFARI_ZONE_WEST + hidden_event_map SILPH_CO_5F + hidden_event_map SILPH_CO_9F + hidden_event_map COPYCATS_HOUSE_2F + hidden_event_map CERULEAN_CAVE_1F + hidden_event_map CERULEAN_CAVE_B1F + hidden_event_map POWER_PLANT + hidden_event_map SEAFOAM_ISLANDS_B2F + hidden_event_map SEAFOAM_ISLANDS_B4F + hidden_event_map POKEMON_MANSION_1F + hidden_event_map POKEMON_MANSION_3F + hidden_event_map ROUTE_23 + hidden_event_map VICTORY_ROAD_2F + hidden_event_map UNUSED_MAP_6F + hidden_event_map BILLS_HOUSE + hidden_event_map VIRIDIAN_CITY + hidden_event_map SAFARI_ZONE_WEST_REST_HOUSE + hidden_event_map SAFARI_ZONE_EAST_REST_HOUSE + hidden_event_map SAFARI_ZONE_NORTH_REST_HOUSE + hidden_event_map ROUTE_15_GATE_2F + hidden_event_map MR_FUJIS_HOUSE + hidden_event_map CELADON_MANSION_ROOF_HOUSE + hidden_event_map FIGHTING_DOJO + hidden_event_map ROUTE_10 + hidden_event_map INDIGO_PLATEAU_LOBBY + hidden_event_map CINNABAR_LAB_FOSSIL_ROOM + hidden_event_map BIKE_SHOP + hidden_event_map ROUTE_11 + hidden_event_map ROUTE_12 + hidden_event_map POKEMON_MANSION_2F + hidden_event_map POKEMON_MANSION_B1F + hidden_event_map SILPH_CO_11F + hidden_event_map ROUTE_17 + hidden_event_map UNDERGROUND_PATH_NORTH_SOUTH + hidden_event_map UNDERGROUND_PATH_WEST_EAST + hidden_event_map CELADON_CITY + hidden_event_map SEAFOAM_ISLANDS_B3F + hidden_event_map VERMILION_CITY + hidden_event_map CERULEAN_CITY + hidden_event_map ROUTE_4 + db -1 ; end + +HiddenEventPointers: +; each of these pointers is for the corresponding map in HiddenEventMaps +FOR n, num_hidden_event_maps + dw HiddenEventsFor_{HIDDENEVENTMAP{n}} +ENDR + +MACRO hidden_events_for + HiddenEventsFor_\1: +ENDM + +MACRO hidden_event + db \2 ; y coord + db \1 ; x coord + db \4 ; function argument + dba \3 ; event function +ENDM + +MACRO hidden_text_predef + db \2 ; y coord + db \1 ; x coord + db_tx_pre \4 ; text id + dba \3 ; event function +ENDM + +; Some hidden events use SPRITE_FACING_* values, +; but these do not actually prevent the player +; from interacting with them in any direction. +DEF ANY_FACING EQU $d0 + + hidden_events_for TRADE_CENTER + hidden_event 5, 4, CableClubRightGameboy, ANY_FACING + hidden_event 4, 4, CableClubLeftGameboy, ANY_FACING + db -1 ; end + + hidden_events_for COLOSSEUM + hidden_event 5, 4, CableClubRightGameboy, ANY_FACING + hidden_event 4, 4, CableClubLeftGameboy, ANY_FACING + db -1 ; end + + hidden_events_for REDS_HOUSE_2F + hidden_event 0, 1, OpenRedsPC, SPRITE_FACING_UP + hidden_event 3, 5, PrintRedSNESText, ANY_FACING + db -1 ; end + + hidden_events_for BLUES_HOUSE + hidden_event 0, 1, PrintBookcaseText, SPRITE_FACING_UP + hidden_event 1, 1, PrintBookcaseText, SPRITE_FACING_UP + hidden_event 7, 1, PrintBookcaseText, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for OAKS_LAB + hidden_event 4, 0, DisplayOakLabLeftPoster, SPRITE_FACING_UP + hidden_event 5, 0, DisplayOakLabRightPoster, SPRITE_FACING_UP + hidden_event 0, 1, DisplayOakLabEmailText, SPRITE_FACING_UP + hidden_event 1, 1, DisplayOakLabEmailText, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VIRIDIAN_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VIRIDIAN_MART + db -1 ; end + + hidden_events_for VIRIDIAN_SCHOOL_HOUSE + hidden_text_predef 3, 4, PrintNotebookText, ViridianSchoolNotebook + hidden_text_predef 3, 0, PrintBlackboardLinkCableText, ViridianSchoolBlackboard + db -1 ; end + + hidden_events_for VIRIDIAN_GYM + hidden_event 15, 15, GymStatues, SPRITE_FACING_UP + hidden_event 18, 15, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for MUSEUM_1F + hidden_event 2, 3, AerodactylFossil, SPRITE_FACING_UP + hidden_event 2, 6, KabutopsFossil, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for PEWTER_GYM + hidden_event 3, 10, GymStatues, SPRITE_FACING_UP + hidden_event 6, 10, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for PEWTER_MART + db -1 ; end + + hidden_events_for PEWTER_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CERULEAN_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CERULEAN_GYM + hidden_event 3, 11, GymStatues, SPRITE_FACING_UP + hidden_event 6, 11, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CERULEAN_MART + db -1 ; end + + hidden_events_for LAVENDER_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VERMILION_POKECENTER + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VERMILION_GYM + hidden_event 3, 14, GymStatues, SPRITE_FACING_UP + hidden_event 6, 14, GymStatues, SPRITE_FACING_UP + hidden_event 6, 1, PrintTrashText, SPRITE_FACING_DOWN + ; GymTrashScript argument: [wGymTrashCanIndex] + hidden_event 1, 7, GymTrashScript, 0 + hidden_event 1, 9, GymTrashScript, 1 + hidden_event 1, 11, GymTrashScript, 2 + hidden_event 3, 7, GymTrashScript, 3 + hidden_event 3, 9, GymTrashScript, 4 + hidden_event 3, 11, GymTrashScript, 5 + hidden_event 5, 7, GymTrashScript, 6 + hidden_event 5, 9, GymTrashScript, 7 + hidden_event 5, 11, GymTrashScript, 8 + hidden_event 7, 7, GymTrashScript, 9 + hidden_event 7, 9, GymTrashScript, 10 + hidden_event 7, 11, GymTrashScript, 11 + hidden_event 9, 7, GymTrashScript, 12 + hidden_event 9, 9, GymTrashScript, 13 + hidden_event 9, 11, GymTrashScript, 14 + db -1 ; end + + hidden_events_for CELADON_MANSION_2F + hidden_event 0, 5, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CELADON_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CELADON_GYM + hidden_event 3, 15, GymStatues, SPRITE_FACING_UP + hidden_event 6, 15, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for GAME_CORNER + hidden_event 18, 15, StartSlotMachine, ANY_FACING + hidden_event 18, 14, StartSlotMachine, ANY_FACING + hidden_event 18, 13, StartSlotMachine, ANY_FACING + hidden_event 18, 12, StartSlotMachine, ANY_FACING + hidden_event 18, 11, StartSlotMachine, ANY_FACING + hidden_event 18, 10, StartSlotMachine, SLOTS_SOMEONESKEYS + hidden_event 13, 10, StartSlotMachine, ANY_FACING + hidden_event 13, 11, StartSlotMachine, ANY_FACING + hidden_event 13, 12, StartSlotMachine, SLOTS_OUTTOLUNCH + hidden_event 13, 13, StartSlotMachine, ANY_FACING + hidden_event 13, 14, StartSlotMachine, ANY_FACING + hidden_event 13, 15, StartSlotMachine, ANY_FACING + hidden_event 12, 15, StartSlotMachine, ANY_FACING + hidden_event 12, 14, StartSlotMachine, ANY_FACING + hidden_event 12, 13, StartSlotMachine, ANY_FACING + hidden_event 12, 12, StartSlotMachine, ANY_FACING + hidden_event 12, 11, StartSlotMachine, ANY_FACING + hidden_event 12, 10, StartSlotMachine, ANY_FACING + hidden_event 7, 10, StartSlotMachine, ANY_FACING + hidden_event 7, 11, StartSlotMachine, ANY_FACING + hidden_event 7, 12, StartSlotMachine, ANY_FACING + hidden_event 7, 13, StartSlotMachine, ANY_FACING + hidden_event 7, 14, StartSlotMachine, ANY_FACING + hidden_event 7, 15, StartSlotMachine, ANY_FACING + hidden_event 6, 15, StartSlotMachine, ANY_FACING + hidden_event 6, 14, StartSlotMachine, ANY_FACING + hidden_event 6, 13, StartSlotMachine, ANY_FACING + hidden_event 6, 12, StartSlotMachine, SLOTS_OUTOFORDER + hidden_event 6, 11, StartSlotMachine, ANY_FACING + hidden_event 6, 10, StartSlotMachine, ANY_FACING + hidden_event 1, 10, StartSlotMachine, ANY_FACING + hidden_event 1, 11, StartSlotMachine, ANY_FACING + hidden_event 1, 12, StartSlotMachine, ANY_FACING + hidden_event 1, 13, StartSlotMachine, ANY_FACING + hidden_event 1, 14, StartSlotMachine, ANY_FACING + hidden_event 1, 15, StartSlotMachine, ANY_FACING + ; HiddenCoins argument: COIN + + hidden_event 0, 8, HiddenCoins, COIN + 10 + hidden_event 1, 16, HiddenCoins, COIN + 10 + hidden_event 3, 11, HiddenCoins, COIN + 20 + hidden_event 3, 14, HiddenCoins, COIN + 10 + hidden_event 4, 12, HiddenCoins, COIN + 10 + hidden_event 9, 12, HiddenCoins, COIN + 20 + hidden_event 9, 15, HiddenCoins, COIN + 10 + hidden_event 16, 14, HiddenCoins, COIN + 10 + hidden_event 10, 16, HiddenCoins, COIN + 10 + hidden_event 11, 7, HiddenCoins, COIN + 40 + hidden_event 15, 8, HiddenCoins, COIN + 100 + hidden_event 12, 15, HiddenCoins, COIN + 10 + db -1 ; end + + hidden_events_for CELADON_HOTEL + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + db -1 ; end + + hidden_events_for FUCHSIA_POKECENTER + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for FUCHSIA_GYM + hidden_event 3, 15, GymStatues, SPRITE_FACING_UP + hidden_event 6, 15, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CINNABAR_GYM + hidden_event 17, 13, GymStatues, SPRITE_FACING_UP + ; PrintCinnabarQuiz argument: ([hGymGateAnswer] << 4) | [hGymGateIndex] + hidden_event 15, 7, PrintCinnabarQuiz, (FALSE << 4) | 1 + hidden_event 10, 1, PrintCinnabarQuiz, (TRUE << 4) | 2 + hidden_event 9, 7, PrintCinnabarQuiz, (TRUE << 4) | 3 + hidden_event 9, 13, PrintCinnabarQuiz, (TRUE << 4) | 4 + hidden_event 1, 13, PrintCinnabarQuiz, (FALSE << 4) | 5 + hidden_event 1, 7, PrintCinnabarQuiz, (TRUE << 4) | 6 + db -1 ; end + + hidden_events_for CINNABAR_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_UP + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for SAFFRON_GYM + hidden_event 9, 15, GymStatues, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for MT_MOON_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for ROCK_TUNNEL_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VIRIDIAN_FOREST + hidden_event 1, 18, HiddenItems, POTION + hidden_event 16, 42, HiddenItems, ANTIDOTE + db -1 ; end + + hidden_events_for MT_MOON_B2F + hidden_event 18, 12, HiddenItems, MOON_STONE + hidden_event 33, 9, HiddenItems, ETHER + db -1 ; end + + hidden_events_for INDIGO_PLATEAU + hidden_event 8, 13, PrintIndigoPlateauHQText, $ff ; inaccessible + hidden_event 11, 13, PrintIndigoPlateauHQText, SPRITE_FACING_DOWN ; inaccessible + db -1 ; end + + hidden_events_for ROUTE_25 + hidden_event 38, 3, HiddenItems, ETHER + hidden_event 10, 1, HiddenItems, ELIXER + db -1 ; end + + hidden_events_for ROUTE_9 + hidden_event 14, 7, HiddenItems, ETHER + db -1 ; end + + hidden_events_for SS_ANNE_KITCHEN + hidden_event 13, 5, PrintTrashText, SPRITE_FACING_DOWN + hidden_event 13, 7, PrintTrashText, SPRITE_FACING_DOWN + hidden_event 13, 9, HiddenItems, GREAT_BALL + db -1 ; end + + hidden_events_for SS_ANNE_B1F_ROOMS + hidden_event 3, 1, HiddenItems, HYPER_POTION + db -1 ; end + + hidden_events_for ROUTE_10 + hidden_event 9, 17, HiddenItems, SUPER_POTION + hidden_event 16, 53, HiddenItems, MAX_ETHER + db -1 ; end + + hidden_events_for ROCKET_HIDEOUT_B1F + hidden_event 21, 15, HiddenItems, PP_UP + db -1 ; end + + hidden_events_for ROCKET_HIDEOUT_B3F + hidden_event 27, 17, HiddenItems, NUGGET + db -1 ; end + + hidden_events_for ROCKET_HIDEOUT_B4F + hidden_event 25, 1, HiddenItems, SUPER_POTION + db -1 ; end + + hidden_events_for SAFFRON_POKECENTER + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_UP + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for POKEMON_TOWER_5F + hidden_event 4, 12, HiddenItems, ELIXER + db -1 ; end + + hidden_events_for ROUTE_13 + hidden_event 1, 14, HiddenItems, PP_UP + hidden_event 16, 13, HiddenItems, CALCIUM + db -1 ; end + + hidden_events_for SAFARI_ZONE_GATE + hidden_event 10, 1, HiddenItems, NUGGET ; inaccessible + db -1 ; end + + hidden_events_for SAFARI_ZONE_WEST + hidden_event 6, 5, HiddenItems, REVIVE + db -1 ; end + + hidden_events_for SILPH_CO_5F + hidden_event 12, 3, HiddenItems, ELIXER + db -1 ; end + + hidden_events_for SILPH_CO_9F + hidden_event 2, 15, HiddenItems, MAX_POTION + db -1 ; end + + hidden_events_for COPYCATS_HOUSE_2F + hidden_event 1, 1, HiddenItems, NUGGET + db -1 ; end + + hidden_events_for CERULEAN_CAVE_1F + hidden_event 14, 11, HiddenItems, RARE_CANDY + db -1 ; end + + hidden_events_for CERULEAN_CAVE_B1F + hidden_event 27, 3, HiddenItems, ULTRA_BALL + db -1 ; end + + hidden_events_for POWER_PLANT + hidden_event 17, 16, HiddenItems, MAX_ELIXER + hidden_event 12, 1, HiddenItems, PP_UP + db -1 ; end + + hidden_events_for SEAFOAM_ISLANDS_B2F + hidden_event 15, 15, HiddenItems, NUGGET + db -1 ; end + + hidden_events_for SEAFOAM_ISLANDS_B4F + hidden_event 25, 17, HiddenItems, ULTRA_BALL + db -1 ; end + + hidden_events_for POKEMON_MANSION_1F + hidden_event 8, 16, HiddenItems, MOON_STONE + hidden_event 2, 5, Mansion1Script_Switches, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for POKEMON_MANSION_2F + hidden_event 2, 11, Mansion2Script_Switches, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for POKEMON_MANSION_3F + hidden_event 1, 9, HiddenItems, MAX_REVIVE + hidden_event 10, 5, Mansion3Script_Switches, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for POKEMON_MANSION_B1F + hidden_event 1, 9, HiddenItems, RARE_CANDY + hidden_event 20, 3, Mansion4Script_Switches, SPRITE_FACING_UP + hidden_event 18, 25, Mansion4Script_Switches, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for ROUTE_23 + hidden_event 9, 44, HiddenItems, FULL_RESTORE + hidden_event 19, 70, HiddenItems, ULTRA_BALL + hidden_event 8, 90, HiddenItems, MAX_ETHER + db -1 ; end + + hidden_events_for VICTORY_ROAD_2F + hidden_event 5, 2, HiddenItems, ULTRA_BALL + hidden_event 26, 7, HiddenItems, FULL_RESTORE + db -1 ; end + + hidden_events_for UNUSED_MAP_6F + hidden_event 14, 11, HiddenItems, MAX_ELIXER + db -1 ; end + + hidden_events_for BILLS_HOUSE + hidden_event 1, 4, BillsHousePC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for VIRIDIAN_CITY + hidden_event 14, 4, HiddenItems, POTION + db -1 ; end + + hidden_events_for SAFARI_ZONE_WEST_REST_HOUSE + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for SAFARI_ZONE_EAST_REST_HOUSE + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for SAFARI_ZONE_NORTH_REST_HOUSE + hidden_event 0, 4, PrintBenchGuyText, SPRITE_FACING_LEFT + hidden_event 13, 3, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for ROUTE_15_GATE_2F + hidden_event 1, 2, Route15GateLeftBinoculars, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for MR_FUJIS_HOUSE + hidden_event 0, 1, PrintMagazinesText, SPRITE_FACING_DOWN + hidden_event 1, 1, PrintMagazinesText, SPRITE_FACING_DOWN + hidden_event 7, 1, PrintMagazinesText, SPRITE_FACING_DOWN + db -1 ; end + + hidden_events_for CELADON_MANSION_ROOF_HOUSE + hidden_text_predef 3, 0, PrintBlackboardLinkCableText, LinkCableHelp + hidden_text_predef 4, 0, PrintBlackboardLinkCableText, LinkCableHelp + hidden_text_predef 3, 4, PrintNotebookText, TMNotebook + db -1 ; end + + hidden_events_for FIGHTING_DOJO + hidden_event 3, 9, PrintFightingDojoText, SPRITE_FACING_UP + hidden_event 6, 9, PrintFightingDojoText, SPRITE_FACING_UP + hidden_event 4, 0, PrintFightingDojoText2, SPRITE_FACING_UP + hidden_event 5, 0, PrintFightingDojoText3, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for INDIGO_PLATEAU_LOBBY + hidden_event 15, 7, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for CINNABAR_LAB_FOSSIL_ROOM + hidden_event 0, 4, OpenPokemonCenterPC, SPRITE_FACING_UP + hidden_event 2, 4, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for BIKE_SHOP + hidden_event 1, 0, PrintNewBikeText, ANY_FACING + hidden_event 2, 1, PrintNewBikeText, ANY_FACING + hidden_event 1, 2, PrintNewBikeText, ANY_FACING + hidden_event 3, 2, PrintNewBikeText, ANY_FACING + hidden_event 0, 4, PrintNewBikeText, ANY_FACING + hidden_event 1, 5, PrintNewBikeText, ANY_FACING + db -1 ; end + + hidden_events_for ROUTE_11 + hidden_event 48, 5, HiddenItems, ESCAPE_ROPE + db -1 ; end + + hidden_events_for ROUTE_12 + hidden_event 2, 63, HiddenItems, HYPER_POTION + db -1 ; end + + hidden_events_for SILPH_CO_11F + hidden_event 10, 12, OpenPokemonCenterPC, SPRITE_FACING_UP + db -1 ; end + + hidden_events_for ROUTE_17 + hidden_event 15, 14, HiddenItems, RARE_CANDY + hidden_event 8, 45, HiddenItems, FULL_RESTORE + hidden_event 17, 72, HiddenItems, PP_UP + hidden_event 4, 91, HiddenItems, MAX_REVIVE + hidden_event 8, 121, HiddenItems, MAX_ELIXER + db -1 ; end + + hidden_events_for UNDERGROUND_PATH_NORTH_SOUTH + hidden_event 3, 4, HiddenItems, FULL_RESTORE + hidden_event 4, 34, HiddenItems, X_SPECIAL + db -1 ; end + + hidden_events_for UNDERGROUND_PATH_WEST_EAST + hidden_event 12, 2, HiddenItems, NUGGET + hidden_event 21, 5, HiddenItems, ELIXER + db -1 ; end + + hidden_events_for CELADON_CITY + hidden_event 48, 15, HiddenItems, PP_UP + db -1 ; end + + hidden_events_for SEAFOAM_ISLANDS_B3F + hidden_event 9, 16, HiddenItems, MAX_ELIXER + db -1 ; end + + hidden_events_for VERMILION_CITY + hidden_event 14, 11, HiddenItems, MAX_ETHER + db -1 ; end + + hidden_events_for CERULEAN_CITY + hidden_event 15, 8, HiddenItems, RARE_CANDY + db -1 ; end + + hidden_events_for ROUTE_4 + hidden_event 40, 3, HiddenItems, GREAT_BALL + db -1 ; end diff --git a/data/events/hidden_objects.asm b/data/events/hidden_objects.asm deleted file mode 100644 index 55e33731..00000000 --- a/data/events/hidden_objects.asm +++ /dev/null @@ -1,668 +0,0 @@ -HiddenObjectMaps: - db REDS_HOUSE_2F - db BLUES_HOUSE - db OAKS_LAB - db VIRIDIAN_POKECENTER - db VIRIDIAN_MART - db VIRIDIAN_SCHOOL_HOUSE - db VIRIDIAN_GYM - db MUSEUM_1F - db PEWTER_GYM - db PEWTER_MART - db PEWTER_POKECENTER - db CERULEAN_POKECENTER - db CERULEAN_GYM - db CERULEAN_MART - db LAVENDER_POKECENTER - db VERMILION_POKECENTER - db VERMILION_GYM - db CELADON_MANSION_2F - db CELADON_POKECENTER - db CELADON_GYM - db GAME_CORNER - db CELADON_HOTEL - db FUCHSIA_POKECENTER - db FUCHSIA_GYM - db CINNABAR_GYM - db CINNABAR_POKECENTER - db SAFFRON_GYM - db MT_MOON_POKECENTER - db ROCK_TUNNEL_POKECENTER - db TRADE_CENTER - db COLOSSEUM - db VIRIDIAN_FOREST - db MT_MOON_B2F - db INDIGO_PLATEAU - db ROUTE_25 - db ROUTE_9 - db SS_ANNE_KITCHEN - db SS_ANNE_B1F_ROOMS - db ROCKET_HIDEOUT_B1F - db ROCKET_HIDEOUT_B3F - db ROCKET_HIDEOUT_B4F - db SAFFRON_POKECENTER - db POKEMON_TOWER_5F - db ROUTE_13 - db SAFARI_ZONE_GATE - db SAFARI_ZONE_WEST - db SILPH_CO_5F - db SILPH_CO_9F - db COPYCATS_HOUSE_2F - db CERULEAN_CAVE_1F - db CERULEAN_CAVE_B1F - db POWER_PLANT - db SEAFOAM_ISLANDS_B2F - db SEAFOAM_ISLANDS_B4F - db POKEMON_MANSION_1F - db POKEMON_MANSION_3F - db ROUTE_23 - db VICTORY_ROAD_2F - db UNUSED_MAP_6F - db BILLS_HOUSE - db VIRIDIAN_CITY - db SAFARI_ZONE_WEST_REST_HOUSE - db SAFARI_ZONE_EAST_REST_HOUSE - db SAFARI_ZONE_NORTH_REST_HOUSE - db ROUTE_15_GATE_2F - db MR_FUJIS_HOUSE - db CELADON_MANSION_ROOF_HOUSE - db FIGHTING_DOJO - db ROUTE_10 - db INDIGO_PLATEAU_LOBBY - db CINNABAR_LAB_FOSSIL_ROOM - db BIKE_SHOP - db ROUTE_11 - db ROUTE_12 - db POKEMON_MANSION_2F - db POKEMON_MANSION_B1F - db SILPH_CO_11F - db ROUTE_17 - db UNDERGROUND_PATH_NORTH_SOUTH - db UNDERGROUND_PATH_WEST_EAST - db CELADON_CITY - db SEAFOAM_ISLANDS_B3F - db VERMILION_CITY - db CERULEAN_CITY - db ROUTE_4 - db -1 ; end - -HiddenObjectPointers: -; each of these pointers is for the corresponding map in HiddenObjectMaps - dw RedsHouse2FHiddenObjects - dw BluesHouseHiddenObjects - dw OaksLabHiddenObjects - dw ViridianPokecenterHiddenObjects - dw ViridianMartHiddenObjects - dw ViridianSchoolHiddenObjects - dw ViridianGymHiddenObjects - dw Museum1FHiddenObjects - dw PewterGymHiddenObjects - dw PewterMartHiddenObjects - dw PewterPokecenterHiddenObjects - dw CeruleanPokecenterHiddenObjects - dw CeruleanGymHiddenObjects - dw CeruleanMartHiddenObjects - dw LavenderPokecenterHiddenObjects - dw VermilionPokecenterHiddenObjects - dw VermilionGymHiddenObjects - dw CeladonMansion2HiddenObjects - dw CeladonPokecenterHiddenObjects - dw CeladonGymHiddenObjects - dw GameCornerHiddenObjects - dw CeladonHotelHiddenObjects - dw FuchsiaPokecenterHiddenObjects - dw FuchsiaGymHiddenObjects - dw CinnabarGymHiddenObjects - dw CinnabarPokecenterHiddenObjects - dw SaffronGymHiddenObjects - dw MtMoonPokecenterHiddenObjects - dw RockTunnelPokecenterHiddenObjects - dw TradeCenterHiddenObjects - dw ColosseumHiddenObjects - dw ViridianForestHiddenObjects - dw MtMoon3HiddenObjects - dw IndigoPlateauHiddenObjects - dw Route25HiddenObjects - dw Route9HiddenObjects - dw SSAnne6HiddenObjects - dw SSAnne10HiddenObjects - dw RocketHideout1HiddenObjects - dw RocketHideout3HiddenObjects - dw RocketHideout4HiddenObjects - dw SaffronPokecenterHiddenObjects - dw PokemonTower5HiddenObjects - dw Route13HiddenObjects - dw SafariZoneEntranceHiddenObjects - dw SafariZoneWestHiddenObjects - dw SilphCo5FHiddenObjects - dw SilphCo9FHiddenObjects - dw CopycatsHouse2FHiddenObjects - dw CeruleanCave1HiddenObjects - dw CeruleanCave3HiddenObjects - dw PowerPlantHiddenObjects - dw SeafoamIslands3HiddenObjects - dw SeafoamIslands5HiddenObjects - dw Mansion1HiddenObjects - dw Mansion3HiddenObjects - dw Route23HiddenObjects - dw VictoryRoad2HiddenObjects - dw Unused6FHiddenObjects - dw BillsHouseHiddenObjects - dw ViridianCityHiddenObjects - dw SafariZoneRestHouse2HiddenObjects - dw SafariZoneRestHouse3HiddenObjects - dw SafariZoneRestHouse4HiddenObjects - dw Route15GateUpstairsHiddenObjects - dw LavenderHouse1HiddenObjects - dw CeladonMansion5HiddenObjects - dw FightingDojoHiddenObjects - dw Route10HiddenObjects - dw IndigoPlateauLobbyHiddenObjects - dw CinnabarLab4HiddenObjects - dw BikeShopHiddenObjects - dw Route11HiddenObjects - dw Route12HiddenObjects - dw Mansion2HiddenObjects - dw Mansion4HiddenObjects - dw SilphCo11FHiddenObjects - dw Route17HiddenObjects - dw UndergroundPathNsHiddenObjects - dw UndergroundPathWeHiddenObjects - dw CeladonCityHiddenObjects - dw SeafoamIslands4HiddenObjects - dw VermilionCityHiddenObjects - dw CeruleanCityHiddenObjects - dw Route4HiddenObjects - -MACRO hidden_object - db \2 ; y coord - db \1 ; x coord - db \3 ; item id - dba \4 ; object routine -ENDM - -MACRO hidden_text_predef - db \2 ; y coord - db \1 ; x coord - db_tx_pre \3 ; text id - dba \4 ; object routine -ENDM - -; Some hidden objects use SPRITE_FACING_* values, -; but these do not actually prevent the player -; from interacting with them in any direction. -DEF ANY_FACING EQU $d0 - -TradeCenterHiddenObjects: - hidden_object 5, 4, ANY_FACING, CableClubRightGameboy - hidden_object 4, 4, ANY_FACING, CableClubLeftGameboy - db -1 ; end - -ColosseumHiddenObjects: - hidden_object 5, 4, ANY_FACING, CableClubRightGameboy - hidden_object 4, 4, ANY_FACING, CableClubLeftGameboy - db -1 ; end - -RedsHouse2FHiddenObjects: - hidden_object 0, 1, SPRITE_FACING_UP, OpenRedsPC - hidden_object 3, 5, ANY_FACING, PrintRedSNESText - db -1 ; end - -BluesHouseHiddenObjects: - hidden_object 0, 1, SPRITE_FACING_UP, PrintBookcaseText - hidden_object 1, 1, SPRITE_FACING_UP, PrintBookcaseText - hidden_object 7, 1, SPRITE_FACING_UP, PrintBookcaseText - db -1 ; end - -OaksLabHiddenObjects: - hidden_object 4, 0, SPRITE_FACING_UP, DisplayOakLabLeftPoster - hidden_object 5, 0, SPRITE_FACING_UP, DisplayOakLabRightPoster - hidden_object 0, 1, SPRITE_FACING_UP, DisplayOakLabEmailText - hidden_object 1, 1, SPRITE_FACING_UP, DisplayOakLabEmailText - db -1 ; end - -ViridianPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -ViridianMartHiddenObjects: - db -1 ; end - -ViridianSchoolHiddenObjects: - hidden_text_predef 3, 4, ViridianSchoolNotebook, PrintNotebookText - hidden_text_predef 3, 0, ViridianSchoolBlackboard, PrintBlackboardLinkCableText - db -1 ; end - -ViridianGymHiddenObjects: - hidden_object 15, 15, SPRITE_FACING_UP, GymStatues - hidden_object 18, 15, SPRITE_FACING_UP, GymStatues - db -1 ; end - -Museum1FHiddenObjects: - hidden_object 2, 3, SPRITE_FACING_UP, AerodactylFossil - hidden_object 2, 6, SPRITE_FACING_UP, KabutopsFossil - db -1 ; end - -PewterGymHiddenObjects: - hidden_object 3, 10, SPRITE_FACING_UP, GymStatues - hidden_object 6, 10, SPRITE_FACING_UP, GymStatues - db -1 ; end - -PewterMartHiddenObjects: - db -1 ; end - -PewterPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -CeruleanPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -CeruleanGymHiddenObjects: - hidden_object 3, 11, SPRITE_FACING_UP, GymStatues - hidden_object 6, 11, SPRITE_FACING_UP, GymStatues - db -1 ; end - -CeruleanMartHiddenObjects: - db -1 ; end - -LavenderPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -VermilionPokecenterHiddenObjects: - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText - db -1 ; end - -VermilionGymHiddenObjects: - hidden_object 3, 14, SPRITE_FACING_UP, GymStatues - hidden_object 6, 14, SPRITE_FACING_UP, GymStatues - hidden_object 6, 1, SPRITE_FACING_DOWN, PrintTrashText - ; third param: [wGymTrashCanIndex] - hidden_object 1, 7, 0, GymTrashScript - hidden_object 1, 9, 1, GymTrashScript - hidden_object 1, 11, 2, GymTrashScript - hidden_object 3, 7, 3, GymTrashScript - hidden_object 3, 9, 4, GymTrashScript - hidden_object 3, 11, 5, GymTrashScript - hidden_object 5, 7, 6, GymTrashScript - hidden_object 5, 9, 7, GymTrashScript - hidden_object 5, 11, 8, GymTrashScript - hidden_object 7, 7, 9, GymTrashScript - hidden_object 7, 9, 10, GymTrashScript - hidden_object 7, 11, 11, GymTrashScript - hidden_object 9, 7, 12, GymTrashScript - hidden_object 9, 9, 13, GymTrashScript - hidden_object 9, 11, 14, GymTrashScript - db -1 ; end - -CeladonMansion2HiddenObjects: - hidden_object 0, 5, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -CeladonPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -CeladonGymHiddenObjects: - hidden_object 3, 15, SPRITE_FACING_UP, GymStatues - hidden_object 6, 15, SPRITE_FACING_UP, GymStatues - db -1 ; end - -GameCornerHiddenObjects: - hidden_object 18, 15, ANY_FACING, StartSlotMachine - hidden_object 18, 14, ANY_FACING, StartSlotMachine - hidden_object 18, 13, ANY_FACING, StartSlotMachine - hidden_object 18, 12, ANY_FACING, StartSlotMachine - hidden_object 18, 11, ANY_FACING, StartSlotMachine - hidden_object 18, 10, SLOTS_SOMEONESKEYS, StartSlotMachine - hidden_object 13, 10, ANY_FACING, StartSlotMachine - hidden_object 13, 11, ANY_FACING, StartSlotMachine - hidden_object 13, 12, SLOTS_OUTTOLUNCH, StartSlotMachine - hidden_object 13, 13, ANY_FACING, StartSlotMachine - hidden_object 13, 14, ANY_FACING, StartSlotMachine - hidden_object 13, 15, ANY_FACING, StartSlotMachine - hidden_object 12, 15, ANY_FACING, StartSlotMachine - hidden_object 12, 14, ANY_FACING, StartSlotMachine - hidden_object 12, 13, ANY_FACING, StartSlotMachine - hidden_object 12, 12, ANY_FACING, StartSlotMachine - hidden_object 12, 11, ANY_FACING, StartSlotMachine - hidden_object 12, 10, ANY_FACING, StartSlotMachine - hidden_object 7, 10, ANY_FACING, StartSlotMachine - hidden_object 7, 11, ANY_FACING, StartSlotMachine - hidden_object 7, 12, ANY_FACING, StartSlotMachine - hidden_object 7, 13, ANY_FACING, StartSlotMachine - hidden_object 7, 14, ANY_FACING, StartSlotMachine - hidden_object 7, 15, ANY_FACING, StartSlotMachine - hidden_object 6, 15, ANY_FACING, StartSlotMachine - hidden_object 6, 14, ANY_FACING, StartSlotMachine - hidden_object 6, 13, ANY_FACING, StartSlotMachine - hidden_object 6, 12, SLOTS_OUTOFORDER, StartSlotMachine - hidden_object 6, 11, ANY_FACING, StartSlotMachine - hidden_object 6, 10, ANY_FACING, StartSlotMachine - hidden_object 1, 10, ANY_FACING, StartSlotMachine - hidden_object 1, 11, ANY_FACING, StartSlotMachine - hidden_object 1, 12, ANY_FACING, StartSlotMachine - hidden_object 1, 13, ANY_FACING, StartSlotMachine - hidden_object 1, 14, ANY_FACING, StartSlotMachine - hidden_object 1, 15, ANY_FACING, StartSlotMachine - hidden_object 0, 8, COIN+10, HiddenCoins - hidden_object 1, 16, COIN+10, HiddenCoins - hidden_object 3, 11, COIN+20, HiddenCoins - hidden_object 3, 14, COIN+10, HiddenCoins - hidden_object 4, 12, COIN+10, HiddenCoins - hidden_object 9, 12, COIN+20, HiddenCoins - hidden_object 9, 15, COIN+10, HiddenCoins - hidden_object 16, 14, COIN+10, HiddenCoins - hidden_object 10, 16, COIN+10, HiddenCoins - hidden_object 11, 7, COIN+40, HiddenCoins - hidden_object 15, 8, COIN+100, HiddenCoins - hidden_object 12, 15, COIN+10, HiddenCoins - db -1 ; end - -CeladonHotelHiddenObjects: - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - db -1 ; end - -FuchsiaPokecenterHiddenObjects: - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText - db -1 ; end - -FuchsiaGymHiddenObjects: - hidden_object 3, 15, SPRITE_FACING_UP, GymStatues - hidden_object 6, 15, SPRITE_FACING_UP, GymStatues - db -1 ; end - -CinnabarGymHiddenObjects: - hidden_object 17, 13, SPRITE_FACING_UP, GymStatues - ; third param: ([hGymGateAnswer] << 4) | [hGymGateIndex] - hidden_object 15, 7, (FALSE << 4) | 1, PrintCinnabarQuiz - hidden_object 10, 1, (TRUE << 4) | 2, PrintCinnabarQuiz - hidden_object 9, 7, (TRUE << 4) | 3, PrintCinnabarQuiz - hidden_object 9, 13, (TRUE << 4) | 4, PrintCinnabarQuiz - hidden_object 1, 13, (FALSE << 4) | 5, PrintCinnabarQuiz - hidden_object 1, 7, (TRUE << 4) | 6, PrintCinnabarQuiz - db -1 ; end - -CinnabarPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -SaffronGymHiddenObjects: - hidden_object 9, 15, SPRITE_FACING_UP, GymStatues - db -1 ; end - -MtMoonPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -RockTunnelPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -ViridianForestHiddenObjects: - hidden_object 1, 18, POTION, HiddenItems - hidden_object 16, 42, ANTIDOTE, HiddenItems - db -1 ; end - -MtMoon3HiddenObjects: - hidden_object 18, 12, MOON_STONE, HiddenItems - hidden_object 33, 9, ETHER, HiddenItems - db -1 ; end - -IndigoPlateauHiddenObjects: - hidden_object 8, 13, $ff, PrintIndigoPlateauHQText ; inaccessible - hidden_object 11, 13, SPRITE_FACING_DOWN, PrintIndigoPlateauHQText ; inaccessible - db -1 ; end - -Route25HiddenObjects: - hidden_object 38, 3, ETHER, HiddenItems - hidden_object 10, 1, ELIXER, HiddenItems - db -1 ; end - -Route9HiddenObjects: - hidden_object 14, 7, ETHER, HiddenItems - db -1 ; end - -SSAnne6HiddenObjects: - hidden_object 13, 5, SPRITE_FACING_DOWN, PrintTrashText - hidden_object 13, 7, SPRITE_FACING_DOWN, PrintTrashText - hidden_object 13, 9, GREAT_BALL, HiddenItems - db -1 ; end - -SSAnne10HiddenObjects: - hidden_object 3, 1, HYPER_POTION, HiddenItems - db -1 ; end - -Route10HiddenObjects: - hidden_object 9, 17, SUPER_POTION, HiddenItems - hidden_object 16, 53, MAX_ETHER, HiddenItems - db -1 ; end - -RocketHideout1HiddenObjects: - hidden_object 21, 15, PP_UP, HiddenItems - db -1 ; end - -RocketHideout3HiddenObjects: - hidden_object 27, 17, NUGGET, HiddenItems - db -1 ; end - -RocketHideout4HiddenObjects: - hidden_object 25, 1, SUPER_POTION, HiddenItems - db -1 ; end - -SaffronPokecenterHiddenObjects: - hidden_object 0, 4, SPRITE_FACING_UP, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -PokemonTower5HiddenObjects: - hidden_object 4, 12, ELIXER, HiddenItems - db -1 ; end - -Route13HiddenObjects: - hidden_object 1, 14, PP_UP, HiddenItems - hidden_object 16, 13, CALCIUM, HiddenItems - db -1 ; end - -SafariZoneEntranceHiddenObjects: - hidden_object 10, 1, NUGGET, HiddenItems ; inaccessible - db -1 ; end - -SafariZoneWestHiddenObjects: - hidden_object 6, 5, REVIVE, HiddenItems - db -1 ; end - -SilphCo5FHiddenObjects: - hidden_object 12, 3, ELIXER, HiddenItems - db -1 ; end - -SilphCo9FHiddenObjects: - hidden_object 2, 15, MAX_POTION, HiddenItems - db -1 ; end - -CopycatsHouse2FHiddenObjects: - hidden_object 1, 1, NUGGET, HiddenItems - db -1 ; end - -CeruleanCave1HiddenObjects: - hidden_object 14, 11, RARE_CANDY, HiddenItems - db -1 ; end - -CeruleanCave3HiddenObjects: - hidden_object 27, 3, ULTRA_BALL, HiddenItems - db -1 ; end - -PowerPlantHiddenObjects: - hidden_object 17, 16, MAX_ELIXER, HiddenItems - hidden_object 12, 1, PP_UP, HiddenItems - db -1 ; end - -SeafoamIslands3HiddenObjects: - hidden_object 15, 15, NUGGET, HiddenItems - db -1 ; end - -SeafoamIslands5HiddenObjects: - hidden_object 25, 17, ULTRA_BALL, HiddenItems - db -1 ; end - -Mansion1HiddenObjects: - hidden_object 8, 16, MOON_STONE, HiddenItems - hidden_object 2, 5, SPRITE_FACING_UP, Mansion1Script_Switches - db -1 ; end - -Mansion2HiddenObjects: - hidden_object 2, 11, SPRITE_FACING_UP, Mansion2Script_Switches - db -1 ; end - -Mansion3HiddenObjects: - hidden_object 1, 9, MAX_REVIVE, HiddenItems - hidden_object 10, 5, SPRITE_FACING_UP, Mansion3Script_Switches - db -1 ; end - -Mansion4HiddenObjects: - hidden_object 1, 9, RARE_CANDY, HiddenItems - hidden_object 20, 3, SPRITE_FACING_UP, Mansion4Script_Switches - hidden_object 18, 25, SPRITE_FACING_UP, Mansion4Script_Switches - db -1 ; end - -Route23HiddenObjects: - hidden_object 9, 44, FULL_RESTORE, HiddenItems - hidden_object 19, 70, ULTRA_BALL, HiddenItems - hidden_object 8, 90, MAX_ETHER, HiddenItems - db -1 ; end - -VictoryRoad2HiddenObjects: - hidden_object 5, 2, ULTRA_BALL, HiddenItems - hidden_object 26, 7, FULL_RESTORE, HiddenItems - db -1 ; end - -Unused6FHiddenObjects: - hidden_object 14, 11, MAX_ELIXER, HiddenItems - db -1 ; end - -BillsHouseHiddenObjects: - hidden_object 1, 4, SPRITE_FACING_UP, BillsHousePC - db -1 ; end - -ViridianCityHiddenObjects: - hidden_object 14, 4, POTION, HiddenItems - db -1 ; end - -SafariZoneRestHouse2HiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -SafariZoneRestHouse3HiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -SafariZoneRestHouse4HiddenObjects: - hidden_object 0, 4, SPRITE_FACING_LEFT, PrintBenchGuyText - hidden_object 13, 3, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -Route15GateUpstairsHiddenObjects: - hidden_object 1, 2, SPRITE_FACING_UP, Route15GateLeftBinoculars - db -1 ; end - -LavenderHouse1HiddenObjects: - hidden_object 0, 1, SPRITE_FACING_DOWN, PrintMagazinesText - hidden_object 1, 1, SPRITE_FACING_DOWN, PrintMagazinesText - hidden_object 7, 1, SPRITE_FACING_DOWN, PrintMagazinesText - db -1 ; end - -CeladonMansion5HiddenObjects: - hidden_text_predef 3, 0, LinkCableHelp, PrintBlackboardLinkCableText - hidden_text_predef 4, 0, LinkCableHelp, PrintBlackboardLinkCableText - hidden_text_predef 3, 4, TMNotebook, PrintNotebookText - db -1 ; end - -FightingDojoHiddenObjects: - hidden_object 3, 9, SPRITE_FACING_UP, PrintFightingDojoText - hidden_object 6, 9, SPRITE_FACING_UP, PrintFightingDojoText - hidden_object 4, 0, SPRITE_FACING_UP, PrintFightingDojoText2 - hidden_object 5, 0, SPRITE_FACING_UP, PrintFightingDojoText3 - db -1 ; end - -IndigoPlateauLobbyHiddenObjects: - hidden_object 15, 7, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -CinnabarLab4HiddenObjects: - hidden_object 0, 4, SPRITE_FACING_UP, OpenPokemonCenterPC - hidden_object 2, 4, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -BikeShopHiddenObjects: - hidden_object 1, 0, ANY_FACING, PrintNewBikeText - hidden_object 2, 1, ANY_FACING, PrintNewBikeText - hidden_object 1, 2, ANY_FACING, PrintNewBikeText - hidden_object 3, 2, ANY_FACING, PrintNewBikeText - hidden_object 0, 4, ANY_FACING, PrintNewBikeText - hidden_object 1, 5, ANY_FACING, PrintNewBikeText - db -1 ; end - -Route11HiddenObjects: - hidden_object 48, 5, ESCAPE_ROPE, HiddenItems - db -1 ; end - -Route12HiddenObjects: - hidden_object 2, 63, HYPER_POTION, HiddenItems - db -1 ; end - -SilphCo11FHiddenObjects: - hidden_object 10, 12, SPRITE_FACING_UP, OpenPokemonCenterPC - db -1 ; end - -Route17HiddenObjects: - hidden_object 15, 14, RARE_CANDY, HiddenItems - hidden_object 8, 45, FULL_RESTORE, HiddenItems - hidden_object 17, 72, PP_UP, HiddenItems - hidden_object 4, 91, MAX_REVIVE, HiddenItems - hidden_object 8, 121, MAX_ELIXER, HiddenItems - db -1 ; end - -UndergroundPathNsHiddenObjects: - hidden_object 3, 4, FULL_RESTORE, HiddenItems - hidden_object 4, 34, X_SPECIAL, HiddenItems - db -1 ; end - -UndergroundPathWeHiddenObjects: - hidden_object 12, 2, NUGGET, HiddenItems - hidden_object 21, 5, ELIXER, HiddenItems - db -1 ; end - -CeladonCityHiddenObjects: - hidden_object 48, 15, PP_UP, HiddenItems - db -1 ; end - -SeafoamIslands4HiddenObjects: - hidden_object 9, 16, MAX_ELIXER, HiddenItems - db -1 ; end - -VermilionCityHiddenObjects: - hidden_object 14, 11, MAX_ETHER, HiddenItems - db -1 ; end - -CeruleanCityHiddenObjects: - hidden_object 15, 8, RARE_CANDY, HiddenItems - db -1 ; end - -Route4HiddenObjects: - hidden_object 40, 3, GREAT_BALL, HiddenItems - db -1 ; end diff --git a/data/predef_pointers.asm b/data/predef_pointers.asm index 19c3ea8f..b3bb1643 100644 --- a/data/predef_pointers.asm +++ b/data/predef_pointers.asm @@ -39,7 +39,7 @@ PredefPointers:: add_predef LearnMoveFromLevelUp add_predef LearnMove add_predef GetQuantityOfItemInBag - add_predef CheckForHiddenObjectOrBookshelfOrCardKeyDoor, $03 ; home bank + add_predef CheckForHiddenEventOrBookshelfOrCardKeyDoor, $03 ; home bank add_predef GiveItem, $03 ; home bank add_predef ChangeBGPalColor0_4Frames add_predef FindPathToPlayer diff --git a/engine/events/hidden_events/bench_guys.asm b/engine/events/hidden_events/bench_guys.asm new file mode 100644 index 00000000..e5a2a724 --- /dev/null +++ b/engine/events/hidden_events/bench_guys.asm @@ -0,0 +1,107 @@ +PrintBenchGuyText: + call EnableAutoTextBoxDrawing + ld hl, BenchGuyTextPointers + ld a, [wCurMap] + ld b, a +.loop + ld a, [hli] + cp -1 + ret z + cp b + jr z, .match + inc hl + inc hl + jr .loop +.match + ld a, [hli] + ld b, a + ld a, [wSpritePlayerStateData1FacingDirection] + cp b + + ; bug: an 'inc hl' instruction is needed before looping back. When trying to + ; talk to a bench guy from above, this Sprite Facing test will fail, and the + ; next loop iteration will be misaligned within BenchGuyTextPointers table. + ; As a result, the routine will miss the terminator byte, and continue to + ; process data beyond the table boundary. + ; It seems that it will only return after starting to read data from VRAM + ; (According to Pan Docs, during PPU mode 3, reads return garbage value, + ; usually $FF). + jr nz, .loop ; player isn't facing the bench guy + ld a, [hl] + jp PrintPredefTextID + +INCLUDE "data/events/bench_guys.asm" + +ViridianCityPokecenterBenchGuyText:: + text_far _ViridianCityPokecenterGuyText + text_end + +PewterCityPokecenterBenchGuyText:: + text_far _PewterCityPokecenterGuyText + text_end + +CeruleanCityPokecenterBenchGuyText:: + text_far _CeruleanPokecenterGuyText + text_end + +LavenderCityPokecenterBenchGuyText:: + text_far _LavenderPokecenterGuyText + text_end + +MtMoonPokecenterBenchGuyText:: + text_far _MtMoonPokecenterBenchGuyText + text_end + +RockTunnelPokecenterBenchGuyText:: + text_far _RockTunnelPokecenterGuyText + text_end + +UnusedBenchGuyText1:: + text_far _UnusedBenchGuyText1 + text_end + +UnusedBenchGuyText2:: + text_far _UnusedBenchGuyText2 + text_end + +UnusedBenchGuyText3:: + text_far _UnusedBenchGuyText3 + text_end + +VermilionCityPokecenterBenchGuyText:: + text_far _VermilionPokecenterGuyText + text_end + +CeladonCityPokecenterBenchGuyText:: + text_far _CeladonCityPokecenterGuyText + text_end + +FuchsiaCityPokecenterBenchGuyText:: + text_far _FuchsiaCityPokecenterGuyText + text_end + +CinnabarIslandPokecenterBenchGuyText:: + text_far _CinnabarPokecenterGuyText + text_end + +SaffronCityPokecenterBenchGuyText:: + text_asm + CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI + ld hl, SaffronCityPokecenterBenchGuyText2 + jr nz, .printText + ld hl, SaffronCityPokecenterBenchGuyText1 +.printText + call PrintText + jp TextScriptEnd + +SaffronCityPokecenterBenchGuyText1: + text_far _SaffronCityPokecenterGuyText1 + text_end + +SaffronCityPokecenterBenchGuyText2: + text_far _SaffronCityPokecenterGuyText2 + text_end + +CeladonCityHotelText:: + text_far _CeladonCityHotelText + text_end diff --git a/engine/events/hidden_events/bills_house_pc.asm b/engine/events/hidden_events/bills_house_pc.asm new file mode 100644 index 00000000..3972e20c --- /dev/null +++ b/engine/events/hidden_events/bills_house_pc.asm @@ -0,0 +1,134 @@ +BillsHousePC: + call EnableAutoTextBoxDrawing + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING + jr nz, .displayBillsHousePokemonList + CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL + jr nz, .displayBillsHouseMonitorText + CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR + jr nz, .doCellSeparator +.displayBillsHouseMonitorText + tx_pre_jump BillsHouseMonitorText +.doCellSeparator + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + tx_pre BillsHouseInitiatedText + ld c, 32 + call DelayFrames + ld a, SFX_TINK + call PlaySound + call WaitForSoundToFinish + ld c, 80 + call DelayFrames + ld a, SFX_SHRINK + call PlaySound + call WaitForSoundToFinish + ld c, 48 + call DelayFrames + ld a, SFX_TINK + call PlaySound + call WaitForSoundToFinish + ld c, 32 + call DelayFrames + ld a, SFX_GET_ITEM_1 + call PlaySound + call WaitForSoundToFinish + call PlayDefaultMusic + SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL + ret +.displayBillsHousePokemonList + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + tx_pre BillsHousePokemonList + ret + +BillsHouseMonitorText:: + text_far _BillsHouseMonitorText + text_end + +BillsHouseInitiatedText:: + text_far _BillsHouseInitiatedText + text_promptbutton + text_asm + ld a, SFX_STOP_ALL_MUSIC + ld [wNewSoundID], a + call PlaySound + ld c, 16 + call DelayFrames + ld a, SFX_SWITCH + call PlaySound + call WaitForSoundToFinish + ld c, 60 + call DelayFrames + jp TextScriptEnd + +BillsHousePokemonList:: + text_asm + call SaveScreenTilesToBuffer1 + ld hl, BillsHousePokemonListText1 + call PrintText + xor a + ld [wMenuItemOffset], a ; not used + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld a, PAD_A | PAD_B + ld [wMenuWatchedKeys], a + ld a, 4 + ld [wMaxMenuItem], a + ld a, 2 + ld [wTopMenuItemY], a + ld a, 1 + ld [wTopMenuItemX], a +.billsPokemonLoop + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] + hlcoord 0, 0 + ld b, 10 + ld c, 9 + call TextBoxBorder + hlcoord 2, 2 + ld de, BillsMonListText + call PlaceString + ld hl, BillsHousePokemonListText2 + call PrintText + call SaveScreenTilesToBuffer2 + call HandleMenuInput + bit B_PAD_B, a + jr nz, .cancel + ld a, [wCurrentMenuItem] + add EEVEE + cp EEVEE + jr z, .displayPokedex + cp FLAREON + jr z, .displayPokedex + cp JOLTEON + jr z, .displayPokedex + cp VAPOREON + jr z, .displayPokedex + jr .cancel +.displayPokedex + call DisplayPokedex + call LoadScreenTilesFromBuffer2 + jr .billsPokemonLoop +.cancel + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + call LoadScreenTilesFromBuffer2 + jp TextScriptEnd + +BillsHousePokemonListText1: + text_far _BillsHousePokemonListText1 + text_end + +BillsMonListText: + db "EEVEE" + next "FLAREON" + next "JOLTEON" + next "VAPOREON" + next "CANCEL@" + +BillsHousePokemonListText2: + text_far _BillsHousePokemonListText2 + text_end diff --git a/engine/events/hidden_events/blues_room.asm b/engine/events/hidden_events/blues_room.asm new file mode 100644 index 00000000..bcbad556 --- /dev/null +++ b/engine/events/hidden_events/blues_room.asm @@ -0,0 +1,13 @@ + + ret ; unused + +UnusedPredefText:: + db "@" + +PrintBookcaseText: + call EnableAutoTextBoxDrawing + tx_pre_jump BookcaseText + +BookcaseText:: + text_far _BookcaseText + text_end diff --git a/engine/events/hidden_events/book_or_sculpture.asm b/engine/events/hidden_events/book_or_sculpture.asm new file mode 100644 index 00000000..e04f4047 --- /dev/null +++ b/engine/events/hidden_events/book_or_sculpture.asm @@ -0,0 +1,21 @@ +BookOrSculptureText:: + text_asm + ld hl, PokemonBooksText + ld a, [wCurMapTileset] + cp MANSION ; Celadon Mansion tileset + jr nz, .ok + lda_coord 8, 6 + cp $38 + jr nz, .ok + ld hl, DiglettSculptureText +.ok + call PrintText + jp TextScriptEnd + +PokemonBooksText: + text_far _PokemonBooksText + text_end + +DiglettSculptureText: + text_far _DiglettSculptureText + text_end diff --git a/engine/events/hidden_events/bookshelves.asm b/engine/events/hidden_events/bookshelves.asm new file mode 100644 index 00000000..813cfc49 --- /dev/null +++ b/engine/events/hidden_events/bookshelves.asm @@ -0,0 +1,39 @@ +; prints text for bookshelves in buildings without sign events +PrintBookshelfText:: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + jr nz, .noMatch +; facing up + ld a, [wCurMapTileset] + ld b, a + lda_coord 8, 7 + ld c, a + ld hl, BookshelfTileIDs +.loop + ld a, [hli] + cp $ff + jr z, .noMatch + cp b + jr nz, .nextBookshelfEntry1 + ld a, [hli] + cp c + jr nz, .nextBookshelfEntry2 + ld a, [hl] + push af + call EnableAutoTextBoxDrawing + pop af + call PrintPredefTextID + xor a + ldh [hInteractedWithBookshelf], a + ret +.nextBookshelfEntry1 + inc hl +.nextBookshelfEntry2 + inc hl + jr .loop +.noMatch + ld a, $ff + ldh [hInteractedWithBookshelf], a + farjp PrintCardKeyText + +INCLUDE "data/tilesets/bookshelf_tile_ids.asm" diff --git a/engine/events/hidden_events/cinnabar_gym_quiz.asm b/engine/events/hidden_events/cinnabar_gym_quiz.asm new file mode 100644 index 00000000..9762c214 --- /dev/null +++ b/engine/events/hidden_events/cinnabar_gym_quiz.asm @@ -0,0 +1,200 @@ +PrintCinnabarQuiz: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + call EnableAutoTextBoxDrawing + tx_pre_jump CinnabarGymQuiz + +CinnabarGymQuiz:: + text_asm + xor a + ld [wOpponentAfterWrongAnswer], a + ld a, [wHiddenEventFunctionArgument] + push af + and $f + ldh [hGymGateIndex], a + pop af + and $f0 + swap a + ldh [hGymGateAnswer], a + ld hl, CinnabarGymQuizIntroText + call PrintText + ldh a, [hGymGateIndex] + dec a + add a + ld d, 0 + ld e, a + ld hl, CinnabarQuizQuestions + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + call PrintText + ld a, 1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + call CinnabarGymQuiz_AskQuestion + jp TextScriptEnd + +CinnabarGymQuizIntroText: + text_far _CinnabarGymQuizIntroText + text_end + +CinnabarQuizQuestions: + dw CinnabarQuizQuestionsText1 + dw CinnabarQuizQuestionsText2 + dw CinnabarQuizQuestionsText3 + dw CinnabarQuizQuestionsText4 + dw CinnabarQuizQuestionsText5 + dw CinnabarQuizQuestionsText6 + +CinnabarQuizQuestionsText1: + text_far _CinnabarQuizQuestionsText1 + text_end + +CinnabarQuizQuestionsText2: + text_far _CinnabarQuizQuestionsText2 + text_end + +CinnabarQuizQuestionsText3: + text_far _CinnabarQuizQuestionsText3 + text_end + +CinnabarQuizQuestionsText4: + text_far _CinnabarQuizQuestionsText4 + text_end + +CinnabarQuizQuestionsText5: + text_far _CinnabarQuizQuestionsText5 + text_end + +CinnabarQuizQuestionsText6: + text_far _CinnabarQuizQuestionsText6 + text_end + +CinnabarGymGateFlagAction: + EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED + predef_jump FlagActionPredef + +CinnabarGymQuiz_AskQuestion: + call YesNoChoice + ldh a, [hGymGateAnswer] + ld c, a + ld a, [wCurrentMenuItem] + cp c + jr nz, .wrongAnswer + ld hl, wCurrentMapScriptFlags + set BIT_CUR_MAP_LOADED_1, [hl] + ldh a, [hGymGateIndex] + ldh [hBackupGymGateIndex], a + ld hl, CinnabarGymQuizCorrectText + call PrintText + ldh a, [hBackupGymGateIndex] + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 + ld c, a + ld b, FLAG_SET + call CinnabarGymGateFlagAction + jp UpdateCinnabarGymGateTileBlocks_ +.wrongAnswer + call WaitForSoundToFinish + ld a, SFX_DENIED + call PlaySound + call WaitForSoundToFinish + ld hl, CinnabarGymQuizIncorrectText + call PrintText + ldh a, [hGymGateIndex] + add $2 + AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 + ld c, a + ld b, FLAG_TEST + EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 + predef FlagActionPredef + ld a, c + and a + ret nz + ldh a, [hGymGateIndex] + add $2 + ld [wOpponentAfterWrongAnswer], a + ret + +CinnabarGymQuizCorrectText: + sound_get_item_1 + text_far _CinnabarGymQuizCorrectText + text_promptbutton + text_asm + + ldh a, [hBackupGymGateIndex] + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 + ld c, a + ld b, FLAG_TEST + call CinnabarGymGateFlagAction + ld a, c + and a + jp nz, TextScriptEnd + call WaitForSoundToFinish + ld a, SFX_GO_INSIDE + call PlaySound + call WaitForSoundToFinish + jp TextScriptEnd + +CinnabarGymQuizIncorrectText: + text_far _CinnabarGymQuizIncorrectText + text_end + +UpdateCinnabarGymGateTileBlocks_:: +; Update the overworld map with open floor blocks or locked gate blocks +; depending on event flags. + ld a, 6 + ldh [hGymGateIndex], a +.loop + ldh a, [hGymGateIndex] + dec a + add a + add a + ld d, 0 + ld e, a + ld hl, CinnabarGymGateCoords + add hl, de + ld a, [hli] + ld b, [hl] + ld c, a + inc hl + ld a, [hl] + ld [wGymGateTileBlock], a + push bc + ldh a, [hGymGateIndex] + ldh [hBackupGymGateIndex], a + AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 + ld c, a + ld b, FLAG_TEST + call CinnabarGymGateFlagAction + ld a, c + and a + jr nz, .unlocked + ld a, [wGymGateTileBlock] + jr .next +.unlocked + ld a, $e +.next + pop bc + ld [wNewTileBlockID], a + predef ReplaceTileBlock + ld hl, hGymGateIndex + dec [hl] + jr nz, .loop + ret + +MACRO gym_gate_coord + db \1, \2, \3, 0 +ENDM + +DEF HORIZONTAL_GATE_BLOCK EQU $54 +DEF VERTICAL_GATE_BLOCK EQU $5f + +CinnabarGymGateCoords: + ; x coord, y coord, block id + gym_gate_coord 9, 3, HORIZONTAL_GATE_BLOCK + gym_gate_coord 6, 3, HORIZONTAL_GATE_BLOCK + gym_gate_coord 6, 6, HORIZONTAL_GATE_BLOCK + gym_gate_coord 3, 8, VERTICAL_GATE_BLOCK + gym_gate_coord 2, 6, HORIZONTAL_GATE_BLOCK + gym_gate_coord 2, 3, HORIZONTAL_GATE_BLOCK diff --git a/engine/events/hidden_events/elevator.asm b/engine/events/hidden_events/elevator.asm new file mode 100644 index 00000000..ab0f731f --- /dev/null +++ b/engine/events/hidden_events/elevator.asm @@ -0,0 +1,3 @@ +ElevatorText:: + text_far _ElevatorText + text_end diff --git a/engine/events/hidden_events/fighting_dojo.asm b/engine/events/hidden_events/fighting_dojo.asm new file mode 100644 index 00000000..b4f89985 --- /dev/null +++ b/engine/events/hidden_events/fighting_dojo.asm @@ -0,0 +1,23 @@ +PrintFightingDojoText2: + call EnableAutoTextBoxDrawing + tx_pre_jump EnemiesOnEverySideText + +EnemiesOnEverySideText:: + text_far _EnemiesOnEverySideText + text_end + +PrintFightingDojoText3: + call EnableAutoTextBoxDrawing + tx_pre_jump WhatGoesAroundComesAroundText + +WhatGoesAroundComesAroundText:: + text_far _WhatGoesAroundComesAroundText + text_end + +PrintFightingDojoText: + call EnableAutoTextBoxDrawing + tx_pre_jump FightingDojoText + +FightingDojoText:: + text_far _FightingDojoText + text_end diff --git a/engine/events/hidden_events/gym_statues.asm b/engine/events/hidden_events/gym_statues.asm new file mode 100644 index 00000000..1c7eb970 --- /dev/null +++ b/engine/events/hidden_events/gym_statues.asm @@ -0,0 +1,39 @@ +GymStatues: +; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID +; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID +; else ret + call EnableAutoTextBoxDrawing + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + ld hl, MapBadgeFlags + ld a, [wCurMap] + ld b, a +.loop + ld a, [hli] + cp $ff + ret z + cp b + jr z, .match + inc hl + jr .loop +.match + ld b, [hl] + ld a, [wBeatGymFlags] + and b + cp b + tx_pre_id GymStatueText2 + jr z, .haveBadge + tx_pre_id GymStatueText1 +.haveBadge + jp PrintPredefTextID + +INCLUDE "data/maps/badge_maps.asm" + +GymStatueText1:: + text_far _GymStatueText1 + text_end + +GymStatueText2:: + text_far _GymStatueText2 + text_end diff --git a/engine/events/hidden_events/indigo_plateau_hq.asm b/engine/events/hidden_events/indigo_plateau_hq.asm new file mode 100644 index 00000000..e8fd0220 --- /dev/null +++ b/engine/events/hidden_events/indigo_plateau_hq.asm @@ -0,0 +1,10 @@ +PrintIndigoPlateauHQText: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + call EnableAutoTextBoxDrawing + tx_pre_jump IndigoPlateauHQText + +IndigoPlateauHQText:: + text_far _IndigoPlateauHQText + text_end diff --git a/engine/events/hidden_events/indigo_plateau_statues.asm b/engine/events/hidden_events/indigo_plateau_statues.asm new file mode 100644 index 00000000..f78a5a72 --- /dev/null +++ b/engine/events/hidden_events/indigo_plateau_statues.asm @@ -0,0 +1,24 @@ +IndigoPlateauStatues:: + text_asm + ld hl, IndigoPlateauStatuesText1 + call PrintText + ld a, [wXCoord] + bit 0, a ; even or odd? + ld hl, IndigoPlateauStatuesText2 + jr nz, .ok + ld hl, IndigoPlateauStatuesText3 +.ok + call PrintText + jp TextScriptEnd + +IndigoPlateauStatuesText1: + text_far _IndigoPlateauStatuesText1 + text_end + +IndigoPlateauStatuesText2: + text_far _IndigoPlateauStatuesText2 + text_end + +IndigoPlateauStatuesText3: + text_far _IndigoPlateauStatuesText3 + text_end diff --git a/engine/events/hidden_events/magazines.asm b/engine/events/hidden_events/magazines.asm new file mode 100644 index 00000000..b58636ff --- /dev/null +++ b/engine/events/hidden_events/magazines.asm @@ -0,0 +1,8 @@ +PrintMagazinesText: + call EnableAutoTextBoxDrawing + tx_pre MagazinesText + ret + +MagazinesText:: + text_far _MagazinesText + text_end diff --git a/engine/events/hidden_events/museum_fossils.asm b/engine/events/hidden_events/museum_fossils.asm new file mode 100644 index 00000000..df74293f --- /dev/null +++ b/engine/events/hidden_events/museum_fossils.asm @@ -0,0 +1,51 @@ +AerodactylFossil: + ld a, FOSSIL_AERODACTYL + ld [wCurPartySpecies], a + call DisplayMonFrontSpriteInBox + call EnableAutoTextBoxDrawing + tx_pre AerodactylFossilText + ret + +AerodactylFossilText:: + text_far _AerodactylFossilText + text_end + +KabutopsFossil: + ld a, FOSSIL_KABUTOPS + ld [wCurPartySpecies], a + call DisplayMonFrontSpriteInBox + call EnableAutoTextBoxDrawing + tx_pre KabutopsFossilText + ret + +KabutopsFossilText:: + text_far _KabutopsFossilText + text_end + +DisplayMonFrontSpriteInBox: +; Displays a pokemon's front sprite in a pop-up window. + ld a, 1 + ldh [hAutoBGTransferEnabled], a + call Delay3 + xor a + ldh [hWY], a + call SaveScreenTilesToBuffer1 + ld a, MON_SPRITE_POPUP + ld [wTextBoxID], a + call DisplayTextBoxID + call UpdateSprites + ld a, [wCurPartySpecies] + ld [wCurSpecies], a + call GetMonHeader + ld de, vChars1 tile $31 + call LoadMonFrontSprite + ld a, $80 + ldh [hStartTileID], a + hlcoord 10, 11 + predef AnimateSendingOutMon + call WaitForTextScrollButtonPress + call LoadScreenTilesFromBuffer1 + call Delay3 + ld a, $90 + ldh [hWY], a + ret diff --git a/engine/events/hidden_events/new_bike.asm b/engine/events/hidden_events/new_bike.asm new file mode 100644 index 00000000..5bce5937 --- /dev/null +++ b/engine/events/hidden_events/new_bike.asm @@ -0,0 +1,7 @@ +PrintNewBikeText: + call EnableAutoTextBoxDrawing + tx_pre_jump NewBicycleText + +NewBicycleText:: + text_far _NewBicycleText + text_end diff --git a/engine/events/hidden_events/oaks_lab_email.asm b/engine/events/hidden_events/oaks_lab_email.asm new file mode 100644 index 00000000..b66babe0 --- /dev/null +++ b/engine/events/hidden_events/oaks_lab_email.asm @@ -0,0 +1,10 @@ +DisplayOakLabEmailText: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + call EnableAutoTextBoxDrawing + tx_pre_jump OakLabEmailText + +OakLabEmailText:: + text_far _OakLabEmailText + text_end diff --git a/engine/events/hidden_events/oaks_lab_posters.asm b/engine/events/hidden_events/oaks_lab_posters.asm new file mode 100644 index 00000000..502cf951 --- /dev/null +++ b/engine/events/hidden_events/oaks_lab_posters.asm @@ -0,0 +1,29 @@ +DisplayOakLabLeftPoster: + call EnableAutoTextBoxDrawing + tx_pre_jump PushStartText + +PushStartText:: + text_far _PushStartText + text_end + +DisplayOakLabRightPoster: + call EnableAutoTextBoxDrawing + ld hl, wPokedexOwned + ld b, wPokedexOwnedEnd - wPokedexOwned + call CountSetBits + ld a, [wNumSetBits] + cp 2 + tx_pre_id SaveOptionText + jr c, .ownLessThanTwo + ; own two or more mon + tx_pre_id StrengthsAndWeaknessesText +.ownLessThanTwo + jp PrintPredefTextID + +SaveOptionText:: + text_far _SaveOptionText + text_end + +StrengthsAndWeaknessesText:: + text_far _StrengthsAndWeaknessesText + text_end diff --git a/engine/events/hidden_events/pokecenter_pc.asm b/engine/events/hidden_events/pokecenter_pc.asm new file mode 100644 index 00000000..59867d1a --- /dev/null +++ b/engine/events/hidden_events/pokecenter_pc.asm @@ -0,0 +1,11 @@ +OpenPokemonCenterPC: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + call EnableAutoTextBoxDrawing + ld a, 1 << BIT_NO_AUTO_TEXT_BOX + ld [wAutoTextBoxDrawingControl], a + tx_pre_jump PokemonCenterPCText + +PokemonCenterPCText:: + script_pokecenter_pc diff --git a/engine/events/hidden_events/pokemon_stuff.asm b/engine/events/hidden_events/pokemon_stuff.asm new file mode 100644 index 00000000..267a191a --- /dev/null +++ b/engine/events/hidden_events/pokemon_stuff.asm @@ -0,0 +1,3 @@ +PokemonStuffText:: + text_far _PokemonStuffText + text_end diff --git a/engine/events/hidden_events/reds_room.asm b/engine/events/hidden_events/reds_room.asm new file mode 100644 index 00000000..7b8d51a0 --- /dev/null +++ b/engine/events/hidden_events/reds_room.asm @@ -0,0 +1,14 @@ +PrintRedSNESText: + call EnableAutoTextBoxDrawing + tx_pre_jump RedBedroomSNESText + +RedBedroomSNESText:: + text_far _RedBedroomSNESText + text_end + +OpenRedsPC: + call EnableAutoTextBoxDrawing + tx_pre_jump RedBedroomPCText + +RedBedroomPCText:: + script_players_pc diff --git a/engine/events/hidden_events/route_15_binoculars.asm b/engine/events/hidden_events/route_15_binoculars.asm new file mode 100644 index 00000000..733ab73e --- /dev/null +++ b/engine/events/hidden_events/route_15_binoculars.asm @@ -0,0 +1,14 @@ +Route15GateLeftBinoculars: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + ret nz + call EnableAutoTextBoxDrawing + tx_pre Route15UpstairsBinocularsText + ld a, ARTICUNO + ld [wCurPartySpecies], a + call PlayCry + jp DisplayMonFrontSpriteInBox + +Route15UpstairsBinocularsText:: + text_far _Route15UpstairsBinocularsText + text_end diff --git a/engine/events/hidden_events/safari_game.asm b/engine/events/hidden_events/safari_game.asm new file mode 100644 index 00000000..fc014ce0 --- /dev/null +++ b/engine/events/hidden_events/safari_game.asm @@ -0,0 +1,83 @@ +SafariZoneCheck:: + CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone, + jr z, SafariZoneGameStillGoing ; don't bother printing game over text + ld a, [wNumSafariBalls] + and a + jr z, SafariZoneGameOver + jr SafariZoneGameStillGoing + +SafariZoneCheckSteps:: +IF DEF(_DEBUG) + call DebugPressedOrHeldB + ret nz +ENDC + ld a, [wSafariSteps] + ld b, a + ld a, [wSafariSteps + 1] + ld c, a + or b + jr z, SafariZoneGameOver + dec bc + ld a, b + ld [wSafariSteps], a + ld a, c + ld [wSafariSteps + 1], a +SafariZoneGameStillGoing: + xor a + ld [wSafariZoneGameOver], a + ret + +SafariZoneGameOver: + call EnableAutoTextBoxDrawing + xor a + ld [wAudioFadeOutControl], a + dec a ; SFX_STOP_ALL_MUSIC + call PlaySound + ld c, BANK(SFX_Safari_Zone_PA) + ld a, SFX_SAFARI_ZONE_PA + call PlayMusic +.waitForMusicToPlay + ld a, [wChannelSoundIDs + CHAN5] + cp SFX_SAFARI_ZONE_PA + jr nz, .waitForMusicToPlay + ld a, TEXT_SAFARI_GAME_OVER + ldh [hTextID], a + call DisplayTextID + xor a + ld [wPlayerMovingDirection], a + ld a, SAFARI_ZONE_GATE + ldh [hWarpDestinationMap], a + ld a, $3 + ld [wDestinationWarpID], a + ld a, SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI + ld [wSafariZoneGateCurScript], a + SetEvent EVENT_SAFARI_GAME_OVER + ld a, 1 + ld [wSafariZoneGameOver], a + ret + +PrintSafariGameOverText:: + xor a + ld [wJoyIgnore], a + ld hl, SafariGameOverText + jp PrintText + +SafariGameOverText: + text_asm + ld a, [wNumSafariBalls] + and a + jr z, .noMoreSafariBalls + ld hl, TimesUpText + call PrintText +.noMoreSafariBalls + ld hl, GameOverText + call PrintText + jp TextScriptEnd + +TimesUpText: + text_far _TimesUpText + text_end + +GameOverText: + text_far _GameOverText + text_end diff --git a/engine/events/hidden_events/school_blackboard.asm b/engine/events/hidden_events/school_blackboard.asm new file mode 100644 index 00000000..71e24ed0 --- /dev/null +++ b/engine/events/hidden_events/school_blackboard.asm @@ -0,0 +1,224 @@ +PrintBlackboardLinkCableText: + call EnableAutoTextBoxDrawing + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld a, [wHiddenEventFunctionArgument] + call PrintPredefTextID + ret + +LinkCableHelp:: + text_asm + call SaveScreenTilesToBuffer1 + ld hl, LinkCableHelpText1 + call PrintText + xor a + ld [wMenuItemOffset], a ; not used + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld a, PAD_A | PAD_B + ld [wMenuWatchedKeys], a + ld a, 3 + ld [wMaxMenuItem], a + ld a, 2 + ld [wTopMenuItemY], a + ld a, 1 + ld [wTopMenuItemX], a +.linkHelpLoop + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] + hlcoord 0, 0 + ld b, 8 + ld c, 13 + call TextBoxBorder + hlcoord 2, 2 + ld de, HowToLinkText + call PlaceString + ld hl, LinkCableHelpText2 + call PrintText + call HandleMenuInput + bit B_PAD_B, a + jr nz, .exit + ld a, [wCurrentMenuItem] + cp 3 ; pressed a on "STOP READING" + jr z, .exit + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + ld hl, LinkCableInfoTexts + add a + ld d, 0 + ld e, a + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + call PrintText + jp .linkHelpLoop +.exit + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + call LoadScreenTilesFromBuffer1 + jp TextScriptEnd + +LinkCableHelpText1: + text_far _LinkCableHelpText1 + text_end + +LinkCableHelpText2: + text_far _LinkCableHelpText2 + text_end + +HowToLinkText: + db "HOW TO LINK" + next "COLOSSEUM" + next "TRADE CENTER" + next "STOP READING@" + +LinkCableInfoTexts: + dw LinkCableInfoText1 + dw LinkCableInfoText2 + dw LinkCableInfoText3 + +LinkCableInfoText1: + text_far _LinkCableInfoText1 + text_end + +LinkCableInfoText2: + text_far _LinkCableInfoText2 + text_end + +LinkCableInfoText3: + text_far _LinkCableInfoText3 + text_end + +ViridianSchoolBlackboard:: + text_asm + call SaveScreenTilesToBuffer1 + ld hl, ViridianSchoolBlackboardText1 + call PrintText + xor a + ld [wMenuItemOffset], a + ld [wCurrentMenuItem], a + ld [wLastMenuItem], a + ld a, PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B + ld [wMenuWatchedKeys], a + ld a, 2 + ld [wMaxMenuItem], a + ld a, 2 + ld [wTopMenuItemY], a + ld a, 1 + ld [wTopMenuItemX], a +.blackboardLoop + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] + hlcoord 0, 0 + lb bc, 6, 10 + call TextBoxBorder + hlcoord 1, 2 + ld de, StatusAilmentText1 + call PlaceString + hlcoord 6, 2 + ld de, StatusAilmentText2 + call PlaceString + ld hl, ViridianSchoolBlackboardText2 + call PrintText + call HandleMenuInput ; pressing up and down is handled in here + bit B_PAD_B, a ; pressed b + jr nz, .exitBlackboard + bit B_PAD_RIGHT, a + jr z, .didNotPressRight + ; move cursor to right column + ld a, 2 + ld [wMaxMenuItem], a + ld a, 2 + ld [wTopMenuItemY], a + ld a, 6 + ld [wTopMenuItemX], a + ld a, 3 ; in the the right column, use an offset to prevent overlap + ld [wMenuItemOffset], a + jr .blackboardLoop +.didNotPressRight + bit B_PAD_LEFT, a + jr z, .didNotPressLeftOrRight + ; move cursor to left column + ld a, 2 + ld [wMaxMenuItem], a + ld a, 2 + ld [wTopMenuItemY], a + ld a, 1 + ld [wTopMenuItemX], a + xor a + ld [wMenuItemOffset], a + jr .blackboardLoop +.didNotPressLeftOrRight + ld a, [wCurrentMenuItem] + ld b, a + ld a, [wMenuItemOffset] + add b + cp 5 ; cursor is pointing to "QUIT" + jr z, .exitBlackboard + ; we must have pressed a on a status condition + ; so print the text + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + ld hl, ViridianBlackboardStatusPointers + add a + ld d, 0 + ld e, a + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + call PrintText + jp .blackboardLoop +.exitBlackboard + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + call LoadScreenTilesFromBuffer1 + jp TextScriptEnd + +ViridianSchoolBlackboardText1: + text_far _ViridianSchoolBlackboardText1 + text_end + +ViridianSchoolBlackboardText2: + text_far _ViridianSchoolBlackboardText2 + text_end + +StatusAilmentText1: + db " SLP" + next " PSN" + next " PAR@" + +StatusAilmentText2: + db " BRN" + next " FRZ" + next " QUIT@" + + db "@" ; unused + +ViridianBlackboardStatusPointers: + dw ViridianBlackboardSleepText + dw ViridianBlackboardPoisonText + dw ViridianBlackboardPrlzText + dw ViridianBlackboardBurnText + dw ViridianBlackboardFrozenText + +ViridianBlackboardSleepText: + text_far _ViridianBlackboardSleepText + text_end + +ViridianBlackboardPoisonText: + text_far _ViridianBlackboardPoisonText + text_end + +ViridianBlackboardPrlzText: + text_far _ViridianBlackboardPrlzText + text_end + +ViridianBlackboardBurnText: + text_far _ViridianBlackboardBurnText + text_end + +ViridianBlackboardFrozenText: + text_far _ViridianBlackboardFrozenText + text_end diff --git a/engine/events/hidden_events/school_notebooks.asm b/engine/events/hidden_events/school_notebooks.asm new file mode 100644 index 00000000..2387c089 --- /dev/null +++ b/engine/events/hidden_events/school_notebooks.asm @@ -0,0 +1,65 @@ +PrintNotebookText: + call EnableAutoTextBoxDrawing + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld a, [wHiddenEventFunctionArgument] + jp PrintPredefTextID + +TMNotebook:: + text_far TMNotebookText + text_waitbutton + text_end + +ViridianSchoolNotebook:: + text_asm + ld hl, ViridianSchoolNotebookText1 + call PrintText + call TurnPageSchoolNotebook + jr nz, .doneReading + ld hl, ViridianSchoolNotebookText2 + call PrintText + call TurnPageSchoolNotebook + jr nz, .doneReading + ld hl, ViridianSchoolNotebookText3 + call PrintText + call TurnPageSchoolNotebook + jr nz, .doneReading + ld hl, ViridianSchoolNotebookText4 + call PrintText + ld hl, ViridianSchoolNotebookText5 + call PrintText +.doneReading + jp TextScriptEnd + +TurnPageSchoolNotebook: + ld hl, TurnPageText + call PrintText + call YesNoChoice + ld a, [wCurrentMenuItem] + and a + ret + +TurnPageText: + text_far _TurnPageText + text_end + +ViridianSchoolNotebookText5: + text_far _ViridianSchoolNotebookText5 + text_waitbutton + text_end + +ViridianSchoolNotebookText1: + text_far _ViridianSchoolNotebookText1 + text_end + +ViridianSchoolNotebookText2: + text_far _ViridianSchoolNotebookText2 + text_end + +ViridianSchoolNotebookText3: + text_far _ViridianSchoolNotebookText3 + text_end + +ViridianSchoolNotebookText4: + text_far _ViridianSchoolNotebookText4 + text_end diff --git a/engine/events/hidden_events/town_map.asm b/engine/events/hidden_events/town_map.asm new file mode 100644 index 00000000..11f7cbc7 --- /dev/null +++ b/engine/events/hidden_events/town_map.asm @@ -0,0 +1,22 @@ +TownMapText:: + text_far _TownMapText + text_promptbutton + text_asm + ld a, $1 + ld [wDoNotWaitForButtonPressAfterDisplayingText], a + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] + call GBPalWhiteOutWithDelay3 + xor a + ldh [hWY], a + inc a + ldh [hAutoBGTransferEnabled], a + call LoadFontTilePatterns + farcall DisplayTownMap + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] + ld de, TextScriptEnd + push de + ldh a, [hLoadedROMBank] + push af + jp CloseTextDisplay diff --git a/engine/events/hidden_events/vermilion_gym_trash.asm b/engine/events/hidden_events/vermilion_gym_trash.asm new file mode 100644 index 00000000..40e200d6 --- /dev/null +++ b/engine/events/hidden_events/vermilion_gym_trash.asm @@ -0,0 +1,169 @@ +PrintTrashText: + call EnableAutoTextBoxDrawing + tx_pre_jump VermilionGymTrashText + +VermilionGymTrashText:: + text_far _VermilionGymTrashText + text_end + +GymTrashScript: + call EnableAutoTextBoxDrawing + ld a, [wHiddenEventFunctionArgument] + ld [wGymTrashCanIndex], a + +; Don't do the trash can puzzle if it's already been done. + CheckEvent EVENT_2ND_LOCK_OPENED + jr z, .ok + + tx_pre_jump VermilionGymTrashText + +.ok + CheckEventReuseA EVENT_1ST_LOCK_OPENED + jr nz, .trySecondLock + + ld a, [wFirstLockTrashCanIndex] + ld b, a + ld a, [wGymTrashCanIndex] + cp b + jr z, .openFirstLock + + tx_pre_id VermilionGymTrashText + jr .done + +.openFirstLock +; Next can is trying for the second switch. + SetEvent EVENT_1ST_LOCK_OPENED + + ld hl, GymTrashCans + ld a, [wGymTrashCanIndex] + ; * 5 + ld b, a + add a + add a + add b + + ld d, 0 + ld e, a + add hl, de + ld a, [hli] + +; Bug: This code should calculate a value in the range [0, 3], +; but if the mask and random number don't have any 1 bits in common, then +; the result of the AND will be 0. When 1 is subtracted from that, the value +; will become $ff. This will result in 255 being added to hl, which will cause +; hl to point to one of the zero bytes that pad the end of the ROM bank. +; Trash can 0 was intended to be able to have the second lock only when the +; first lock was in trash can 1 or 3. However, due to this bug, trash can 0 can +; have the second lock regardless of which trash can had the first lock. + + ldh [hGymTrashCanRandNumMask], a + push hl + call Random + swap a + ld b, a + ldh a, [hGymTrashCanRandNumMask] + and b + dec a + pop hl + + ld d, 0 + ld e, a + add hl, de + ld a, [hl] + and $f + ld [wSecondLockTrashCanIndex], a + + tx_pre_id VermilionGymTrashSuccessText1 + jr .done + +.trySecondLock + ld a, [wSecondLockTrashCanIndex] + ld b, a + ld a, [wGymTrashCanIndex] + cp b + jr z, .openSecondLock + +; Reset the cans. + ResetEvent EVENT_1ST_LOCK_OPENED + call Random + + and $e + ld [wFirstLockTrashCanIndex], a + + tx_pre_id VermilionGymTrashFailText + jr .done + +.openSecondLock +; Completed the trash can puzzle. + SetEvent EVENT_2ND_LOCK_OPENED + ld hl, wCurrentMapScriptFlags + set BIT_CUR_MAP_LOADED_2, [hl] + + tx_pre_id VermilionGymTrashSuccessText3 + +.done + jp PrintPredefTextID + +GymTrashCans: +; byte 0: mask for random number +; bytes 1-4: indices of the trash cans that can have the second lock +; (but see the comment above explaining a bug regarding this) +; Note that the mask is simply the number of valid trash can indices that +; follow. The remaining bytes are filled with 0 to pad the length of each entry +; to 5 bytes. + db 2, 1, 3, 0, 0 ; 0 + db 3, 0, 2, 4, 0 ; 1 + db 2, 1, 5, 0, 0 ; 2 + db 3, 0, 4, 6, 0 ; 3 + db 4, 1, 3, 5, 7 ; 4 + db 3, 2, 4, 8, 0 ; 5 + db 3, 3, 7, 9, 0 ; 6 + db 4, 4, 6, 8, 10 ; 7 + db 3, 5, 7, 11, 0 ; 8 + db 3, 6, 10, 12, 0 ; 9 + db 4, 7, 9, 11, 13 ; 10 + db 3, 8, 10, 14, 0 ; 11 + db 2, 9, 13, 0, 0 ; 12 + db 3, 10, 12, 14, 0 ; 13 + db 2, 11, 13, 0, 0 ; 14 + +VermilionGymTrashSuccessText1:: + text_far _VermilionGymTrashSuccessText1 + text_asm + call WaitForSoundToFinish + ld a, SFX_SWITCH + call PlaySound + call WaitForSoundToFinish + jp TextScriptEnd + +; unused +VermilionGymTrashSuccessText2:: + text_far _VermilionGymTrashSuccessText2 + text_end + +; unused +VermilionGymTrashSuccessPlaySfx: + text_asm + call WaitForSoundToFinish + ld a, SFX_SWITCH + call PlaySound + call WaitForSoundToFinish + jp TextScriptEnd + +VermilionGymTrashSuccessText3:: + text_far _VermilionGymTrashSuccessText3 + text_asm + call WaitForSoundToFinish + ld a, SFX_GO_INSIDE + call PlaySound + call WaitForSoundToFinish + jp TextScriptEnd + +VermilionGymTrashFailText:: + text_far _VermilionGymTrashFailText + text_asm + call WaitForSoundToFinish + ld a, SFX_DENIED + call PlaySound + call WaitForSoundToFinish + jp TextScriptEnd diff --git a/engine/events/hidden_items.asm b/engine/events/hidden_items.asm index e42f60f9..065c2d5e 100644 --- a/engine/events/hidden_items.asm +++ b/engine/events/hidden_items.asm @@ -13,7 +13,7 @@ HiddenItems: call EnableAutoTextBoxDrawing ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wHiddenObjectFunctionArgument] ; item ID + ld a, [wHiddenEventFunctionArgument] ; item ID ld [wNamedObjectIndex], a call GetItemName tx_pre_jump FoundHiddenItemText @@ -23,7 +23,7 @@ INCLUDE "data/events/hidden_item_coords.asm" FoundHiddenItemText:: text_far _FoundHiddenItemText text_asm - ld a, [wHiddenObjectFunctionArgument] ; item ID + ld a, [wHiddenEventFunctionArgument] ; item ID ld b, a ld c, 1 call GiveItem @@ -70,7 +70,7 @@ HiddenCoins: ldh [hUnusedCoinsByte], a ldh [hCoins], a ldh [hCoins + 1], a - ld a, [wHiddenObjectFunctionArgument] + ld a, [wHiddenEventFunctionArgument] sub COIN cp 10 jr z, .bcd10 @@ -132,9 +132,9 @@ DroppedHiddenCoinsText:: text_end FindHiddenItemOrCoinsIndex: - ld a, [wHiddenObjectY] + ld a, [wHiddenEventY] ld d, a - ld a, [wHiddenObjectX] + ld a, [wHiddenEventX] ld e, a ld a, [wCurMap] ld b, a diff --git a/engine/events/hidden_objects/bench_guys.asm b/engine/events/hidden_objects/bench_guys.asm deleted file mode 100644 index e5a2a724..00000000 --- a/engine/events/hidden_objects/bench_guys.asm +++ /dev/null @@ -1,107 +0,0 @@ -PrintBenchGuyText: - call EnableAutoTextBoxDrawing - ld hl, BenchGuyTextPointers - ld a, [wCurMap] - ld b, a -.loop - ld a, [hli] - cp -1 - ret z - cp b - jr z, .match - inc hl - inc hl - jr .loop -.match - ld a, [hli] - ld b, a - ld a, [wSpritePlayerStateData1FacingDirection] - cp b - - ; bug: an 'inc hl' instruction is needed before looping back. When trying to - ; talk to a bench guy from above, this Sprite Facing test will fail, and the - ; next loop iteration will be misaligned within BenchGuyTextPointers table. - ; As a result, the routine will miss the terminator byte, and continue to - ; process data beyond the table boundary. - ; It seems that it will only return after starting to read data from VRAM - ; (According to Pan Docs, during PPU mode 3, reads return garbage value, - ; usually $FF). - jr nz, .loop ; player isn't facing the bench guy - ld a, [hl] - jp PrintPredefTextID - -INCLUDE "data/events/bench_guys.asm" - -ViridianCityPokecenterBenchGuyText:: - text_far _ViridianCityPokecenterGuyText - text_end - -PewterCityPokecenterBenchGuyText:: - text_far _PewterCityPokecenterGuyText - text_end - -CeruleanCityPokecenterBenchGuyText:: - text_far _CeruleanPokecenterGuyText - text_end - -LavenderCityPokecenterBenchGuyText:: - text_far _LavenderPokecenterGuyText - text_end - -MtMoonPokecenterBenchGuyText:: - text_far _MtMoonPokecenterBenchGuyText - text_end - -RockTunnelPokecenterBenchGuyText:: - text_far _RockTunnelPokecenterGuyText - text_end - -UnusedBenchGuyText1:: - text_far _UnusedBenchGuyText1 - text_end - -UnusedBenchGuyText2:: - text_far _UnusedBenchGuyText2 - text_end - -UnusedBenchGuyText3:: - text_far _UnusedBenchGuyText3 - text_end - -VermilionCityPokecenterBenchGuyText:: - text_far _VermilionPokecenterGuyText - text_end - -CeladonCityPokecenterBenchGuyText:: - text_far _CeladonCityPokecenterGuyText - text_end - -FuchsiaCityPokecenterBenchGuyText:: - text_far _FuchsiaCityPokecenterGuyText - text_end - -CinnabarIslandPokecenterBenchGuyText:: - text_far _CinnabarPokecenterGuyText - text_end - -SaffronCityPokecenterBenchGuyText:: - text_asm - CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI - ld hl, SaffronCityPokecenterBenchGuyText2 - jr nz, .printText - ld hl, SaffronCityPokecenterBenchGuyText1 -.printText - call PrintText - jp TextScriptEnd - -SaffronCityPokecenterBenchGuyText1: - text_far _SaffronCityPokecenterGuyText1 - text_end - -SaffronCityPokecenterBenchGuyText2: - text_far _SaffronCityPokecenterGuyText2 - text_end - -CeladonCityHotelText:: - text_far _CeladonCityHotelText - text_end diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm deleted file mode 100644 index 3972e20c..00000000 --- a/engine/events/hidden_objects/bills_house_pc.asm +++ /dev/null @@ -1,134 +0,0 @@ -BillsHousePC: - call EnableAutoTextBoxDrawing - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING - jr nz, .displayBillsHousePokemonList - CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL - jr nz, .displayBillsHouseMonitorText - CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR - jr nz, .doCellSeparator -.displayBillsHouseMonitorText - tx_pre_jump BillsHouseMonitorText -.doCellSeparator - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - tx_pre BillsHouseInitiatedText - ld c, 32 - call DelayFrames - ld a, SFX_TINK - call PlaySound - call WaitForSoundToFinish - ld c, 80 - call DelayFrames - ld a, SFX_SHRINK - call PlaySound - call WaitForSoundToFinish - ld c, 48 - call DelayFrames - ld a, SFX_TINK - call PlaySound - call WaitForSoundToFinish - ld c, 32 - call DelayFrames - ld a, SFX_GET_ITEM_1 - call PlaySound - call WaitForSoundToFinish - call PlayDefaultMusic - SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL - ret -.displayBillsHousePokemonList - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - tx_pre BillsHousePokemonList - ret - -BillsHouseMonitorText:: - text_far _BillsHouseMonitorText - text_end - -BillsHouseInitiatedText:: - text_far _BillsHouseInitiatedText - text_promptbutton - text_asm - ld a, SFX_STOP_ALL_MUSIC - ld [wNewSoundID], a - call PlaySound - ld c, 16 - call DelayFrames - ld a, SFX_SWITCH - call PlaySound - call WaitForSoundToFinish - ld c, 60 - call DelayFrames - jp TextScriptEnd - -BillsHousePokemonList:: - text_asm - call SaveScreenTilesToBuffer1 - ld hl, BillsHousePokemonListText1 - call PrintText - xor a - ld [wMenuItemOffset], a ; not used - ld [wCurrentMenuItem], a - ld [wLastMenuItem], a - ld a, PAD_A | PAD_B - ld [wMenuWatchedKeys], a - ld a, 4 - ld [wMaxMenuItem], a - ld a, 2 - ld [wTopMenuItemY], a - ld a, 1 - ld [wTopMenuItemX], a -.billsPokemonLoop - ld hl, wStatusFlags5 - set BIT_NO_TEXT_DELAY, [hl] - hlcoord 0, 0 - ld b, 10 - ld c, 9 - call TextBoxBorder - hlcoord 2, 2 - ld de, BillsMonListText - call PlaceString - ld hl, BillsHousePokemonListText2 - call PrintText - call SaveScreenTilesToBuffer2 - call HandleMenuInput - bit B_PAD_B, a - jr nz, .cancel - ld a, [wCurrentMenuItem] - add EEVEE - cp EEVEE - jr z, .displayPokedex - cp FLAREON - jr z, .displayPokedex - cp JOLTEON - jr z, .displayPokedex - cp VAPOREON - jr z, .displayPokedex - jr .cancel -.displayPokedex - call DisplayPokedex - call LoadScreenTilesFromBuffer2 - jr .billsPokemonLoop -.cancel - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - call LoadScreenTilesFromBuffer2 - jp TextScriptEnd - -BillsHousePokemonListText1: - text_far _BillsHousePokemonListText1 - text_end - -BillsMonListText: - db "EEVEE" - next "FLAREON" - next "JOLTEON" - next "VAPOREON" - next "CANCEL@" - -BillsHousePokemonListText2: - text_far _BillsHousePokemonListText2 - text_end diff --git a/engine/events/hidden_objects/blues_room.asm b/engine/events/hidden_objects/blues_room.asm deleted file mode 100644 index bcbad556..00000000 --- a/engine/events/hidden_objects/blues_room.asm +++ /dev/null @@ -1,13 +0,0 @@ - - ret ; unused - -UnusedPredefText:: - db "@" - -PrintBookcaseText: - call EnableAutoTextBoxDrawing - tx_pre_jump BookcaseText - -BookcaseText:: - text_far _BookcaseText - text_end diff --git a/engine/events/hidden_objects/book_or_sculpture.asm b/engine/events/hidden_objects/book_or_sculpture.asm deleted file mode 100644 index e04f4047..00000000 --- a/engine/events/hidden_objects/book_or_sculpture.asm +++ /dev/null @@ -1,21 +0,0 @@ -BookOrSculptureText:: - text_asm - ld hl, PokemonBooksText - ld a, [wCurMapTileset] - cp MANSION ; Celadon Mansion tileset - jr nz, .ok - lda_coord 8, 6 - cp $38 - jr nz, .ok - ld hl, DiglettSculptureText -.ok - call PrintText - jp TextScriptEnd - -PokemonBooksText: - text_far _PokemonBooksText - text_end - -DiglettSculptureText: - text_far _DiglettSculptureText - text_end diff --git a/engine/events/hidden_objects/bookshelves.asm b/engine/events/hidden_objects/bookshelves.asm deleted file mode 100644 index 813cfc49..00000000 --- a/engine/events/hidden_objects/bookshelves.asm +++ /dev/null @@ -1,39 +0,0 @@ -; prints text for bookshelves in buildings without sign events -PrintBookshelfText:: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - jr nz, .noMatch -; facing up - ld a, [wCurMapTileset] - ld b, a - lda_coord 8, 7 - ld c, a - ld hl, BookshelfTileIDs -.loop - ld a, [hli] - cp $ff - jr z, .noMatch - cp b - jr nz, .nextBookshelfEntry1 - ld a, [hli] - cp c - jr nz, .nextBookshelfEntry2 - ld a, [hl] - push af - call EnableAutoTextBoxDrawing - pop af - call PrintPredefTextID - xor a - ldh [hInteractedWithBookshelf], a - ret -.nextBookshelfEntry1 - inc hl -.nextBookshelfEntry2 - inc hl - jr .loop -.noMatch - ld a, $ff - ldh [hInteractedWithBookshelf], a - farjp PrintCardKeyText - -INCLUDE "data/tilesets/bookshelf_tile_ids.asm" diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm deleted file mode 100644 index a14bd198..00000000 --- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm +++ /dev/null @@ -1,200 +0,0 @@ -PrintCinnabarQuiz: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - call EnableAutoTextBoxDrawing - tx_pre_jump CinnabarGymQuiz - -CinnabarGymQuiz:: - text_asm - xor a - ld [wOpponentAfterWrongAnswer], a - ld a, [wHiddenObjectFunctionArgument] - push af - and $f - ldh [hGymGateIndex], a - pop af - and $f0 - swap a - ldh [hGymGateAnswer], a - ld hl, CinnabarGymQuizIntroText - call PrintText - ldh a, [hGymGateIndex] - dec a - add a - ld d, 0 - ld e, a - ld hl, CinnabarQuizQuestions - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - call PrintText - ld a, 1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - call CinnabarGymQuiz_AskQuestion - jp TextScriptEnd - -CinnabarGymQuizIntroText: - text_far _CinnabarGymQuizIntroText - text_end - -CinnabarQuizQuestions: - dw CinnabarQuizQuestionsText1 - dw CinnabarQuizQuestionsText2 - dw CinnabarQuizQuestionsText3 - dw CinnabarQuizQuestionsText4 - dw CinnabarQuizQuestionsText5 - dw CinnabarQuizQuestionsText6 - -CinnabarQuizQuestionsText1: - text_far _CinnabarQuizQuestionsText1 - text_end - -CinnabarQuizQuestionsText2: - text_far _CinnabarQuizQuestionsText2 - text_end - -CinnabarQuizQuestionsText3: - text_far _CinnabarQuizQuestionsText3 - text_end - -CinnabarQuizQuestionsText4: - text_far _CinnabarQuizQuestionsText4 - text_end - -CinnabarQuizQuestionsText5: - text_far _CinnabarQuizQuestionsText5 - text_end - -CinnabarQuizQuestionsText6: - text_far _CinnabarQuizQuestionsText6 - text_end - -CinnabarGymGateFlagAction: - EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED - predef_jump FlagActionPredef - -CinnabarGymQuiz_AskQuestion: - call YesNoChoice - ldh a, [hGymGateAnswer] - ld c, a - ld a, [wCurrentMenuItem] - cp c - jr nz, .wrongAnswer - ld hl, wCurrentMapScriptFlags - set BIT_CUR_MAP_LOADED_1, [hl] - ldh a, [hGymGateIndex] - ldh [hBackupGymGateIndex], a - ld hl, CinnabarGymQuizCorrectText - call PrintText - ldh a, [hBackupGymGateIndex] - AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 - ld c, a - ld b, FLAG_SET - call CinnabarGymGateFlagAction - jp UpdateCinnabarGymGateTileBlocks_ -.wrongAnswer - call WaitForSoundToFinish - ld a, SFX_DENIED - call PlaySound - call WaitForSoundToFinish - ld hl, CinnabarGymQuizIncorrectText - call PrintText - ldh a, [hGymGateIndex] - add $2 - AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 - ld c, a - ld b, FLAG_TEST - EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0 - predef FlagActionPredef - ld a, c - and a - ret nz - ldh a, [hGymGateIndex] - add $2 - ld [wOpponentAfterWrongAnswer], a - ret - -CinnabarGymQuizCorrectText: - sound_get_item_1 - text_far _CinnabarGymQuizCorrectText - text_promptbutton - text_asm - - ldh a, [hBackupGymGateIndex] - AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 - ld c, a - ld b, FLAG_TEST - call CinnabarGymGateFlagAction - ld a, c - and a - jp nz, TextScriptEnd - call WaitForSoundToFinish - ld a, SFX_GO_INSIDE - call PlaySound - call WaitForSoundToFinish - jp TextScriptEnd - -CinnabarGymQuizIncorrectText: - text_far _CinnabarGymQuizIncorrectText - text_end - -UpdateCinnabarGymGateTileBlocks_:: -; Update the overworld map with open floor blocks or locked gate blocks -; depending on event flags. - ld a, 6 - ldh [hGymGateIndex], a -.loop - ldh a, [hGymGateIndex] - dec a - add a - add a - ld d, 0 - ld e, a - ld hl, CinnabarGymGateCoords - add hl, de - ld a, [hli] - ld b, [hl] - ld c, a - inc hl - ld a, [hl] - ld [wGymGateTileBlock], a - push bc - ldh a, [hGymGateIndex] - ldh [hBackupGymGateIndex], a - AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 - ld c, a - ld b, FLAG_TEST - call CinnabarGymGateFlagAction - ld a, c - and a - jr nz, .unlocked - ld a, [wGymGateTileBlock] - jr .next -.unlocked - ld a, $e -.next - pop bc - ld [wNewTileBlockID], a - predef ReplaceTileBlock - ld hl, hGymGateIndex - dec [hl] - jr nz, .loop - ret - -MACRO gym_gate_coord - db \1, \2, \3, 0 -ENDM - -DEF HORIZONTAL_GATE_BLOCK EQU $54 -DEF VERTICAL_GATE_BLOCK EQU $5f - -CinnabarGymGateCoords: - ; x coord, y coord, block id - gym_gate_coord 9, 3, HORIZONTAL_GATE_BLOCK - gym_gate_coord 6, 3, HORIZONTAL_GATE_BLOCK - gym_gate_coord 6, 6, HORIZONTAL_GATE_BLOCK - gym_gate_coord 3, 8, VERTICAL_GATE_BLOCK - gym_gate_coord 2, 6, HORIZONTAL_GATE_BLOCK - gym_gate_coord 2, 3, HORIZONTAL_GATE_BLOCK diff --git a/engine/events/hidden_objects/elevator.asm b/engine/events/hidden_objects/elevator.asm deleted file mode 100644 index ab0f731f..00000000 --- a/engine/events/hidden_objects/elevator.asm +++ /dev/null @@ -1,3 +0,0 @@ -ElevatorText:: - text_far _ElevatorText - text_end diff --git a/engine/events/hidden_objects/fighting_dojo.asm b/engine/events/hidden_objects/fighting_dojo.asm deleted file mode 100644 index b4f89985..00000000 --- a/engine/events/hidden_objects/fighting_dojo.asm +++ /dev/null @@ -1,23 +0,0 @@ -PrintFightingDojoText2: - call EnableAutoTextBoxDrawing - tx_pre_jump EnemiesOnEverySideText - -EnemiesOnEverySideText:: - text_far _EnemiesOnEverySideText - text_end - -PrintFightingDojoText3: - call EnableAutoTextBoxDrawing - tx_pre_jump WhatGoesAroundComesAroundText - -WhatGoesAroundComesAroundText:: - text_far _WhatGoesAroundComesAroundText - text_end - -PrintFightingDojoText: - call EnableAutoTextBoxDrawing - tx_pre_jump FightingDojoText - -FightingDojoText:: - text_far _FightingDojoText - text_end diff --git a/engine/events/hidden_objects/gym_statues.asm b/engine/events/hidden_objects/gym_statues.asm deleted file mode 100644 index 1c7eb970..00000000 --- a/engine/events/hidden_objects/gym_statues.asm +++ /dev/null @@ -1,39 +0,0 @@ -GymStatues: -; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID -; if in a gym and don't have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID -; else ret - call EnableAutoTextBoxDrawing - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - ld hl, MapBadgeFlags - ld a, [wCurMap] - ld b, a -.loop - ld a, [hli] - cp $ff - ret z - cp b - jr z, .match - inc hl - jr .loop -.match - ld b, [hl] - ld a, [wBeatGymFlags] - and b - cp b - tx_pre_id GymStatueText2 - jr z, .haveBadge - tx_pre_id GymStatueText1 -.haveBadge - jp PrintPredefTextID - -INCLUDE "data/maps/badge_maps.asm" - -GymStatueText1:: - text_far _GymStatueText1 - text_end - -GymStatueText2:: - text_far _GymStatueText2 - text_end diff --git a/engine/events/hidden_objects/indigo_plateau_hq.asm b/engine/events/hidden_objects/indigo_plateau_hq.asm deleted file mode 100644 index e8fd0220..00000000 --- a/engine/events/hidden_objects/indigo_plateau_hq.asm +++ /dev/null @@ -1,10 +0,0 @@ -PrintIndigoPlateauHQText: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - call EnableAutoTextBoxDrawing - tx_pre_jump IndigoPlateauHQText - -IndigoPlateauHQText:: - text_far _IndigoPlateauHQText - text_end diff --git a/engine/events/hidden_objects/indigo_plateau_statues.asm b/engine/events/hidden_objects/indigo_plateau_statues.asm deleted file mode 100644 index f78a5a72..00000000 --- a/engine/events/hidden_objects/indigo_plateau_statues.asm +++ /dev/null @@ -1,24 +0,0 @@ -IndigoPlateauStatues:: - text_asm - ld hl, IndigoPlateauStatuesText1 - call PrintText - ld a, [wXCoord] - bit 0, a ; even or odd? - ld hl, IndigoPlateauStatuesText2 - jr nz, .ok - ld hl, IndigoPlateauStatuesText3 -.ok - call PrintText - jp TextScriptEnd - -IndigoPlateauStatuesText1: - text_far _IndigoPlateauStatuesText1 - text_end - -IndigoPlateauStatuesText2: - text_far _IndigoPlateauStatuesText2 - text_end - -IndigoPlateauStatuesText3: - text_far _IndigoPlateauStatuesText3 - text_end diff --git a/engine/events/hidden_objects/magazines.asm b/engine/events/hidden_objects/magazines.asm deleted file mode 100644 index b58636ff..00000000 --- a/engine/events/hidden_objects/magazines.asm +++ /dev/null @@ -1,8 +0,0 @@ -PrintMagazinesText: - call EnableAutoTextBoxDrawing - tx_pre MagazinesText - ret - -MagazinesText:: - text_far _MagazinesText - text_end diff --git a/engine/events/hidden_objects/museum_fossils.asm b/engine/events/hidden_objects/museum_fossils.asm deleted file mode 100644 index df74293f..00000000 --- a/engine/events/hidden_objects/museum_fossils.asm +++ /dev/null @@ -1,51 +0,0 @@ -AerodactylFossil: - ld a, FOSSIL_AERODACTYL - ld [wCurPartySpecies], a - call DisplayMonFrontSpriteInBox - call EnableAutoTextBoxDrawing - tx_pre AerodactylFossilText - ret - -AerodactylFossilText:: - text_far _AerodactylFossilText - text_end - -KabutopsFossil: - ld a, FOSSIL_KABUTOPS - ld [wCurPartySpecies], a - call DisplayMonFrontSpriteInBox - call EnableAutoTextBoxDrawing - tx_pre KabutopsFossilText - ret - -KabutopsFossilText:: - text_far _KabutopsFossilText - text_end - -DisplayMonFrontSpriteInBox: -; Displays a pokemon's front sprite in a pop-up window. - ld a, 1 - ldh [hAutoBGTransferEnabled], a - call Delay3 - xor a - ldh [hWY], a - call SaveScreenTilesToBuffer1 - ld a, MON_SPRITE_POPUP - ld [wTextBoxID], a - call DisplayTextBoxID - call UpdateSprites - ld a, [wCurPartySpecies] - ld [wCurSpecies], a - call GetMonHeader - ld de, vChars1 tile $31 - call LoadMonFrontSprite - ld a, $80 - ldh [hStartTileID], a - hlcoord 10, 11 - predef AnimateSendingOutMon - call WaitForTextScrollButtonPress - call LoadScreenTilesFromBuffer1 - call Delay3 - ld a, $90 - ldh [hWY], a - ret diff --git a/engine/events/hidden_objects/new_bike.asm b/engine/events/hidden_objects/new_bike.asm deleted file mode 100644 index 5bce5937..00000000 --- a/engine/events/hidden_objects/new_bike.asm +++ /dev/null @@ -1,7 +0,0 @@ -PrintNewBikeText: - call EnableAutoTextBoxDrawing - tx_pre_jump NewBicycleText - -NewBicycleText:: - text_far _NewBicycleText - text_end diff --git a/engine/events/hidden_objects/oaks_lab_email.asm b/engine/events/hidden_objects/oaks_lab_email.asm deleted file mode 100644 index b66babe0..00000000 --- a/engine/events/hidden_objects/oaks_lab_email.asm +++ /dev/null @@ -1,10 +0,0 @@ -DisplayOakLabEmailText: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - call EnableAutoTextBoxDrawing - tx_pre_jump OakLabEmailText - -OakLabEmailText:: - text_far _OakLabEmailText - text_end diff --git a/engine/events/hidden_objects/oaks_lab_posters.asm b/engine/events/hidden_objects/oaks_lab_posters.asm deleted file mode 100644 index 502cf951..00000000 --- a/engine/events/hidden_objects/oaks_lab_posters.asm +++ /dev/null @@ -1,29 +0,0 @@ -DisplayOakLabLeftPoster: - call EnableAutoTextBoxDrawing - tx_pre_jump PushStartText - -PushStartText:: - text_far _PushStartText - text_end - -DisplayOakLabRightPoster: - call EnableAutoTextBoxDrawing - ld hl, wPokedexOwned - ld b, wPokedexOwnedEnd - wPokedexOwned - call CountSetBits - ld a, [wNumSetBits] - cp 2 - tx_pre_id SaveOptionText - jr c, .ownLessThanTwo - ; own two or more mon - tx_pre_id StrengthsAndWeaknessesText -.ownLessThanTwo - jp PrintPredefTextID - -SaveOptionText:: - text_far _SaveOptionText - text_end - -StrengthsAndWeaknessesText:: - text_far _StrengthsAndWeaknessesText - text_end diff --git a/engine/events/hidden_objects/pokecenter_pc.asm b/engine/events/hidden_objects/pokecenter_pc.asm deleted file mode 100644 index 59867d1a..00000000 --- a/engine/events/hidden_objects/pokecenter_pc.asm +++ /dev/null @@ -1,11 +0,0 @@ -OpenPokemonCenterPC: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - call EnableAutoTextBoxDrawing - ld a, 1 << BIT_NO_AUTO_TEXT_BOX - ld [wAutoTextBoxDrawingControl], a - tx_pre_jump PokemonCenterPCText - -PokemonCenterPCText:: - script_pokecenter_pc diff --git a/engine/events/hidden_objects/pokemon_stuff.asm b/engine/events/hidden_objects/pokemon_stuff.asm deleted file mode 100644 index 267a191a..00000000 --- a/engine/events/hidden_objects/pokemon_stuff.asm +++ /dev/null @@ -1,3 +0,0 @@ -PokemonStuffText:: - text_far _PokemonStuffText - text_end diff --git a/engine/events/hidden_objects/reds_room.asm b/engine/events/hidden_objects/reds_room.asm deleted file mode 100644 index 7b8d51a0..00000000 --- a/engine/events/hidden_objects/reds_room.asm +++ /dev/null @@ -1,14 +0,0 @@ -PrintRedSNESText: - call EnableAutoTextBoxDrawing - tx_pre_jump RedBedroomSNESText - -RedBedroomSNESText:: - text_far _RedBedroomSNESText - text_end - -OpenRedsPC: - call EnableAutoTextBoxDrawing - tx_pre_jump RedBedroomPCText - -RedBedroomPCText:: - script_players_pc diff --git a/engine/events/hidden_objects/route_15_binoculars.asm b/engine/events/hidden_objects/route_15_binoculars.asm deleted file mode 100644 index 733ab73e..00000000 --- a/engine/events/hidden_objects/route_15_binoculars.asm +++ /dev/null @@ -1,14 +0,0 @@ -Route15GateLeftBinoculars: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - ret nz - call EnableAutoTextBoxDrawing - tx_pre Route15UpstairsBinocularsText - ld a, ARTICUNO - ld [wCurPartySpecies], a - call PlayCry - jp DisplayMonFrontSpriteInBox - -Route15UpstairsBinocularsText:: - text_far _Route15UpstairsBinocularsText - text_end diff --git a/engine/events/hidden_objects/safari_game.asm b/engine/events/hidden_objects/safari_game.asm deleted file mode 100644 index fc014ce0..00000000 --- a/engine/events/hidden_objects/safari_game.asm +++ /dev/null @@ -1,83 +0,0 @@ -SafariZoneCheck:: - CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone, - jr z, SafariZoneGameStillGoing ; don't bother printing game over text - ld a, [wNumSafariBalls] - and a - jr z, SafariZoneGameOver - jr SafariZoneGameStillGoing - -SafariZoneCheckSteps:: -IF DEF(_DEBUG) - call DebugPressedOrHeldB - ret nz -ENDC - ld a, [wSafariSteps] - ld b, a - ld a, [wSafariSteps + 1] - ld c, a - or b - jr z, SafariZoneGameOver - dec bc - ld a, b - ld [wSafariSteps], a - ld a, c - ld [wSafariSteps + 1], a -SafariZoneGameStillGoing: - xor a - ld [wSafariZoneGameOver], a - ret - -SafariZoneGameOver: - call EnableAutoTextBoxDrawing - xor a - ld [wAudioFadeOutControl], a - dec a ; SFX_STOP_ALL_MUSIC - call PlaySound - ld c, BANK(SFX_Safari_Zone_PA) - ld a, SFX_SAFARI_ZONE_PA - call PlayMusic -.waitForMusicToPlay - ld a, [wChannelSoundIDs + CHAN5] - cp SFX_SAFARI_ZONE_PA - jr nz, .waitForMusicToPlay - ld a, TEXT_SAFARI_GAME_OVER - ldh [hTextID], a - call DisplayTextID - xor a - ld [wPlayerMovingDirection], a - ld a, SAFARI_ZONE_GATE - ldh [hWarpDestinationMap], a - ld a, $3 - ld [wDestinationWarpID], a - ld a, SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI - ld [wSafariZoneGateCurScript], a - SetEvent EVENT_SAFARI_GAME_OVER - ld a, 1 - ld [wSafariZoneGameOver], a - ret - -PrintSafariGameOverText:: - xor a - ld [wJoyIgnore], a - ld hl, SafariGameOverText - jp PrintText - -SafariGameOverText: - text_asm - ld a, [wNumSafariBalls] - and a - jr z, .noMoreSafariBalls - ld hl, TimesUpText - call PrintText -.noMoreSafariBalls - ld hl, GameOverText - call PrintText - jp TextScriptEnd - -TimesUpText: - text_far _TimesUpText - text_end - -GameOverText: - text_far _GameOverText - text_end diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm deleted file mode 100644 index 4ac83953..00000000 --- a/engine/events/hidden_objects/school_blackboard.asm +++ /dev/null @@ -1,224 +0,0 @@ -PrintBlackboardLinkCableText: - call EnableAutoTextBoxDrawing - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wHiddenObjectFunctionArgument] - call PrintPredefTextID - ret - -LinkCableHelp:: - text_asm - call SaveScreenTilesToBuffer1 - ld hl, LinkCableHelpText1 - call PrintText - xor a - ld [wMenuItemOffset], a ; not used - ld [wCurrentMenuItem], a - ld [wLastMenuItem], a - ld a, PAD_A | PAD_B - ld [wMenuWatchedKeys], a - ld a, 3 - ld [wMaxMenuItem], a - ld a, 2 - ld [wTopMenuItemY], a - ld a, 1 - ld [wTopMenuItemX], a -.linkHelpLoop - ld hl, wStatusFlags5 - set BIT_NO_TEXT_DELAY, [hl] - hlcoord 0, 0 - ld b, 8 - ld c, 13 - call TextBoxBorder - hlcoord 2, 2 - ld de, HowToLinkText - call PlaceString - ld hl, LinkCableHelpText2 - call PrintText - call HandleMenuInput - bit B_PAD_B, a - jr nz, .exit - ld a, [wCurrentMenuItem] - cp 3 ; pressed a on "STOP READING" - jr z, .exit - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - ld hl, LinkCableInfoTexts - add a - ld d, 0 - ld e, a - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - call PrintText - jp .linkHelpLoop -.exit - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - call LoadScreenTilesFromBuffer1 - jp TextScriptEnd - -LinkCableHelpText1: - text_far _LinkCableHelpText1 - text_end - -LinkCableHelpText2: - text_far _LinkCableHelpText2 - text_end - -HowToLinkText: - db "HOW TO LINK" - next "COLOSSEUM" - next "TRADE CENTER" - next "STOP READING@" - -LinkCableInfoTexts: - dw LinkCableInfoText1 - dw LinkCableInfoText2 - dw LinkCableInfoText3 - -LinkCableInfoText1: - text_far _LinkCableInfoText1 - text_end - -LinkCableInfoText2: - text_far _LinkCableInfoText2 - text_end - -LinkCableInfoText3: - text_far _LinkCableInfoText3 - text_end - -ViridianSchoolBlackboard:: - text_asm - call SaveScreenTilesToBuffer1 - ld hl, ViridianSchoolBlackboardText1 - call PrintText - xor a - ld [wMenuItemOffset], a - ld [wCurrentMenuItem], a - ld [wLastMenuItem], a - ld a, PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B - ld [wMenuWatchedKeys], a - ld a, 2 - ld [wMaxMenuItem], a - ld a, 2 - ld [wTopMenuItemY], a - ld a, 1 - ld [wTopMenuItemX], a -.blackboardLoop - ld hl, wStatusFlags5 - set BIT_NO_TEXT_DELAY, [hl] - hlcoord 0, 0 - lb bc, 6, 10 - call TextBoxBorder - hlcoord 1, 2 - ld de, StatusAilmentText1 - call PlaceString - hlcoord 6, 2 - ld de, StatusAilmentText2 - call PlaceString - ld hl, ViridianSchoolBlackboardText2 - call PrintText - call HandleMenuInput ; pressing up and down is handled in here - bit B_PAD_B, a ; pressed b - jr nz, .exitBlackboard - bit B_PAD_RIGHT, a - jr z, .didNotPressRight - ; move cursor to right column - ld a, 2 - ld [wMaxMenuItem], a - ld a, 2 - ld [wTopMenuItemY], a - ld a, 6 - ld [wTopMenuItemX], a - ld a, 3 ; in the the right column, use an offset to prevent overlap - ld [wMenuItemOffset], a - jr .blackboardLoop -.didNotPressRight - bit B_PAD_LEFT, a - jr z, .didNotPressLeftOrRight - ; move cursor to left column - ld a, 2 - ld [wMaxMenuItem], a - ld a, 2 - ld [wTopMenuItemY], a - ld a, 1 - ld [wTopMenuItemX], a - xor a - ld [wMenuItemOffset], a - jr .blackboardLoop -.didNotPressLeftOrRight - ld a, [wCurrentMenuItem] - ld b, a - ld a, [wMenuItemOffset] - add b - cp 5 ; cursor is pointing to "QUIT" - jr z, .exitBlackboard - ; we must have pressed a on a status condition - ; so print the text - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - ld hl, ViridianBlackboardStatusPointers - add a - ld d, 0 - ld e, a - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - call PrintText - jp .blackboardLoop -.exitBlackboard - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - call LoadScreenTilesFromBuffer1 - jp TextScriptEnd - -ViridianSchoolBlackboardText1: - text_far _ViridianSchoolBlackboardText1 - text_end - -ViridianSchoolBlackboardText2: - text_far _ViridianSchoolBlackboardText2 - text_end - -StatusAilmentText1: - db " SLP" - next " PSN" - next " PAR@" - -StatusAilmentText2: - db " BRN" - next " FRZ" - next " QUIT@" - - db "@" ; unused - -ViridianBlackboardStatusPointers: - dw ViridianBlackboardSleepText - dw ViridianBlackboardPoisonText - dw ViridianBlackboardPrlzText - dw ViridianBlackboardBurnText - dw ViridianBlackboardFrozenText - -ViridianBlackboardSleepText: - text_far _ViridianBlackboardSleepText - text_end - -ViridianBlackboardPoisonText: - text_far _ViridianBlackboardPoisonText - text_end - -ViridianBlackboardPrlzText: - text_far _ViridianBlackboardPrlzText - text_end - -ViridianBlackboardBurnText: - text_far _ViridianBlackboardBurnText - text_end - -ViridianBlackboardFrozenText: - text_far _ViridianBlackboardFrozenText - text_end diff --git a/engine/events/hidden_objects/school_notebooks.asm b/engine/events/hidden_objects/school_notebooks.asm deleted file mode 100644 index 96a44ab5..00000000 --- a/engine/events/hidden_objects/school_notebooks.asm +++ /dev/null @@ -1,65 +0,0 @@ -PrintNotebookText: - call EnableAutoTextBoxDrawing - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wHiddenObjectFunctionArgument] - jp PrintPredefTextID - -TMNotebook:: - text_far TMNotebookText - text_waitbutton - text_end - -ViridianSchoolNotebook:: - text_asm - ld hl, ViridianSchoolNotebookText1 - call PrintText - call TurnPageSchoolNotebook - jr nz, .doneReading - ld hl, ViridianSchoolNotebookText2 - call PrintText - call TurnPageSchoolNotebook - jr nz, .doneReading - ld hl, ViridianSchoolNotebookText3 - call PrintText - call TurnPageSchoolNotebook - jr nz, .doneReading - ld hl, ViridianSchoolNotebookText4 - call PrintText - ld hl, ViridianSchoolNotebookText5 - call PrintText -.doneReading - jp TextScriptEnd - -TurnPageSchoolNotebook: - ld hl, TurnPageText - call PrintText - call YesNoChoice - ld a, [wCurrentMenuItem] - and a - ret - -TurnPageText: - text_far _TurnPageText - text_end - -ViridianSchoolNotebookText5: - text_far _ViridianSchoolNotebookText5 - text_waitbutton - text_end - -ViridianSchoolNotebookText1: - text_far _ViridianSchoolNotebookText1 - text_end - -ViridianSchoolNotebookText2: - text_far _ViridianSchoolNotebookText2 - text_end - -ViridianSchoolNotebookText3: - text_far _ViridianSchoolNotebookText3 - text_end - -ViridianSchoolNotebookText4: - text_far _ViridianSchoolNotebookText4 - text_end diff --git a/engine/events/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm deleted file mode 100644 index 11f7cbc7..00000000 --- a/engine/events/hidden_objects/town_map.asm +++ /dev/null @@ -1,22 +0,0 @@ -TownMapText:: - text_far _TownMapText - text_promptbutton - text_asm - ld a, $1 - ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld hl, wStatusFlags5 - set BIT_NO_TEXT_DELAY, [hl] - call GBPalWhiteOutWithDelay3 - xor a - ldh [hWY], a - inc a - ldh [hAutoBGTransferEnabled], a - call LoadFontTilePatterns - farcall DisplayTownMap - ld hl, wStatusFlags5 - res BIT_NO_TEXT_DELAY, [hl] - ld de, TextScriptEnd - push de - ldh a, [hLoadedROMBank] - push af - jp CloseTextDisplay diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm deleted file mode 100644 index 73e50cca..00000000 --- a/engine/events/hidden_objects/vermilion_gym_trash.asm +++ /dev/null @@ -1,169 +0,0 @@ -PrintTrashText: - call EnableAutoTextBoxDrawing - tx_pre_jump VermilionGymTrashText - -VermilionGymTrashText:: - text_far _VermilionGymTrashText - text_end - -GymTrashScript: - call EnableAutoTextBoxDrawing - ld a, [wHiddenObjectFunctionArgument] - ld [wGymTrashCanIndex], a - -; Don't do the trash can puzzle if it's already been done. - CheckEvent EVENT_2ND_LOCK_OPENED - jr z, .ok - - tx_pre_jump VermilionGymTrashText - -.ok - CheckEventReuseA EVENT_1ST_LOCK_OPENED - jr nz, .trySecondLock - - ld a, [wFirstLockTrashCanIndex] - ld b, a - ld a, [wGymTrashCanIndex] - cp b - jr z, .openFirstLock - - tx_pre_id VermilionGymTrashText - jr .done - -.openFirstLock -; Next can is trying for the second switch. - SetEvent EVENT_1ST_LOCK_OPENED - - ld hl, GymTrashCans - ld a, [wGymTrashCanIndex] - ; * 5 - ld b, a - add a - add a - add b - - ld d, 0 - ld e, a - add hl, de - ld a, [hli] - -; Bug: This code should calculate a value in the range [0, 3], -; but if the mask and random number don't have any 1 bits in common, then -; the result of the AND will be 0. When 1 is subtracted from that, the value -; will become $ff. This will result in 255 being added to hl, which will cause -; hl to point to one of the zero bytes that pad the end of the ROM bank. -; Trash can 0 was intended to be able to have the second lock only when the -; first lock was in trash can 1 or 3. However, due to this bug, trash can 0 can -; have the second lock regardless of which trash can had the first lock. - - ldh [hGymTrashCanRandNumMask], a - push hl - call Random - swap a - ld b, a - ldh a, [hGymTrashCanRandNumMask] - and b - dec a - pop hl - - ld d, 0 - ld e, a - add hl, de - ld a, [hl] - and $f - ld [wSecondLockTrashCanIndex], a - - tx_pre_id VermilionGymTrashSuccessText1 - jr .done - -.trySecondLock - ld a, [wSecondLockTrashCanIndex] - ld b, a - ld a, [wGymTrashCanIndex] - cp b - jr z, .openSecondLock - -; Reset the cans. - ResetEvent EVENT_1ST_LOCK_OPENED - call Random - - and $e - ld [wFirstLockTrashCanIndex], a - - tx_pre_id VermilionGymTrashFailText - jr .done - -.openSecondLock -; Completed the trash can puzzle. - SetEvent EVENT_2ND_LOCK_OPENED - ld hl, wCurrentMapScriptFlags - set BIT_CUR_MAP_LOADED_2, [hl] - - tx_pre_id VermilionGymTrashSuccessText3 - -.done - jp PrintPredefTextID - -GymTrashCans: -; byte 0: mask for random number -; bytes 1-4: indices of the trash cans that can have the second lock -; (but see the comment above explaining a bug regarding this) -; Note that the mask is simply the number of valid trash can indices that -; follow. The remaining bytes are filled with 0 to pad the length of each entry -; to 5 bytes. - db 2, 1, 3, 0, 0 ; 0 - db 3, 0, 2, 4, 0 ; 1 - db 2, 1, 5, 0, 0 ; 2 - db 3, 0, 4, 6, 0 ; 3 - db 4, 1, 3, 5, 7 ; 4 - db 3, 2, 4, 8, 0 ; 5 - db 3, 3, 7, 9, 0 ; 6 - db 4, 4, 6, 8, 10 ; 7 - db 3, 5, 7, 11, 0 ; 8 - db 3, 6, 10, 12, 0 ; 9 - db 4, 7, 9, 11, 13 ; 10 - db 3, 8, 10, 14, 0 ; 11 - db 2, 9, 13, 0, 0 ; 12 - db 3, 10, 12, 14, 0 ; 13 - db 2, 11, 13, 0, 0 ; 14 - -VermilionGymTrashSuccessText1:: - text_far _VermilionGymTrashSuccessText1 - text_asm - call WaitForSoundToFinish - ld a, SFX_SWITCH - call PlaySound - call WaitForSoundToFinish - jp TextScriptEnd - -; unused -VermilionGymTrashSuccessText2:: - text_far _VermilionGymTrashSuccessText2 - text_end - -; unused -VermilionGymTrashSuccessPlaySfx: - text_asm - call WaitForSoundToFinish - ld a, SFX_SWITCH - call PlaySound - call WaitForSoundToFinish - jp TextScriptEnd - -VermilionGymTrashSuccessText3:: - text_far _VermilionGymTrashSuccessText3 - text_asm - call WaitForSoundToFinish - ld a, SFX_GO_INSIDE - call PlaySound - call WaitForSoundToFinish - jp TextScriptEnd - -VermilionGymTrashFailText:: - text_far _VermilionGymTrashFailText - text_asm - call WaitForSoundToFinish - ld a, SFX_DENIED - call PlaySound - call WaitForSoundToFinish - jp TextScriptEnd diff --git a/engine/overworld/hidden_events.asm b/engine/overworld/hidden_events.asm new file mode 100644 index 00000000..8369e533 --- /dev/null +++ b/engine/overworld/hidden_events.asm @@ -0,0 +1,133 @@ +IsPlayerOnDungeonWarp:: + xor a + ld [wWhichDungeonWarp], a + ld a, [wStatusFlags3] + bit BIT_ON_DUNGEON_WARP, a + ret nz + call ArePlayerCoordsInArray + ret nc + ld a, [wCoordIndex] + ld [wWhichDungeonWarp], a + ld hl, wStatusFlags3 + set BIT_ON_DUNGEON_WARP, [hl] + ld hl, wStatusFlags6 + set BIT_DUNGEON_WARP, [hl] + ret + +; if a hidden event was found, stores $00 in [hDidntFindAnyHiddenEvent], else stores $ff +CheckForHiddenEvent:: + ld hl, hItemAlreadyFound + xor a + ld [hli], a ; [hItemAlreadyFound] + ld [hli], a ; [hSavedMapTextPtr] + ld [hli], a ; [hSavedMapTextPtr + 1] + ld [hl], a ; [hDidntFindAnyHiddenEvent] + ld de, $0 + ld hl, HiddenEventMaps +.hiddenMapLoop + ld a, [hli] + ld b, a + cp $ff + jr z, .noMatch + ld a, [wCurMap] + cp b + jr z, .foundMatchingMap + inc de + inc de + jr .hiddenMapLoop +.foundMatchingMap + ld hl, HiddenEventPointers + add hl, de + ld a, [hli] + ld h, [hl] + ld l, a + push hl + ld hl, wHiddenEventFunctionArgument + xor a + ld [hli], a + ld [hli], a + ld [hl], a + pop hl +.hiddenEventLoop + ld a, [hli] + cp $ff + jr z, .noMatch + ld [wHiddenEventY], a + ld b, a + ld a, [hli] + ld [wHiddenEventX], a + ld c, a + call CheckIfCoordsInFrontOfPlayerMatch + ldh a, [hCoordsInFrontOfPlayerMatch] + and a + jr z, .foundMatchingEvent + inc hl + inc hl + inc hl + inc hl + push hl + ld hl, wHiddenEventIndex + inc [hl] + pop hl + jr .hiddenEventLoop +.foundMatchingEvent + ld a, [hli] + ld [wHiddenEventFunctionArgument], a + ld a, [hli] + ld [wHiddenEventFunctionRomBank], a + ld a, [hli] + ld h, [hl] + ld l, a + ret +.noMatch + ld a, $ff + ldh [hDidntFindAnyHiddenEvent], a + ret + +; checks if the coordinates in front of the player's sprite match Y in b and X in c +; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match +CheckIfCoordsInFrontOfPlayerMatch: + ld a, [wSpritePlayerStateData1FacingDirection] + cp SPRITE_FACING_UP + jr z, .facingUp + cp SPRITE_FACING_LEFT + jr z, .facingLeft + cp SPRITE_FACING_RIGHT + jr z, .facingRight +; facing down + ld a, [wYCoord] + inc a + jr .upDownCommon +.facingUp + ld a, [wYCoord] + dec a +.upDownCommon + cp b + jr nz, .didNotMatch + ld a, [wXCoord] + cp c + jr nz, .didNotMatch + jr .matched +.facingLeft + ld a, [wXCoord] + dec a + jr .leftRightCommon +.facingRight + ld a, [wXCoord] + inc a +.leftRightCommon + cp c + jr nz, .didNotMatch + ld a, [wYCoord] + cp b + jr nz, .didNotMatch +.matched + xor a + jr .done +.didNotMatch + ld a, $ff +.done + ldh [hCoordsInFrontOfPlayerMatch], a + ret + +INCLUDE "data/events/hidden_events.asm" diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm deleted file mode 100644 index 2798864a..00000000 --- a/engine/overworld/hidden_objects.asm +++ /dev/null @@ -1,133 +0,0 @@ -IsPlayerOnDungeonWarp:: - xor a - ld [wWhichDungeonWarp], a - ld a, [wStatusFlags3] - bit BIT_ON_DUNGEON_WARP, a - ret nz - call ArePlayerCoordsInArray - ret nc - ld a, [wCoordIndex] - ld [wWhichDungeonWarp], a - ld hl, wStatusFlags3 - set BIT_ON_DUNGEON_WARP, [hl] - ld hl, wStatusFlags6 - set BIT_DUNGEON_WARP, [hl] - ret - -; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff -CheckForHiddenObject:: - ld hl, hItemAlreadyFound - xor a - ld [hli], a ; [hItemAlreadyFound] - ld [hli], a ; [hSavedMapTextPtr] - ld [hli], a ; [hSavedMapTextPtr + 1] - ld [hl], a ; [hDidntFindAnyHiddenObject] - ld de, $0 - ld hl, HiddenObjectMaps -.hiddenMapLoop - ld a, [hli] - ld b, a - cp $ff - jr z, .noMatch - ld a, [wCurMap] - cp b - jr z, .foundMatchingMap - inc de - inc de - jr .hiddenMapLoop -.foundMatchingMap - ld hl, HiddenObjectPointers - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - push hl - ld hl, wHiddenObjectFunctionArgument - xor a - ld [hli], a - ld [hli], a - ld [hl], a - pop hl -.hiddenObjectLoop - ld a, [hli] - cp $ff - jr z, .noMatch - ld [wHiddenObjectY], a - ld b, a - ld a, [hli] - ld [wHiddenObjectX], a - ld c, a - call CheckIfCoordsInFrontOfPlayerMatch - ldh a, [hCoordsInFrontOfPlayerMatch] - and a - jr z, .foundMatchingObject - inc hl - inc hl - inc hl - inc hl - push hl - ld hl, wHiddenObjectIndex - inc [hl] - pop hl - jr .hiddenObjectLoop -.foundMatchingObject - ld a, [hli] - ld [wHiddenObjectFunctionArgument], a - ld a, [hli] - ld [wHiddenObjectFunctionRomBank], a - ld a, [hli] - ld h, [hl] - ld l, a - ret -.noMatch - ld a, $ff - ldh [hDidntFindAnyHiddenObject], a - ret - -; checks if the coordinates in front of the player's sprite match Y in b and X in c -; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match -CheckIfCoordsInFrontOfPlayerMatch: - ld a, [wSpritePlayerStateData1FacingDirection] - cp SPRITE_FACING_UP - jr z, .facingUp - cp SPRITE_FACING_LEFT - jr z, .facingLeft - cp SPRITE_FACING_RIGHT - jr z, .facingRight -; facing down - ld a, [wYCoord] - inc a - jr .upDownCommon -.facingUp - ld a, [wYCoord] - dec a -.upDownCommon - cp b - jr nz, .didNotMatch - ld a, [wXCoord] - cp c - jr nz, .didNotMatch - jr .matched -.facingLeft - ld a, [wXCoord] - dec a - jr .leftRightCommon -.facingRight - ld a, [wXCoord] - inc a -.leftRightCommon - cp c - jr nz, .didNotMatch - ld a, [wYCoord] - cp b - jr nz, .didNotMatch -.matched - xor a - jr .done -.didNotMatch - ld a, $ff -.done - ldh [hCoordsInFrontOfPlayerMatch], a - ret - -INCLUDE "data/events/hidden_objects.asm" diff --git a/engine/slots/game_corner_slots.asm b/engine/slots/game_corner_slots.asm index 48321974..d83d9d6a 100644 --- a/engine/slots/game_corner_slots.asm +++ b/engine/slots/game_corner_slots.asm @@ -1,5 +1,5 @@ StartSlotMachine: - ld a, [wHiddenObjectFunctionArgument] + ld a, [wHiddenEventFunctionArgument] cp SLOTS_OUTOFORDER jr z, .printOutOfOrder cp SLOTS_OUTTOLUNCH @@ -10,9 +10,9 @@ StartSlotMachine: ld a, [wCanPlaySlots] and a ret z - ld a, [wLuckySlotHiddenObjectIndex] + ld a, [wLuckySlotHiddenEventIndex] ld b, a - ld a, [wHiddenObjectIndex] + ld a, [wHiddenEventIndex] inc a cp b jr z, .match diff --git a/home.asm b/home.asm index 4090a274..201a0a22 100644 --- a/home.asm +++ b/home.asm @@ -80,5 +80,5 @@ INCLUDE "home/reload_sprites.asm" INCLUDE "home/give.asm" INCLUDE "home/random.asm" INCLUDE "home/predef.asm" -INCLUDE "home/hidden_objects.asm" +INCLUDE "home/hidden_events.asm" INCLUDE "home/predef_text.asm" diff --git a/home/hidden_events.asm b/home/hidden_events.asm new file mode 100644 index 00000000..5acc95d9 --- /dev/null +++ b/home/hidden_events.asm @@ -0,0 +1,39 @@ +UpdateCinnabarGymGateTileBlocks:: + farjp UpdateCinnabarGymGateTileBlocks_ + +CheckForHiddenEventOrBookshelfOrCardKeyDoor:: + ldh a, [hLoadedROMBank] + push af + ldh a, [hJoyHeld] + bit B_PAD_A, a + jr z, .nothingFound +; A button is pressed + ld a, BANK(CheckForHiddenEvent) + ld [rROMB], a + ldh [hLoadedROMBank], a + call CheckForHiddenEvent + ldh a, [hDidntFindAnyHiddenEvent] + and a + jr nz, .hiddenEventNotFound + ld a, [wHiddenEventFunctionRomBank] + ld [rROMB], a + ldh [hLoadedROMBank], a + ld de, .returnAddress + push de + jp hl +.returnAddress + xor a + jr .done +.hiddenEventNotFound + farcall PrintBookshelfText + ldh a, [hInteractedWithBookshelf] + and a + jr z, .done +.nothingFound + ld a, $ff +.done + ldh [hItemAlreadyFound], a + pop af + ld [rROMB], a + ldh [hLoadedROMBank], a + ret diff --git a/home/hidden_objects.asm b/home/hidden_objects.asm deleted file mode 100644 index bb513b9d..00000000 --- a/home/hidden_objects.asm +++ /dev/null @@ -1,39 +0,0 @@ -UpdateCinnabarGymGateTileBlocks:: - farjp UpdateCinnabarGymGateTileBlocks_ - -CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: - ldh a, [hLoadedROMBank] - push af - ldh a, [hJoyHeld] - bit B_PAD_A, a - jr z, .nothingFound -; A button is pressed - ld a, BANK(CheckForHiddenObject) - ld [rROMB], a - ldh [hLoadedROMBank], a - call CheckForHiddenObject - ldh a, [hDidntFindAnyHiddenObject] - and a - jr nz, .hiddenObjectNotFound - ld a, [wHiddenObjectFunctionRomBank] - ld [rROMB], a - ldh [hLoadedROMBank], a - ld de, .returnAddress - push de - jp hl -.returnAddress - xor a - jr .done -.hiddenObjectNotFound - farcall PrintBookshelfText - ldh a, [hInteractedWithBookshelf] - and a - jr z, .done -.nothingFound - ld a, $ff -.done - ldh [hItemAlreadyFound], a - pop af - ld [rROMB], a - ldh [hLoadedROMBank], a - ret diff --git a/home/overworld.asm b/home/overworld.asm index 58550167..a06a32da 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -87,10 +87,10 @@ OverworldLoopLessDelay:: jp nz, .noDirectionButtonsPressed call IsPlayerCharacterBeingControlledByGame jr nz, .checkForOpponent - call CheckForHiddenObjectOrBookshelfOrCardKeyDoor + call CheckForHiddenEventOrBookshelfOrCardKeyDoor ldh a, [hItemAlreadyFound] and a - jp z, OverworldLoop ; jump if a hidden object or bookshelf was found, but not if a card key door was found + jp z, OverworldLoop ; jump if a hidden event or bookshelf was found, but not if a card key door was found call IsSpriteOrSignInFrontOfPlayer ldh a, [hTextID] and a diff --git a/layout.link b/layout.link index 454b3bec..1b454a58 100644 --- a/layout.link +++ b/layout.link @@ -59,7 +59,7 @@ ROMX $7 "Maps 3" "Pokémon Names" "Maps 4" - "Hidden Objects 1" + "Hidden Events 1" ROMX $8 "Sound Effect Headers 2" "Music Headers 2" @@ -93,7 +93,7 @@ ROMX $11 "Maps 5" "Pokédex Rating" "Maps 6" - "Hidden Objects Core" + "Hidden Events Core" ROMX $12 "Maps 7" "Screen Effects" @@ -105,7 +105,7 @@ ROMX $13 ROMX $14 "Maps 10" "Battle Engine 8" - "Hidden Objects 2" + "Hidden Events 2" ROMX $15 "Maps 11" "Battle Engine 9" @@ -121,12 +121,12 @@ ROMX $17 "Maps 15" "Starter Dex" "Maps 16" - "Hidden Objects 3" + "Hidden Events 3" ROMX $18 "Maps 17" "Cinnabar Lab Fossils" "Maps 18" - "Hidden Objects 4" + "Hidden Events 4" ROMX $19 "Tilesets 1" ROMX $1A diff --git a/main.asm b/main.asm index 313bd448..951afdc2 100644 --- a/main.asm +++ b/main.asm @@ -67,12 +67,12 @@ INCLUDE "engine/movie/oak_speech/init_player_data.asm" INCLUDE "engine/items/get_bag_item_quantity.asm" INCLUDE "engine/overworld/pathfinding.asm" INCLUDE "engine/gfx/hp_bar.asm" -INCLUDE "engine/events/hidden_objects/bookshelves.asm" -INCLUDE "engine/events/hidden_objects/indigo_plateau_statues.asm" -INCLUDE "engine/events/hidden_objects/book_or_sculpture.asm" -INCLUDE "engine/events/hidden_objects/elevator.asm" -INCLUDE "engine/events/hidden_objects/town_map.asm" -INCLUDE "engine/events/hidden_objects/pokemon_stuff.asm" +INCLUDE "engine/events/hidden_events/bookshelves.asm" +INCLUDE "engine/events/hidden_events/indigo_plateau_statues.asm" +INCLUDE "engine/events/hidden_events/book_or_sculpture.asm" +INCLUDE "engine/events/hidden_events/elevator.asm" +INCLUDE "engine/events/hidden_events/town_map.asm" +INCLUDE "engine/events/hidden_events/pokemon_stuff.asm" SECTION "Font Graphics", ROMX @@ -127,16 +127,16 @@ INCLUDE "engine/movie/oak_speech/clear_save.asm" INCLUDE "engine/events/elevator.asm" -SECTION "Hidden Objects 1", ROMX +SECTION "Hidden Events 1", ROMX INCLUDE "engine/menus/oaks_pc.asm" -INCLUDE "engine/events/hidden_objects/new_bike.asm" -INCLUDE "engine/events/hidden_objects/oaks_lab_posters.asm" -INCLUDE "engine/events/hidden_objects/safari_game.asm" -INCLUDE "engine/events/hidden_objects/cinnabar_gym_quiz.asm" -INCLUDE "engine/events/hidden_objects/magazines.asm" -INCLUDE "engine/events/hidden_objects/bills_house_pc.asm" -INCLUDE "engine/events/hidden_objects/oaks_lab_email.asm" +INCLUDE "engine/events/hidden_events/new_bike.asm" +INCLUDE "engine/events/hidden_events/oaks_lab_posters.asm" +INCLUDE "engine/events/hidden_events/safari_game.asm" +INCLUDE "engine/events/hidden_events/cinnabar_gym_quiz.asm" +INCLUDE "engine/events/hidden_events/magazines.asm" +INCLUDE "engine/events/hidden_events/bills_house_pc.asm" +INCLUDE "engine/events/hidden_events/oaks_lab_email.asm" SECTION "Bill's PC", ROMX @@ -217,9 +217,9 @@ SECTION "Pokédex Rating", ROMX INCLUDE "engine/events/pokedex_rating.asm" -SECTION "Hidden Objects Core", ROMX +SECTION "Hidden Events Core", ROMX -INCLUDE "engine/overworld/hidden_objects.asm" +INCLUDE "engine/overworld/hidden_events.asm" SECTION "Screen Effects", ROMX @@ -239,13 +239,13 @@ INCLUDE "engine/battle/init_battle_variables.asm" INCLUDE "engine/battle/move_effects/paralyze.asm" -SECTION "Hidden Objects 2", ROMX +SECTION "Hidden Events 2", ROMX INCLUDE "engine/events/card_key.asm" INCLUDE "engine/events/prize_menu.asm" -INCLUDE "engine/events/hidden_objects/school_notebooks.asm" -INCLUDE "engine/events/hidden_objects/fighting_dojo.asm" -INCLUDE "engine/events/hidden_objects/indigo_plateau_hq.asm" +INCLUDE "engine/events/hidden_events/school_notebooks.asm" +INCLUDE "engine/events/hidden_events/fighting_dojo.asm" +INCLUDE "engine/events/hidden_events/indigo_plateau_hq.asm" SECTION "Battle Engine 9", ROMX @@ -280,14 +280,14 @@ SECTION "Starter Dex", ROMX INCLUDE "engine/events/starter_dex.asm" -SECTION "Hidden Objects 3", ROMX +SECTION "Hidden Events 3", ROMX INCLUDE "engine/pokemon/set_types.asm" -INCLUDE "engine/events/hidden_objects/reds_room.asm" -INCLUDE "engine/events/hidden_objects/route_15_binoculars.asm" -INCLUDE "engine/events/hidden_objects/museum_fossils.asm" -INCLUDE "engine/events/hidden_objects/school_blackboard.asm" -INCLUDE "engine/events/hidden_objects/vermilion_gym_trash.asm" +INCLUDE "engine/events/hidden_events/reds_room.asm" +INCLUDE "engine/events/hidden_events/route_15_binoculars.asm" +INCLUDE "engine/events/hidden_events/museum_fossils.asm" +INCLUDE "engine/events/hidden_events/school_blackboard.asm" +INCLUDE "engine/events/hidden_events/vermilion_gym_trash.asm" SECTION "Cinnabar Lab Fossils", ROMX @@ -295,12 +295,12 @@ SECTION "Cinnabar Lab Fossils", ROMX INCLUDE "engine/events/cinnabar_lab.asm" -SECTION "Hidden Objects 4", ROMX +SECTION "Hidden Events 4", ROMX -INCLUDE "engine/events/hidden_objects/gym_statues.asm" -INCLUDE "engine/events/hidden_objects/bench_guys.asm" -INCLUDE "engine/events/hidden_objects/blues_room.asm" -INCLUDE "engine/events/hidden_objects/pokecenter_pc.asm" +INCLUDE "engine/events/hidden_events/gym_statues.asm" +INCLUDE "engine/events/hidden_events/bench_guys.asm" +INCLUDE "engine/events/hidden_events/blues_room.asm" +INCLUDE "engine/events/hidden_events/pokecenter_pc.asm" SECTION "Battle Engine 11", ROMX diff --git a/ram/hram.asm b/ram/hram.asm index 9cfb5327..24260b80 100644 --- a/ram/hram.asm +++ b/ram/hram.asm @@ -370,7 +370,7 @@ hSpriteMapXCoord:: db NEXTU hItemAlreadyFound:: db ds 2 -hDidntFindAnyHiddenObject:: db +hDidntFindAnyHiddenEvent:: db NEXTU ds 1 diff --git a/ram/wram.asm b/ram/wram.asm index 5eefaf06..44775192 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -390,7 +390,7 @@ wSlotMachineSevenAndBarModeChance:: db ; ROM back to return to when the player is done with the slot machine wSlotMachineSavedROMBank:: db ds 166 -wLuckySlotHiddenObjectIndex:: db +wLuckySlotHiddenEventIndex:: db NEXTU ; values between 0-6. Shake screen horizontally, shake screen vertically, blink Pokemon... @@ -744,12 +744,12 @@ wTempCoins1:: dw wTempCoins2:: dw NEXTU -wHiddenObjectFunctionArgument:: db -wHiddenObjectFunctionRomBank:: db -wHiddenObjectIndex:: db -wHiddenObjectY:: db +wHiddenEventFunctionArgument:: db +wHiddenEventFunctionRomBank:: db +wHiddenEventIndex:: db +wHiddenEventY:: db wHiddenItemOrCoinsIndex:: -wHiddenObjectX:: db +wHiddenEventX:: db NEXTU wPlayerSpinInPlaceAnimFrameDelay:: db diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index 0ead1947..94625d2a 100644 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -20,7 +20,7 @@ GameCornerSelectLuckySlotMachine: srl a srl a srl a - ld [wLuckySlotHiddenObjectIndex], a + ld [wLuckySlotHiddenEventIndex], a ret GameCornerSetRocketHideoutDoorTile: diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index 3052cac9..21f72066 100644 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -13,7 +13,7 @@ SafariZoneGate_ScriptPointers: dw_const SafariZoneGatePlayerMovingDownScript, SCRIPT_SAFARIZONEGATE_PLAYER_MOVING_DOWN dw_const SafariZoneGateLeavingSafariScript, SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI dw_const SafariZoneGateSetScriptAfterMoveScript, SCRIPT_SAFARIZONEGATE_SET_SCRIPT_AFTER_MOVE - EXPORT SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI ; used by engine/events/hidden_objects/safari_game.asm + EXPORT SCRIPT_SAFARIZONEGATE_LEAVING_SAFARI ; used by engine/events/hidden_events/safari_game.asm SafariZoneGateDefaultScript: ld hl, .PlayerNextToSafariZoneWorker1CoordsArray -- cgit v1.3.1-sl0p