From dd7130c489aa10b414404eb86d9dfe92c020b212 Mon Sep 17 00:00:00 2001 From: Llinos Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Mon, 13 May 2024 17:30:12 +0100 Subject: [PATCH] Groundwork for Pocket Lapras This is still a bit glitchy: - For some reason, unrelated text pops up after something is printed. I don't know why. - Pocket Lapras needs to close the menu post-use. Probably very easy, something in engine\items\item_effects. - The Pocket Lapras needs to default to Lapras as the text. This is a bit difficult as the item effect is actually used by Surf itself, so you may need to add a function that the Pocket Lapras loads before jumping to the real function (basically just loading the LAPRAS species ID for the text, ask me if you need help) - Cycling Road needs to run the routine to force you onto the bike after using the Pocket Lapras, or simply have it check for if you're on a ForceBikeSurf map and yell at you. Both work. I don't have time to finish this right now but it's at least obtainable. --- constants/event_constants.asm | 1 + data/items/key_items.asm | 2 +- data/maps/objects/CinnabarIsland.asm | 11 +++-- scripts/CinnabarIsland.asm | 74 ++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 6 deletions(-) diff --git a/constants/event_constants.asm b/constants/event_constants.asm index 52ef9732..dd48672d 100644 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -207,6 +207,7 @@ const EVENT_GAVE_FOSSIL_TO_LAB const EVENT_LAB_STILL_REVIVING_FOSSIL const EVENT_LAB_HANDING_OVER_FOSSIL_MON + const EVENT_GOT_POCKET_LAPRAS ; Saffron City events const_next $340 diff --git a/data/items/key_items.asm b/data/items/key_items.asm index 2eae83b1..bed00b9a 100644 --- a/data/items/key_items.asm +++ b/data/items/key_items.asm @@ -6,7 +6,7 @@ KeyItemFlags: dbit FALSE ; POKE_BALL dbit TRUE ; TOWN_MAP dbit TRUE ; BICYCLE - dbit TRUE ; SURFBOARD + dbit TRUE ; LAPRAS' BALL - SURFBOARD dbit FALSE ; SAFARI_BALL dbit TRUE ; POKEDEX dbit FALSE ; MOON_STONE diff --git a/data/maps/objects/CinnabarIsland.asm b/data/maps/objects/CinnabarIsland.asm index 66dc0c0a..2b2f3bae 100644 --- a/data/maps/objects/CinnabarIsland.asm +++ b/data/maps/objects/CinnabarIsland.asm @@ -10,14 +10,15 @@ CinnabarIsland_Object: warp_event 14, 11, CINNABAR_VOLCANO_FLOORS, 1 def_bg_events - bg_event 11, 15, 3 ; CinnabarIslandText3 - bg_event 22, 19, 4 ; MartSignText - bg_event 16, 17, 5 ; PokeCenterSignText - bg_event 9, 23, 6 ; CinnabarIslandText6 - bg_event 23, 13, 7 ; CinnabarIslandText7 + bg_event 11, 15, 4 ; CinnabarIslandText3 + bg_event 22, 19, 5 ; MartSignText + bg_event 16, 17, 6 ; PokeCenterSignText + bg_event 9, 23, 7 ; CinnabarIslandText6 + bg_event 23, 13, 8 ; CinnabarIslandText7 def_object_events object_event 11, 18, SPRITE_GIRL, WALK, LEFT_RIGHT, 1 ; person object_event 17, 20, SPRITE_GAMBLER, STAY, NONE, 2 ; person + object_event 25, 18, SPRITE_COOLTRAINER_M, WALK, UP_DOWN, 3 ; Pocket Lapras def_warps_to CINNABAR_ISLAND diff --git a/scripts/CinnabarIsland.asm b/scripts/CinnabarIsland.asm index 9a3e0e43..73eb5911 100644 --- a/scripts/CinnabarIsland.asm +++ b/scripts/CinnabarIsland.asm @@ -53,6 +53,7 @@ CinnabarIslandScript1: CinnabarIsland_TextPointers: dw CinnabarIslandText1 dw CinnabarIslandText2 + dw CinnabarPocketLapras dw CinnabarIslandText3 dw MartSignText dw PokeCenterSignText @@ -83,3 +84,76 @@ CinnabarIslandText6: CinnabarIslandText7: text_far _CinnabarIslandText7 text_end + +_CinnabarPocketLapras1: + text "Bah, this LAPRAS" + line "just doesn't" + cont "wanna fight! Can" + cont "you believe that?" + + para "All it does is" + line "SURF. My GYARADOS" + cont "can do that!" + + para "Here. Take it." + line "I can't stand" + cont "looking at its" + cont "big ol' eyes." + done + +_PocketLaprasNoRoomText: + text "You don't have" + line "room either?" + + para "Well, it's not" + line "going anywhere..." + done + +_ReceivedPocketLaprasText: + text "Take care of that" + line "LAPRAS though," + cont "yeah? They're" + cont "an endangered" + cont "species." + + para "You should stay" + line "safe, too." ; haha, llinos, you sly dog + done + +; for some reason it crashed super hard if I didn't do this. +CinnabarPocketLapras1: + text_far _CinnabarPocketLapras1 + text_end + +PocketLaprasNoRoomText: + text_far _PocketLaprasNoRoomText + text_end + +ReceivedPocketLaprasText: + text_far _ReceivedPocketLaprasText + text_end + +CinnabarPocketLapras: + text_asm + CheckEvent EVENT_GOT_POCKET_LAPRAS + jr nz, .skip + ld hl, CinnabarPocketLapras1 + call PrintText + call TheAutoskipStopinator ; it's been a while but i didnt forget how annoying this was + lb bc, SURFBOARD, 1 + call GiveItem + jr nc, .bag_full + SetEvent EVENT_GOT_POCKET_LAPRAS ; if you get here, it's done. Using this to load all three texts with one PrintText instruction + sound_get_key_item + ld hl, ReceivedPocketLaprasText + jr .end +.bag_full + ld hl, PocketLaprasNoRoomText + jr .end +.skip + ld hl, ReceivedPocketLaprasText + ; fallthrough +.end + call PrintText + call TheAutoskipStopinator + jp TextScriptEnd