mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
Implement unlocking levels [Commit 3/3] (#35)
This commit is contained in:
parent
4172760b6d
commit
008d796321
@ -76,6 +76,10 @@ ClearLevel:
|
||||
ret
|
||||
|
||||
UnlockLevels:
|
||||
call ComputeLevelsToUnlock
|
||||
jp SaveUnlockedLevels
|
||||
|
||||
ComputeLevelsToUnlock:
|
||||
ld hl, LevelUnlockRequirements
|
||||
ld de, wUnlockedLevels - 1
|
||||
ld b, 0
|
||||
@ -203,4 +207,17 @@ GetClearedLevelsStageAddress:
|
||||
ld hl, wClearedLevelsStage4
|
||||
ret
|
||||
|
||||
SaveUnlockedLevels:
|
||||
ld hl, wTempUnlockedLevels
|
||||
.loop
|
||||
ld a, [hli]
|
||||
ld e, a
|
||||
inc a ; cp $ff
|
||||
ret z
|
||||
push hl
|
||||
ld b, SET_FLAG
|
||||
call UnlockedLevelsFlagAction
|
||||
pop hl
|
||||
jr .loop
|
||||
|
||||
INCLUDE "data/levels/levels.asm"
|
||||
|
Loading…
Reference in New Issue
Block a user