Groundwork for the Candy Jar rework

This does everything except the incrementation.

If you defeat a Meltan, `wCandyJarCount` increments by 1, capping at 40. This is represented in-game as 10, going up to 400, simply by adding a 0 at the end. This, in effect, replicates the Meltan quest from Pokemon Go.

Once 40/400 is reached, the Candy Jar will become an evolution stone, evolving Meltan. Instead of consuming the Jar, the Candies inside are zeroed out.

Currently, the Candy Jar increments, but only once, thus why this is being committed on a separate branch. The bug appears to be at `engine\battle\core.asm`, line 842-861, likely 854-856. It's possible that it could be due to its position in WRAM, or that it's a `db` instead of a `dw`.
This commit is contained in:
Llinos Evans 2023-05-31 13:37:55 +01:00
parent 934f8adcac
commit 228de2b718
7 changed files with 93 additions and 16 deletions

View file

@ -2131,7 +2131,6 @@ wObtainedHiddenCoinsFlags:: flag_array 16
; $01 = biking
; $02 = surfing
wWalkBikeSurfState:: db
ds 10
wTownVisitedFlag:: flag_array NUM_CITY_MAPS
@ -2144,7 +2143,23 @@ wFossilItem:: db
; mon that will result from the item
wFossilMon:: db
ds 2
; Meltan WRAM entries.
; Meltan uses a 3 unique variables for its item functionality.
; This is for the Melmetal Evolution Item.
; If it reaches 40 (represented as 400), the player can evolve Meltan.
; Once used, the count will reset.
wCandyJarCount:: db
; Used for Meltan implementation. Replaced unused Card Key function.
; When byte is $01, Meltan has a chance to replace a Pokemon that appears.
; $00 - Not Active
; $01 - Active
wMysteryBoxActive:: db
; ClearVariablesOnEnterMap does everything I want, except when leaving battle, so this switches off that specific aspect.
; This is achieved through some jank in engine\core.asm and engine\overworld\clear_variables.asm.
wDontSwitchOffMysteryBoxYet:: db
; trainer classes start at OPP_ID_OFFSET
wEnemyMonOrTrainerClass:: db
@ -2152,9 +2167,7 @@ wEnemyMonOrTrainerClass:: db
wPlayerJumpingYScreenCoordsIndex:: db
wRivalStarter:: db
ds 1
ds 1
wPlayerStarter:: db
; sprite index of the boulder the player is trying to push
@ -2177,12 +2190,6 @@ wDungeonWarpDestinationMap:: db
; which dungeon warp within the source map was used
wWhichDungeonWarp:: db
; Used for Meltan implementation. Replaced unused Card Key function.
; When byte is $01, Meltan has a chance to replace a Pokemon that appears.
; $00 - Not Active
; $01 - Active
wMysteryBoxActive:: db
ds 8
; bit 0: using Strength outside of battle