Implement talker events [commit 2] (#30)

This commit is contained in:
xCrystal
2023-11-28 18:02:00 +01:00
parent 88b6810a18
commit 933fca3b4b
12 changed files with 111 additions and 44 deletions

View File

@@ -20,12 +20,22 @@ BoardMenuScript::
; save after opentext to reanchor map first
; save before processing variables like wCurTurn due to BoardMenuScript reentry after game reset
farcall AutoSaveGameInOverworld
; reset turn-scoped variables (wDieRoll, wSpacesLeft) and update wCurTurn
ld hl, wTurnData
ld bc, wTurnDataEnd - wTurnData
xor a
call ByteFill
ld hl, wCurTurn
inc [hl]
; reset turn-scoped event flags
ld hl, wEventFlags + EVENT_LEVEL_SCOPED_FLAGS_START / 8
ld c, (EVENT_LEVEL_SCOPED_FLAGS_END / 8) - (EVENT_LEVEL_SCOPED_FLAGS_START / 8)
xor a
.loop
ld [hli], a
dec c
jr nz, .loop
; load the data for the current space to wCurSpaceStruct
jp LoadCurSpaceData
.Die: