From 9bc7505195f30f89ac7a7944c7abed77de8b56dd Mon Sep 17 00:00:00 2001 From: Llinos Evans <36418502+PlagueVonKarma@users.noreply.github.com> Date: Thu, 11 May 2023 08:43:19 +0100 Subject: [PATCH] Groundwork for James Bottle Caps Currently, he doesn't deduct a Bottle Cap and he only fills out Attack and Defence. DVs are stored as a 16-bit address, so I need to find a way to make `a` work with it... --- constants/battle_constants.asm | 4 +- constants/item_constants.asm | 2 +- data/items/key_items.asm | 2 +- data/items/names.asm | 2 +- data/items/prices.asm | 2 +- data/items/use_overworld.asm | 2 +- data/text/item_descriptions.asm | 6 +-- engine/debug/debug_party.asm | 2 +- engine/items/item_effects.asm | 67 ++++++++++++++-------------- engine/menus/item_descriptions.asm | 2 +- scripts/CitrineRocketHouse.asm | 71 +++++++++++++++++++++++++++++- text/CitrineRocketHouse.asm | 33 ++++++++++++++ 12 files changed, 148 insertions(+), 47 deletions(-) diff --git a/constants/battle_constants.asm b/constants/battle_constants.asm index ea503a20..6a659dd6 100644 --- a/constants/battle_constants.asm +++ b/constants/battle_constants.asm @@ -67,8 +67,8 @@ DEF SLP_MASK EQU %111 ; 0-7 turns DEF MAX_STAT_VALUE EQU 999 ; trainer dvs, these should be set to 15. -DEF ATKDEFDV_TRAINER EQU $FF -DEF SPDSPCDV_TRAINER EQU $FF +DEF ATKDEFDV_TRAINER EQU $F +DEF SPDSPCDV_TRAINER EQU $F ; wPlayerBattleStatus1 or wEnemyBattleStatus1 bit flags const_def diff --git a/constants/item_constants.asm b/constants/item_constants.asm index baf70b96..7acdd5e0 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -85,7 +85,7 @@ DEF SAFARI_ROCK EQU $16 ; overload const LIFT_KEY ; $4A const EXP_ALL ; $4B const CANDY_JAR ; $4C - was old rod - const GOOD_ROD ; $4D - replaceable + const BOTTLE_CAP ; $4D - was good rod const SUPER_ROD ; $4E const PP_UP ; $4F const ETHER ; $50 diff --git a/data/items/key_items.asm b/data/items/key_items.asm index 38548133..90215c7e 100644 --- a/data/items/key_items.asm +++ b/data/items/key_items.asm @@ -76,7 +76,7 @@ KeyItemFlags: dbit TRUE ; LIFT_KEY dbit FALSE ; EXP_ALL dbit FALSE ; was TRUE for OLD_ROD, now CANDY_SACK - dbit TRUE ; GOOD_ROD + dbit FALSE ; was GOOD_ROD & TRUE, now BOTTLE_CAP dbit TRUE ; SUPER_ROD dbit FALSE ; PP_UP dbit FALSE ; ETHER diff --git a/data/items/names.asm b/data/items/names.asm index 4b3776b8..12805d4d 100644 --- a/data/items/names.asm +++ b/data/items/names.asm @@ -76,7 +76,7 @@ ItemNames:: li "LIFT KEY" li "EXP.ALL" li "CANDY JAR" ; was old rod - li "GOOD ROD" + li "BOTTLE CAP" li "FISHING ROD" li "PP UP" li "ETHER" diff --git a/data/items/prices.asm b/data/items/prices.asm index e7bac30b..b56bcf59 100644 --- a/data/items/prices.asm +++ b/data/items/prices.asm @@ -76,7 +76,7 @@ ItemPrices:: bcd3 0 ; LIFT_KEY bcd3 0 ; EXP_ALL bcd3 0 ; was OLD_ROD, now CANDY_SACK. Plan to be one-of-a-kind, so 0 to discourage sale a la Master Ball. - bcd3 0 ; GOOD_ROD + bcd3 5000 ; was GOOD_ROD, now BOTTLE_CAP. Sells for 5000 in SV. bcd3 0 ; SUPER_ROD bcd3 0 ; PP_UP bcd3 0 ; ETHER diff --git a/data/items/use_overworld.asm b/data/items/use_overworld.asm index 794cc52b..13f7f97a 100644 --- a/data/items/use_overworld.asm +++ b/data/items/use_overworld.asm @@ -4,6 +4,6 @@ UsableItems_CloseMenu: db ITEMFINDER db POKE_FLUTE ;db OLD_ROD no longer exists - db GOOD_ROD + ;db GOOD_ROD no longer exists db SUPER_ROD db -1 ; end diff --git a/data/text/item_descriptions.asm b/data/text/item_descriptions.asm index 9223556c..dbcd7bf7 100644 --- a/data/text/item_descriptions.asm +++ b/data/text/item_descriptions.asm @@ -303,9 +303,9 @@ _CandyJarDescription:: next "odd sweets." prompt -_GoodRodDescription:: - text "A good ROD for" - next "catching #MON." +_BottleCapDescription:: + text "Certain people" + next "collect these!" prompt _FishingRodDescription:: diff --git a/engine/debug/debug_party.asm b/engine/debug/debug_party.asm index ed67f4b3..2ddc19cc 100644 --- a/engine/debug/debug_party.asm +++ b/engine/debug/debug_party.asm @@ -157,7 +157,7 @@ DebugItemsList: db HM_SURF, 1 db METAL_COAT, 99 db BLK_AUGURITE, 99 - db FLOOR_1F + db BOTTLE_CAP, 99 db -1 ; end DebugUnusedList: diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 81424aec..c71b80df 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -93,7 +93,7 @@ ItemUsePtrTable: dw UnusableItem ; LIFT_KEY dw UnusableItem ; EXP_ALL dw ItemUseEvoStone ; was OLD_ROD, now CANDY_SACK - dw ItemUseGoodRod ; GOOD_ROD + dw UnusableItem ; was GOOD_ROD, now BOTTLE_CAP dw ItemUseSuperRod ; SUPER_ROD dw ItemUsePPUp ; PP_UP (real one) dw ItemUsePPRestore ; ETHER @@ -1862,40 +1862,41 @@ CoinCaseNumCoinsText: text_far _CoinCaseNumCoinsText text_end -ItemUseOldRod: - call FishingInit - jp c, ItemUseNotTime - lb bc, 5, MAGIKARP - ld a, $1 ; set bite - jr RodResponse +; The Rods have been replaced with the Candy Sack and Bottle Cap, respectively. +;ItemUseOldRod: +; call FishingInit +; jp c, ItemUseNotTime +; lb bc, 5, MAGIKARP +; ld a, $1 ; set bite +; jr RodResponse -ItemUseGoodRod: - call FishingInit - jp c, ItemUseNotTime -.RandomLoop - call Random - srl a - jr c, .SetBite - and %11 - cp 2 - jr nc, .RandomLoop - ; choose which monster appears - ld hl, GoodRodMons - add a - ld c, a - ld b, 0 - add hl, bc - ld b, [hl] - inc hl - ld c, [hl] - and a -.SetBite - ld a, 0 - rla - xor 1 - jr RodResponse +;ItemUseGoodRod: +; call FishingInit +; jp c, ItemUseNotTime +;.RandomLoop +; call Random +; srl a +; jr c, .SetBite +; and %11 +; cp 2 +; jr nc, .RandomLoop +; ; choose which monster appears +; ld hl, GoodRodMons +; add a +; ld c, a +; ld b, 0 +; add hl, bc +; ld b, [hl] +; inc hl +; ld c, [hl] +; and a +;.SetBite +; ld a, 0 +; rla +; xor 1 +; jr RodResponse -INCLUDE "data/wild/good_rod.asm" +;INCLUDE "data/wild/good_rod.asm" ItemUseSuperRod: call FishingInit diff --git a/engine/menus/item_descriptions.asm b/engine/menus/item_descriptions.asm index ca88885b..dc52b809 100644 --- a/engine/menus/item_descriptions.asm +++ b/engine/menus/item_descriptions.asm @@ -166,7 +166,7 @@ ItemDescriptionPointers: text_end text_far _CandyJarDescription text_end - text_far _GoodRodDescription + text_far _BottleCapDescription text_end text_far _FishingRodDescription text_end diff --git a/scripts/CitrineRocketHouse.asm b/scripts/CitrineRocketHouse.asm index 8b517d63..c829f8d8 100644 --- a/scripts/CitrineRocketHouse.asm +++ b/scripts/CitrineRocketHouse.asm @@ -32,9 +32,58 @@ MeowthText: call WaitForSoundToFinish jp TextScriptEnd +; James serves as our "Mr. Hyper". In the anime, it's revealed he collects Bottle Caps, +;so I think this is fitting. JamesText: text_far _JamesText - text_end + text_asm + call SaveScreenTilesToBuffer2 ; It really doesn't need to be done this early, it just helps. + + ld b, BOTTLE_CAP ; Check bag for Bottle Caps. We only need one for this. + predef GetQuantityOfItemInBag + ld a, b + and a + jr z, .done ; If zero, James just moans as normal. + + ld hl, JamesSeesBottleCap ; Otherwise, he perks up. + call PrintText + + call YesNoChoice ; Yes/No Prompt + ld a, [wCurrentMenuItem] + and a + jr nz, .refused + ; Proceed from here as if Yes is stated. + ; Here, the menu should pop up and the player picks a Pokemon to juice. + xor a + ld [wUpdateSpritesEnabled], a + ld [wPartyMenuTypeOrMessageID], a + ld [wMenuItemToSwap], a + call DisplayPartyMenu + push af + call GBPalWhiteOutWithDelay3 + call RestoreScreenTilesAndReloadTilePatterns + call LoadGBPal + pop af + ld hl, JamesDone + call PrintText + + ; DV increasing process. + ld hl, %11111111; Fill out Attack and Defence + + ; This can apparently work with 16-bit but it doesn't do what I want it to...right now. + ;ld b, 0 + ;ld c, a + ;add hl, bc + + ld [wPartyMon1DVs], a + + jr .done +.refused + ld hl, JamesNo + call PrintText + jr .done +.done + jp TextScriptEnd JessieText1: text_far _JessieText1 @@ -103,4 +152,22 @@ JessieAfterBattleText: text_far _JessieAfterBattleText text_end - text_end ; unused +JamesOpen: + text_far _JamesText + text_end + +JamesSeesBottleCap: + text_far _JamesSeesBottleCap + text_end + +JamesYes: + text_far _JamesYes + text_end + +JamesNo: + text_far _JamesNo + text_end + +JamesDone: + text_far _JamesDone + text_end diff --git a/text/CitrineRocketHouse.asm b/text/CitrineRocketHouse.asm index fb8516b4..a61cc2a6 100644 --- a/text/CitrineRocketHouse.asm +++ b/text/CitrineRocketHouse.asm @@ -89,3 +89,36 @@ _MartGuySelling:: text "What can I do" line "you for?" done + +; James Bottle Cap system. +; In the anime, he collects Bottle Caps, so it feels better than adding Mr. Hyper. +_JamesSeesBottleCap:: + text "Hey, is that a" + line "BOTTLE CAP? I" + cont "collect these!" + + para "Tell you what..." + + para "You give me that" + line "BOTTLE CAP, and" + cont "I'll make your" + cont "#MON a little" + cont "stronger!" + done + +_JamesYes:: + text "Which #MON is" + line "is getting" + cont "juiced?" + done + +_JamesNo:: + text "But it's so" + line "rare..." + done + +_JamesDone:: + text "There! Come back" + line "with more if" + cont "you find any!" + done