You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user