mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-06 15:45:24 +13:00
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:
parent
9bc7505195
commit
e6a74546c2
3 changed files with 47 additions and 22 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue