Add support for a level having more than one associated landmark, for levels with alternative starting points (#12)

This commit is contained in:
xCrystal
2024-01-18 14:06:10 +01:00
parent 0abe559e11
commit 8757112152
6 changed files with 44 additions and 10 deletions

View File

@@ -23,6 +23,8 @@ if DEF(_DEBUG)
ld a, 100
ld [wCurPartyLevel], a
predef TryAddMonToParty
ld a, -1
ld [wUnlockedLevels], a ; debug
endc
farcall AutoSaveGameOutsideOverworld
jp GameMenu

View File

@@ -4,8 +4,6 @@ LevelSelectionMenu::
ldh [hMapAnims], a
ld a, 1 << 2 ; do not clear wShadowOAM during DoNextFrameForAllSprites
ld [wVramState], a
ld a, -1
ld [wUnlockedLevels], a ; debug
call ClearBGPalettes
call ClearTilemap
@@ -598,6 +596,12 @@ LevelSelectionMenu_GetValidDirections:
; the landmark byte of this transition is two bytes back
dec hl
dec hl
; use LandmarkToLevelTable to find the level that this landmark belongs to
ld e, [hl]
ld d, 0
ld hl, LandmarkToLevelTable
add hl, de
; find if said level has been unlocked
ld e, [hl]
ld b, CHECK_FLAG
call UnlockedLevelsFlagAction