Functional Hyper Training!

There are ways this can be improved (SFX, menu message, insta-recalc stats), but this finishes the Hyper Training functionality.

Talk to James, give him a Bottle Cap, he boosts your DVs to max, and then he deducts a Bottle Cap.

Notable that vanilla vitamins don't recalc stats immediately as well, so maybe the recalc bit isn't necessary.
This commit is contained in:
Llinos Evans 2023-05-11 20:32:46 +01:00
parent 9bc7505195
commit e6a74546c2
3 changed files with 47 additions and 22 deletions

View file

@ -54,7 +54,7 @@ New areas
- There's a Move Deleter and Move Relearner!
- Citrine City is a new island city that can be accessed in the postgame.
- Contains a house with a Move Tutor that can teach Tradeback moves without the need for GSC!
- Contains a Team Rocket house where they will sell you TMs and Evolution Items. Jessie and James are there too!
- Contains a Team Rocket house where they will sell you TMs and Evolution Items, as well as have a Hyper Training feature to get Max DVs!
- Will contain a Battle Tower with infinite, randomised trainer parties!
- Garnet Cavern, located in Citrine City, houses several strong trainers and Pokémon.
- Brunswick Trail, south of Citrine City, is a route that leads to Celeste Hill.

View file

@ -20,10 +20,10 @@ DisplayPokemartDialogue_::
; This code is useless. It copies the address of the pokemart's inventory to hl,
; but the address is never used.
ld hl, wItemListPointer
ld a, [hli]
ld l, [hl]
ld h, a
; ld hl, wItemListPointer
; ld a, [hli]
; ld l, [hl]
; ld h, a
ld a, [wMenuExitMethod]
cp CANCELLED_MENU
@ -95,9 +95,9 @@ DisplayPokemartDialogue_::
; The following code is supposed to check if the player chose No, but the above
; check already catches it.
ld a, [wChosenMenuItem]
dec a
jr z, .sellMenuLoop
; ld a, [wChosenMenuItem]
; dec a
; jr z, .sellMenuLoop
.sellItem
ld a, [wBoughtOrSoldItemInMart]
@ -173,9 +173,9 @@ DisplayPokemartDialogue_::
; The following code is supposed to check if the player chose No, but the above
; check already catches it.
ld a, [wChosenMenuItem]
dec a
jr z, .buyMenuLoop
; ld a, [wChosenMenuItem]
; dec a
; jr z, .buyMenuLoop
.buyItem
call .isThereEnoughMoney

View file

@ -33,9 +33,8 @@ MeowthText:
jp TextScriptEnd
; James serves as our "Mr. Hyper". In the anime, it's revealed he collects Bottle Caps,
;so I think this is fitting.
; so I think this is fitting.
JamesText:
text_far _JamesText
text_asm
call SaveScreenTilesToBuffer2 ; It really doesn't need to be done this early, it just helps.
@ -43,7 +42,7 @@ JamesText:
predef GetQuantityOfItemInBag
ld a, b
and a
jr z, .done ; If zero, James just moans as normal.
jr z, .NoBottleCap ; If zero, James just moans as normal.
ld hl, JamesSeesBottleCap ; Otherwise, he perks up.
call PrintText
@ -53,6 +52,7 @@ JamesText:
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
@ -68,15 +68,35 @@ JamesText:
call PrintText
; DV increasing process.
ld hl, %11111111; Fill out Attack and Defence
; Thanks to Vimescarrot for giving me pointers on this!
ld a, [wWhichPokemon] ; Find the Pokemon's position in party.
ld hl, wPartyMon1DVs ; Load DVs into hl
ld bc, wPartyMon2 - wPartyMon1 ; This gets to the right slot for DVs
call AddNTimes ; Gets us there
ld a, %11111111 ; Load FFFF FFFF, perfect 15s
ld [hli], a ; Attack + Defence
ld [hl], a ; Speed + Special
; And we're done!
; 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
; Currently this doesn't automatically change the stats because it's fucking insane
; Bottle Cap removal service
ld hl, BottleCapList
.loop
ld a, [hli]
ldh [hItemToRemoveID], a
and a
ret z
push hl
ld b, a
call IsItemInBag
pop hl
jr z, .loop
farcall RemoveItemByID
jr .done
.NoBottleCap
ld hl, JamesNoCap
call PrintText
jr .done
.refused
ld hl, JamesNo
@ -85,6 +105,11 @@ JamesText:
.done
jp TextScriptEnd
BottleCapList:
db BOTTLE_CAP
;db GOLD_BOTTLE_CAP maybe one day
db 0 ; end
JessieText1:
text_far _JessieText1
text_end
@ -152,7 +177,7 @@ JessieAfterBattleText:
text_far _JessieAfterBattleText
text_end
JamesOpen:
JamesNoCap:
text_far _JamesText
text_end