From 68436820a1a90f249c65b7dda318521cdd50710d Mon Sep 17 00:00:00 2001 From: Llinos Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Thu, 11 Jul 2024 22:19:08 +0100 Subject: [PATCH] Fossil Scientist groundwork This means the ROM won't build until Feradactyl and Decilla are implemented. Thanks Misty! Event will activate on any NPC so long as you do this: ``` faceplayer opentext special FossilScientist waitbutton closetext end ``` --- data/events/special_pointers.asm | 3 +- engine/events/fossil_scientist.asm | 287 +++++++++++++++++++++++++++++ engine/events/specials.asm | 6 +- main.asm | 1 + 4 files changed, 295 insertions(+), 2 deletions(-) create mode 100644 engine/events/fossil_scientist.asm diff --git a/data/events/special_pointers.asm b/data/events/special_pointers.asm index 713f8bc..a292ab1 100644 --- a/data/events/special_pointers.asm +++ b/data/events/special_pointers.asm @@ -185,4 +185,5 @@ SpecialsPointers:: add_special UnusedDummySpecial ; unused ; Tradeback NPC tutorial - add_special TradebackNPC \ No newline at end of file + add_special TradebackNPC + add_special FossilScientist \ No newline at end of file diff --git a/engine/events/fossil_scientist.asm b/engine/events/fossil_scientist.asm new file mode 100644 index 0000000..b86d98b --- /dev/null +++ b/engine/events/fossil_scientist.asm @@ -0,0 +1,287 @@ +FossilScientistGuy:: + faceplayer + opentext + checkevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove the next two lines to immediately receive the fossil + iftrue .GaveScientistFossil + checkevent EVENT_GAVE_SCIENTIST_OLD_AMBER + iftrue .GiveDecilla + checkevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + iftrue .GiveKabuto + checkevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + iftrue .GiveOmanyte + checkevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + iftrue .GiveXylodon + checkevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + iftrue .GiveFeraldactyl + writetext FossilScientistIntroText + waitbutton + loadmenu .MoveMenuHeader + verticalmenu + closewindow + ifequal REVIVE_OLD_AMBER, .OldAmber + ifequal REVIVE_DOME_FOSSIL, .DomeFossil + ifequal REVIVE_HELIX_FOSSIL, .HelixFossil + ifequal REVIVE_CLUB_FOSSIL, .ClubFossil + ifequal REVIVE_WING_FOSSIL, .WingFossil + sjump .No + +.OldAmber + checkitem OLD_AMBER + iffalse .No + getmonname STRING_BUFFER_3, DECILLA + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_OLD_AMBER + takeitem OLD_AMBER + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.DomeFossil: + checkitem DOME_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, KABUTO + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + takeitem DOME_FOSSIL + opentext + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.HelixFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, OMANYTE + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.ClubFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, XYLODON + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.WingFossil: + checkitem HELIX_FOSSIL + iffalse .No + getmonname STRING_BUFFER_3, FERODACTYL + writetext FossilScientistMonText + promptbutton + setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_1 ; remove this to immediately receive the fossil + setevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + takeitem HELIX_FOSSIL + writetext FossilScientistGiveText + waitbutton + sjump .GaveScientistFossil + +.No + writetext FossilScientistNoText + waitbutton + closetext + end + +.GaveScientistFossil: + writetext FossilScientistTimeText + waitbutton + closetext + ; older versions will use FadeBlackQuickly below instead + ; special FadeOutToBlack ; uncomment the next five lines to immediately receive the fossil + ; special ReloadSpritesNoPalettes + ; playsound SFX_WARP_TO + ; waitsfx + ; pause 35 + end ; replace this with "sjump FossilScientist" to immediately receive the fossil + +.GiveDecilla: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_OLD_AMBER + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, DECILLA + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke DECILLA, 30 + closetext + end + +.GiveKabuto: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_DOME_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, KABUTO + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke KABUTO, 30 + closetext + end + +.GiveOmanyte: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_HELIX_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, OMANYTE + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke OMANYTE, 30 + closetext + end + +.GiveXylodon: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_CLUB_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, XYLODON + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke XYLODON, 30 + closetext + end + +.GiveFeraldactyl: + readvar VAR_PARTYCOUNT + ifequal PARTY_LENGTH, .NoRoom + clearevent EVENT_GAVE_SCIENTIST_WING_FOSSIL + writetext FossilScientistDoneText + promptbutton + getmonname STRING_BUFFER_3, FERODACTYL + writetext FossilScientistReceiveText + playsound SFX_CAUGHT_MON + waitsfx + waitbutton + writetext FossilScientistMonText + givepoke FERODACTYL, 30 + closetext + end + +.NoRoom: + writetext FossilScientistPartyFullText + waitbutton + closetext + end + +.MoveMenuHeader: + db MENU_BACKUP_TILES ; flags + menu_coords 0, 2, 15, TEXTBOX_Y - 1 + dw .MenuData + db 1 ; default option + +.MenuData: + db STATICMENU_CURSOR ; flags + db 6 ; items + db "OLD AMBER@" + db "DOME FOSSIL@" + db "HELIX FOSSIL@" + db "CLUB FOSSIL@" + db "WING FOSSIL@" + db "CANCEL@" + +FossilScientistIntroText: + text "Hiya!" + + para "I am important" + line "doctor!" + + para "I study here rare" + line "#MON fossils!" + + para "You! Have you a" + line "fossil for me?" + done + +FossilScientistNoText: + text "No! Is too bad!" + + para "You come again!" + done + +FossilScientistPartyFullText: + text "No! Is too bad!" + + para "Your party is" + line "already full!" + done + +FossilScientistTimeText: + text "I take a little" + line "time!" + + para "You go for walk a" + line "little while!" + done + +FossilScientistDoneText: + text "Where were you?" + + para "Your fossil is" + line "back to life!" + done + +FossilScientistMonText: + text "Oh! That is" + line "a fossil!" + + para "It is fossil of" + line "@" + text_ram wStringBuffer3 + text ", a" + + + para "#MON that is" + line "already extinct!" + + para "My Resurrection" + line "Machine will make" + cont "that #MON live" + cont "again!" + done + +FossilScientistGiveText: + text "So! You hurry and" + line "give me that!" + + para " handed" + line "over the fossil." + done + +FossilScientistReceiveText: + text " received" + line "@" + text_ram wStringBuffer3 + text "!" + done diff --git a/engine/events/specials.asm b/engine/events/specials.asm index e8b6fa4..2efdde7 100644 --- a/engine/events/specials.asm +++ b/engine/events/specials.asm @@ -424,4 +424,8 @@ TrainerHouse: ; Tradeback NPC tutorial TradebackNPC: farcall TradebackGuy - ret \ No newline at end of file + ret + +FossilScientist: + farcall FossilScientistGuy + ret diff --git a/main.asm b/main.asm index 513085d..3a3f5dd 100644 --- a/main.asm +++ b/main.asm @@ -475,6 +475,7 @@ INCLUDE "engine/events/play_slow_cry.asm" INCLUDE "engine/link/time_capsule.asm" INCLUDE "engine/link/time_capsule_2.asm" INCLUDE "engine/events/magikarp.asm" +INCLUDE "engine/events/fossil_scientist.asm" SECTION "bank3Econtcont", ROMX