From 57d79f43edfd5c0926cbfcf1136e4b1896ed599d Mon Sep 17 00:00:00 2001 From: May Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:47:26 +0100 Subject: [PATCH] Up-Grade NPC Seems to interact oddly with Saffron but I believe this is because of the way Team Rocket works. The event itself works fine. Also added the Up-Grade, as before, Porygon was evolving via Trade. Uses text referencing LGPE, and has a similar location. Because of the sprite limit in Saffron, the Pidgeot NPC has been removed. --- README.md | 4 ++-- constants/event_constants.asm | 3 ++- constants/hide_show_constants.asm | 2 +- constants/item_constants.asm | 3 ++- data/items/key_items.asm | 1 + data/items/names.asm | 1 + data/items/prices.asm | 1 + data/maps/hide_show_data.asm | 3 ++- data/maps/objects/SaffronCity.asm | 3 ++- data/pokemon/evos_moves.asm | 2 +- data/text/item_descriptions.asm | 1 + engine/items/item_effects.asm | 1 + scripts/SaffronCity.asm | 40 +++++++++++++++++++++++++++++++ scripts/SilphCo11F.asm | 1 + text/SaffronCity.asm | 35 +++++++++++++++++++++++++++ 15 files changed, 93 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index dd7d84dd..3b49548f 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ Galarian and Paldean formes are accessed on the S.S. Anne, which now returns aft Credits ==== * Plague von Karma - Creator of the Showdown Mod, Developer -* Martha's Against Humanity - Developer +* Martha's Against Humanity - Developer, tweaks of Albatross's sprites. * Ema Skye - Developer * pret et al - Pokémon Red and Blue Disassembly Project, many tutorials helped us! * ausma - Showdown Mod assistance @@ -251,7 +251,7 @@ Credits * erosunica - Assistance with developing Celadon University & Citrine City, plus sources for various subjects. * Chatot4444 - Assisting with gym scaling code * ZumiIsawhat? - Restorations of beta OST -* Helix Chamber, RacieBeep, et al - Prototype Pokémon sprites +* Helix Chamber, RacieBeep, loumilouminosus, Orchid, GBCRetro, & catstorm26 - Prototype Pokémon sprites * Vortyne - Reused a bit of code from their pureRGB hack, which was used to assist with making MissingNo. stable. Assisted in bug fixes. * Rangi - Reused a bit of code from their Red* / Blue* hack to make HMs usable in the overworld! * 大吟醸 (Daiginjo) - Assistance in translating the Tamamushi University Student Book, allowing for an accurate adaptation of the location. diff --git a/constants/event_constants.asm b/constants/event_constants.asm index a0254eff..c83d6800 100644 --- a/constants/event_constants.asm +++ b/constants/event_constants.asm @@ -195,7 +195,8 @@ ; Saffron City events const_next $340 const EVENT_GOT_TM31 - const_skip 15 + const EVENT_GOT_UP_GRADE + const_skip 14 const EVENT_DEFEATED_FIGHTING_DOJO const EVENT_BEAT_KARATE_MASTER const EVENT_BEAT_FIGHTING_DOJO_TRAINER_0 diff --git a/constants/hide_show_constants.asm b/constants/hide_show_constants.asm index accff1df..1bacfe77 100644 --- a/constants/hide_show_constants.asm +++ b/constants/hide_show_constants.asm @@ -34,7 +34,7 @@ DEF SHOW EQU $15 const HS_SAFFRON_CITY_D ; 16 const HS_SAFFRON_CITY_E ; 17 const HS_SAFFRON_CITY_F ; 18 - const HS_ROUTE_2_ITEM_1 ; 19 X + const HS_SAFFRON_CITY_UP_GRADE ; 19 const HS_ROUTE_2_ITEM_2 ; 1A X const HS_ROUTE_4_ITEM ; 1B X const HS_ROUTE_9_ITEM ; 1C X diff --git a/constants/item_constants.asm b/constants/item_constants.asm index ac0c4845..09c9c5a6 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -84,7 +84,7 @@ DEF SAFARI_ROCK EQU $16 ; overload const POKE_FLUTE ; $49 const LIFT_KEY ; $4A const EXP_ALL ; $4B - const CANDY_JAR ; $4C - was old rod + const CANDY_JAR ; $4C - was old rod const GOOD_ROD ; $4D - replaceable const SUPER_ROD ; $4E const PP_UP ; $4F @@ -116,6 +116,7 @@ DEF NUM_ITEMS EQU const_value - 1 const DUBIOUS_DISC ; $66 const CITRINE_PASS ; $67 const OLDSEACHART ; $68 + const UP_GRADE ; $69 DEF NUM_FLOORS EQU const_value - 1 - NUM_ITEMS const_next $C4 diff --git a/data/items/key_items.asm b/data/items/key_items.asm index 47c15f57..8d5f8ae6 100644 --- a/data/items/key_items.asm +++ b/data/items/key_items.asm @@ -104,4 +104,5 @@ KeyItemFlags: dbit FALSE ; DUBIOUS_DISC dbit TRUE ; CITRINE_PASS dbit TRUE ; OLDSEACHART + dbit FALSE ; UP_GRADE end_bit_array NUM_ITEMS + NUM_FLOORS diff --git a/data/items/names.asm b/data/items/names.asm index 60c581ca..d2542e20 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -105,4 +105,5 @@ ItemNames:: li "DUBIOUS DISC" li "CITRINE PASS" li "OLDSEACHART" + li "UP-GRADE" assert_list_length NUM_ITEMS + NUM_FLOORS diff --git a/data/items/prices.asm b/data/items/prices.asm index 2de421a9..b700c176 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -105,4 +105,5 @@ ItemPrices:: bcd3 3000 ; DUBIOUS_DISC bcd3 0 ; CITRINE_PASS bcd3 0 ; OLDSEACHART + bcd3 3000 ; UP_GRADE assert_table_length NUM_ITEMS + NUM_FLOORS diff --git a/data/maps/hide_show_data.asm b/data/maps/hide_show_data.asm index 65458921..8cde3315 100644 --- a/data/maps/hide_show_data.asm +++ b/data/maps/hide_show_data.asm @@ -292,8 +292,9 @@ SaffronCityHS: db SAFFRON_CITY, $0D, HIDE db SAFFRON_CITY, $0E, SHOW db SAFFRON_CITY, $0F, HIDE + db SAFFRON_CITY, $1A, HIDE Route2HS: - db ROUTE_2, $01, SHOW + ;db ROUTE_2, $01, SHOW - removed for the former db ROUTE_2, $02, SHOW Route4HS: db ROUTE_4, $03, SHOW diff --git a/data/maps/objects/SaffronCity.asm b/data/maps/objects/SaffronCity.asm index 2fddfd5e..b4747273 100644 --- a/data/maps/objects/SaffronCity.asm +++ b/data/maps/objects/SaffronCity.asm @@ -35,9 +35,10 @@ SaffronCity_Object: object_event 23, 23, SPRITE_SILPH_WORKER, STAY, NONE, 9 ; person object_event 17, 30, SPRITE_ERIKA, WALK, LEFT_RIGHT, 10 ; person object_event 30, 12, SPRITE_GENTLEMAN, STAY, DOWN, 11 ; person - object_event 31, 12, SPRITE_BIRD, STAY, DOWN, 12 ; person + ;object_event 31, 12, SPRITE_BIRD, STAY, DOWN, 12 ; person - removed due to sprite limit object_event 18, 8, SPRITE_ROCKER, STAY, UP, 13 ; person object_event 18, 22, SPRITE_ROCKET, STAY, DOWN, 14 ; person object_event 19, 22, SPRITE_ROCKET, STAY, DOWN, 15 ; person + object_event 5, 30, SPRITE_SILPH_WORKER, STAY, DOWN, 26 ; Up-Grade NPC, hidden until Giovanni is beaten def_warps_to SAFFRON_CITY diff --git a/data/pokemon/evos_moves.asm b/data/pokemon/evos_moves.asm index 4718f8ed..d97a1ca2 100644 --- a/data/pokemon/evos_moves.asm +++ b/data/pokemon/evos_moves.asm @@ -2506,7 +2506,7 @@ GeodudeEvosMoves: PorygonEvosMoves: ; Evolutions - db EV_TRADE, 1, PORYGON2 + db EV_ITEM, UP_GRADE, 1, PORYGON2 db 0 ; Learnset db 23, PSYBEAM diff --git a/data/text/item_descriptions.asm b/data/text/item_descriptions.asm index 7b0455bb..f63c03c2 100644 --- a/data/text/item_descriptions.asm +++ b/data/text/item_descriptions.asm @@ -42,6 +42,7 @@ _HeartStoneDescription:: _ProtectorDescription:: _BlkAuguriteDescription:: _DubiousDiscDescription:: +_UpGradeDescription:: text "Evolves certain" next "kinds of #MON." prompt diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 13820a9a..a16d4410 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -121,6 +121,7 @@ ItemUsePtrTable: dw ItemUseEvoStone ; DUBIOUS_DISC dw UnusableItem ; CITRINE_PASS dw UnusableItem ; OLDSEACHART + dw ItemUseEvoStone ; UP_GRADE ItemUseBall: diff --git a/scripts/SaffronCity.asm b/scripts/SaffronCity.asm index 84982534..93d46e7c 100644 --- a/scripts/SaffronCity.asm +++ b/scripts/SaffronCity.asm @@ -18,6 +18,7 @@ SaffronCity_TextPointers: dw SaffronCityText14 dw SaffronCityText15 dw SaffronCityText16 + dw SaffronCityUpGrade dw SaffronCityText17 dw SaffronCityText18 dw MartSignText @@ -120,3 +121,42 @@ SaffronCityText24: SaffronCityText25: text_far _SaffronCityText25 text_end + +SaffronCityUpGrade: + text_asm + CheckEvent EVENT_GOT_UP_GRADE + jr nz, .got_item + ld hl, UpGradePreReceiveText + call PrintText + lb bc, UP_GRADE, 1 + call GiveItem + jr nc, .bag_full + ld hl, ReceivedUpGradeText + call PrintText + SetEvent EVENT_GOT_UP_GRADE + jr .done +.bag_full + ld hl, UpGradeNoRoomText + call PrintText + jr .done +.got_item + ld hl, UpGradeExplanationText + call PrintText +.done + jp TextScriptEnd + +UpGradePreReceiveText:: + text_far _UpGradePreReceiveText + text_end + +ReceivedUpGradeText:: + text_far _ReceivedUpGradeText + text_end + +UpGradeNoRoomText:: + text_far _UpGradeNoRoomText + text_end + +UpGradeExplanationText:: + text_far _UpGradeExplanationText + text_end \ No newline at end of file diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm index 70119331..9c72fa5e 100644 --- a/scripts/SilphCo11F.asm +++ b/scripts/SilphCo11F.asm @@ -112,6 +112,7 @@ MissableObjectIDs_6219b: db HS_SAFFRON_CITY_7 db HS_SAFFRON_CITY_E db HS_SAFFRON_CITY_F + db HS_SAFFRON_CITY_UP_GRADE db HS_SILPH_CO_2F_2 db HS_SILPH_CO_2F_3 db HS_SILPH_CO_2F_4 diff --git a/text/SaffronCity.asm b/text/SaffronCity.asm index ae9c44f2..8cfe0cd2 100644 --- a/text/SaffronCity.asm +++ b/text/SaffronCity.asm @@ -150,3 +150,38 @@ _SaffronCityText25:: para "Release to be" line "determined..." done + +_UpGradePreReceiveText:: + text "Huh? Did you" + line "get rid of all" + cont "those TEAM" + cont "ROCKET thugs?" + + text "Thank you so" + line "much! Here," + cont "take this!" + prompt + +_ReceivedUpGradeText:: + text " received" + line "@" + text_ram wStringBuffer + text "!@" + text_end + +_UpGradeExplanationText:: + text "SILPH created" + line "PORYGON in 1995," + cont "but even now," + cont "it's outdated." + + text "The UP-GRADE" + line "should remedy" + cont "that!" + + done + +_UpGradeNoRoomText:: + text "You have no" + line "room!" + done