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...
This commit is contained in:
Llinos Evans 2023-05-11 08:43:19 +01:00
parent 76fc5f737e
commit 9bc7505195
12 changed files with 148 additions and 47 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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::

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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