mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 06:38:40 +13:00
Multiple bug fixes
* Moves the Mystery Box activation into Event Constants. This means that now, the Mystery Box activation is handled in the save, preventing some jank from happening when resetting. * The "don't switch off the box yet" variable is now always unset after entering a map. Meltan itself allows the variable to keep being re-set, which is super handy. Now, whenever you enter and exit maps, it'll work properly. * Flying, using an Escape Rope, and using Dig, all now unset the Mystery Box. If for some reason everything fucks up, this'll fix it. * Fixed a text bug with the scientist in Celadon University. * Fixed a menu alignment issue with the Vermilion Beauty. * Attempted to fix the Battle Tent exit. Failed. This is a really, really bad bug, hopefully this gets sorted sometime.
This commit is contained in:
parent
f6cdf8d428
commit
138bfd7042
9 changed files with 26 additions and 22 deletions
|
|
@ -88,9 +88,8 @@ TryDoWildEncounter:
|
|||
; This used to be in engine/battle/core.asm.
|
||||
; However, it was a bit buggy as the implementation was forced.
|
||||
; So instead, we do this:
|
||||
ld a, [wMysteryBoxActive] ; Load the box.
|
||||
cp $01 ; Check if it's active.
|
||||
jr z, .meltanEncounter ; If so, skip this.
|
||||
CheckEvent EVENT_MYSTERY_BOX_ACTIVATED
|
||||
jr nz, .meltanEncounter ; If so, skip this.
|
||||
ld b, 0
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
|
|
|
|||
|
|
@ -144,8 +144,7 @@ ItemUseMysteryBox:
|
|||
jp nz, ItemUseNotTime
|
||||
; Sets a variable in WRAM that'll trigger a Meltan wild encounter.
|
||||
; Handled in engine\core.asm
|
||||
ld a, $1
|
||||
ld [wMysteryBoxActive], a
|
||||
SetEvent EVENT_MYSTERY_BOX_ACTIVATED
|
||||
ld hl, MysteryBoxText ; Simple text is shown. Ambiguous to the user, identical to GO.
|
||||
call PrintText
|
||||
jp TextScriptEnd
|
||||
|
|
@ -1601,6 +1600,7 @@ ThrewRockText:
|
|||
|
||||
; also used for Dig out-of-battle effect
|
||||
ItemUseEscapeRope:
|
||||
ResetEvent EVENT_MYSTERY_BOX_ACTIVATED ; get this shit outta here
|
||||
ld a, [wIsInBattle]
|
||||
and a
|
||||
jr nz, .notUsable
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ ClearVariablesOnEnterMap::
|
|||
ld a, [wDontSwitchOffMysteryBoxYet] ; Load WRAM bit.
|
||||
and a ; Did a battle just happen?
|
||||
jr nz, .skip ; Yes? Off you go then.
|
||||
ld a, $0 ; No? Let's zero both of these out then.
|
||||
ld [wMysteryBoxActive], a ; This is now deactivated.
|
||||
ld [wDontSwitchOffMysteryBoxYet], a ; To be activated when a Meltan is defeated later.
|
||||
ResetEvent EVENT_MYSTERY_BOX_ACTIVATED
|
||||
.skip
|
||||
ld a, $0 ; No? Let's zero this out then.
|
||||
ld [wDontSwitchOffMysteryBoxYet], a ; To be activated when a Meltan is defeated later.
|
||||
ret
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ LeaveMapThroughHoleAnim:
|
|||
jp RestoreFacingDirectionAndYScreenPos
|
||||
|
||||
DoFlyAnimation:
|
||||
ResetEvent EVENT_MYSTERY_BOX_ACTIVATED ; get this shit outta here
|
||||
ld a, [wFlyAnimBirdSpriteImageIndex]
|
||||
xor $1 ; make the bird flap its wings
|
||||
ld [wFlyAnimBirdSpriteImageIndex], a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue