kep-hack/engine/overworld/clear_variables.asm
Llinos Evans 934f8adcac Mystery Box functionality
It was a long shot, but I did it! I added the Mystery Box from Pokemon GO! Very happy with the results here.

So here's how it works: When used, the game will replace Pokemon encountered with Meltan until the player leaves the map. This is sort of how it works in GO, with the player unable to close it and naturally petering out as they play.

Now multiple Meltan can be obtained, and in abundance, just like GO. Technically, someone could use this as a pseudo-Repel to replace hard encounters with easy ones.

Oh, and I'm pretty sure this happens vs static encounters as well, but it's awkward to account for I think that's hilarious, so...
2023-05-31 05:03:22 +01:00

21 lines
430 B
NASM

ClearVariablesOnEnterMap::
ld a, SCREEN_HEIGHT_PX
ldh [hWY], a
ldh [rWY], a
xor a
ldh [hAutoBGTransferEnabled], a
ld [wStepCounter], a
ld [wLoneAttackNo], a
ldh [hJoyPressed], a
ldh [hJoyReleased], a
ldh [hJoyHeld], a
ld [wActionResultOrTookBattleTurn], a
ld [wMysteryBoxActive], a
ld hl, wCardKeyDoorY
ld [hli], a
ld [hl], a
ld hl, wWhichTrade
ld bc, wStandingOnWarpPadOrHole - wWhichTrade
call FillMemory
ret