Implement Flash technique through a map callback of type MAPCALLBACK_ENDMAPSETUP (#34)

This callback type is executed in a new map setup command at the very end of every map setup script. Maps that should trigger the use of Flash automatically should use an instance of this callback with fixed functionality
This commit is contained in:
xCrystal
2023-12-31 15:05:07 +01:00
parent c5e3179059
commit ce4ca85494
7 changed files with 38 additions and 2 deletions

View File

@@ -9,6 +9,23 @@ PlayWhirlpoolSound:
call WaitSFX
ret
UseFlashAuto::
; ReplaceTimeOfDayPals in map setup command LoadMapTimeOfDay sets wTimeOfDayPalset to DARKNESS_PALSET
; only if wStatusFlags[STATUSFLAGS_FLASH_F] has not been set.
ld a, [wTimeOfDayPalset]
cp DARKNESS_PALSET
ret nz
ld c, 30 ; 500 ms
call DelayFrames
call WaitSFX
ld de, SFX_FLASH
call PlaySFX
call BlindingFlash
ld c, 30 ; 500 ms
call DelayFrames
call WaitSFX
ret
BlindingFlash:
farcall FadeOutPalettesToWhite
ld hl, wStatusFlags