Populate content of overworld HUD (#18); make wCurTurn 2 bytes (#25)

This commit is contained in:
xCrystal
2023-12-27 17:42:46 +01:00
parent b530cf90f4
commit 80257e4bca
6 changed files with 53 additions and 2 deletions

View File

@@ -26,7 +26,21 @@ BoardMenuScript::
xor a
call ByteFill
ld hl, wCurTurn
ld a, [hli]
cp MAX_TURNS / $100
jr nz, .not_max_turns
ld a, [hl]
cp MAX_TURNS % $100
jr z, .next
.not_max_turns
inc [hl]
jr nz, .next
dec hl
inc [hl]
jr .next
.next
; apply wCurTurn and wDieRoll in overworld HUD
call RefreshOverworldHUD
; reset turn-scoped event flags
ld hl, wEventFlags + EVENT_TURN_SCOPED_FLAGS_START / 8
ld c, (EVENT_TURN_SCOPED_FLAGS_END / 8) - (EVENT_TURN_SCOPED_FLAGS_START / 8)
@@ -305,6 +319,7 @@ DIE_MAX_NUMBER EQU 6
BoardMenu_BreakDieAnimation:
farcall LoadBoardMenuDieNumbersGFX
call RefreshOverworldHUD ; apply wDieRoll in overworld HUD
ld a, [wDieRoll]
dec a
add a

View File

@@ -349,7 +349,9 @@ PrintGainOrLoseCoins:
call PrintNum
ld hl, wDisplaySecondarySprites
set SECONDARYSPRITES_GAIN_OR_LOSE_COINS_F, [hl]
; refresh overworld HUD, and show coins string 750 ms
call UpdateActiveSprites
call RefreshOverworldHUD
ld c, 45 ; 750 ms
call DelayFrames
ld hl, wDisplaySecondarySprites