pokegold-spaceworld/engine/debug/field/warp.inc
DrippingYellow e384ea25ec
Some checks failed
CI / build (push) Has been cancelled
Finish labelling and split off bank03, bank09, and bank0b (#119)
* Fully labelled bank09.asm, started bank03.asm

* Finished labelling bank03.asm and bank0b.asm

* Tying up loose ends, splitting most of the completely labelled bank dumps

* Moved pokedex letter graphics out of charmap
2025-07-30 17:35:58 -04:00

75 lines
1.3 KiB
PHP

FieldDebug_Warp:
call DebugMenu_DisplayWarpSubmenu
jr nc, .do_warp
ld a, FIELDDEBUG_RETURN_REOPEN
ret
.do_warp
ld a, [wMenuSelection]
ld [wDefaultSpawnPoint], a
ld hl, wStateFlags
set 6, [hl] ; TODO: ???
ldh a, [hROMBank]
ld hl, FieldDebug_ShowWarpToText
call QueueScript
ld de, SFX_SAFARI_ZONE_PA
call PlaySFX
call DelayFrame
ld a, FIELDDEBUG_RETURN_EXIT
ret
SECTION "engine/debug/field/warp.inc@FieldDebug_ShowWarpToText", ROMX
FieldDebug_ShowWarpToText:
call .ShowText
call DoTeleportAnimation
ld a, MAPSETUP_TELEPORT
ldh [hMapEntryMethod], a
scf
ret
.ShowText:
call RefreshScreen
ld a, [wDefaultSpawnPoint]
call GetLandmarkName
call CopyStringToStringBuffer2
ld hl, .WarpToText
call FieldDebug_ShowTextboxAndExit
call ScreenCleanup
ret
.WarpToText:
text_from_ram wStringBuffer2
text ""
line "ワープします!"
done
DoTeleportAnimation:
ld a, PLAYER_OBJECT
call FreezeAllOtherObjects
ld a, PLAYER_OBJECT
ld hl, .TeleportFrom
call LoadMovementDataPointer
ld hl, wStateFlags
set SCRIPTED_MOVEMENT_STATE_F, [hl]
.loop
call Function2c4a
ld a, [wStateFlags]
bit SCRIPTED_MOVEMENT_STATE_F, a
jr nz, .loop
ld a, PLAYER_OBJECT
ld hl, .TeleportTo
call LoadMovementDataPointer_KeepStateFlags
ret
.TeleportFrom:
teleport_from
step_end
.TeleportTo:
teleport_to
step_end