Refactor GR Blimp movement and other location/movement data

This commit is contained in:
earthoul
2026-01-06 22:24:54 +09:00
parent a30d786934
commit 0d935c8f7a
5 changed files with 78 additions and 72 deletions

View File

@@ -6066,9 +6066,9 @@ Func_1ec0f:
push de
push hl
ld a, [wdd22]
ld b, $02
ld d, $70
ld e, $30
ld b, SOUTH
ld d, 112
ld e, 48
farcall LoadOWObject
farcall ResetOWObjectSpriteAnimating
ld b, $01

View File

@@ -8293,18 +8293,19 @@ Func_2fe54:
farcall InitOWObjects
ld a, [wPrevMap]
cp OVERWORLD_MAP_TCG
jr nz, .asm_2fe6c
jr nz, .from_gr_to_tcg
; from tcg to gr
ld a, NPC_GR_BLIMP
lb de, 16, 128
ld b, EAST
farcall LoadOWObject
jr .asm_2fe77
.asm_2fe6c
jr .got_blimp_data
.from_gr_to_tcg
ld a, NPC_GR_BLIMP
lb de, 144, 16
ld b, WEST
farcall LoadOWObject
.asm_2fe77
.got_blimp_data
ld a, OWMODE_SCRIPT
ld [wOverworldMode], a
ld a, BANK(Func_2fe9a)
@@ -8333,41 +8334,42 @@ Func_2fe97:
Func_2fe9a:
ld a, [wPrevMap]
cp OVERWORLD_MAP_TCG
jr z, .asm_2febb
jr z, .from_tcg_to_gr
; from gr to tcg
ld a, OVERWORLD_MAP_TCG
ld de, $0
lb de, 0, 0
ld b, NORTH
farcall SetWarpData
ld hl, Data_2ff50
ld a, $00
ld hl, .BlimpMovementWestward
ld a, TCG_ISLAND
ld [wCurIsland], a
ld a, $0a
ld a, OWMAP_TCG_AIRPORT
ld [wCurOWLocation], a
jr .asm_2fee2
.asm_2febb
jr .loop_flyover
.from_tcg_to_gr
ld a, OVERWORLD_MAP_GR
ld de, $0
lb de, 0, 0
ld b, NORTH
farcall SetWarpData
ld hl, Data_2ff48
ld a, $01
ld hl, .BlimpMovementEastward
ld a, GR_ISLAND
ld [wCurIsland], a
ld a, $00
ld a, OWMAP_GR_AIRPORT
ld [wCurOWLocation], a
ld a, EVENT_SHORT_GR_ISLAND_FLYOVER_SEQUENCE
farcall GetEventValue
jr nz, .asm_2fee2
jr nz, .loop_flyover
push hl
ld hl, wOverworldTransition
set 3, [hl]
pop hl
.asm_2fee2
.loop_flyover
ld a, [hli]
ld e, [hl]
inc hl
ld d, a
cp $ff
jr z, .asm_2ff34
jr z, .fade
ld a, [hli]
ld b, a
push hl
@@ -8377,52 +8379,56 @@ Func_2fe9a:
ld a, NPC_GR_BLIMP
pop bc
farcall _SetOWObjectDirection
.asm_2fefb
ld c, $03
.asm_2fefd
.loop_movement
ld c, 3
.loop_transitions
push bc
call DoFrame
ld hl, wOverworldTransition
bit 3, [hl]
jr nz, .asm_2ff17
jr nz, .next_transition
bit 2, [hl]
jr nz, .asm_2ff17
jr nz, .next_transition
ldh a, [hKeysPressed]
bit B_PAD_B, a
jr z, .asm_2ff17
jr z, .next_transition
set 2, [hl]
call Func_2ff3f
.asm_2ff17
call .FadeToWhite
.next_transition
pop bc
dec c
jr nz, .asm_2fefd
jr nz, .loop_transitions
farcall MoveOWObjectToTargetPosition
jr c, .asm_2ff24
jr c, .moving
pop hl
jr .asm_2fee2
.asm_2ff24
jr .loop_flyover
.moving
ld a, [wOverworldTransition]
bit 2, a
jr z, .asm_2fefb
jr z, .loop_movement
farcall CheckPalFading
jr nz, .asm_2fefb
jr nz, .loop_movement
pop hl
jr .asm_2ff37
.asm_2ff34
call Func_2ff3f
.asm_2ff37
jr .exit
.fade
call .FadeToWhite
.exit
call WaitPalFading
farcall Func_110a8
ret
Func_2ff3f:
.FadeToWhite:
ld a, $00
ld b, $00
farcall StartPalFadeToBlackOrWhite
ret
Data_2ff48:
db $90, $10, $01, $a0, $00, $01, $ff, $ff
.BlimpMovementEastward:
db 144, 16, EAST
db 160, 0, EAST
dw $ffff
Data_2ff50:
db $10, $80, $03, $00, $90, $03, $ff, $ff
.BlimpMovementWestward:
db 16, 128, WEST
db 0, 144, WEST
dw $ffff

View File

@@ -82,13 +82,13 @@ OverworldGr_MapScripts:
Func_30092:
ld a, [wPrevMap]
cp MAP_OVERHEAD_ISLANDS
jr z, .asm_300a0
jr z, .set_blimp_music
cp MAP_GR_AIRPORT
jr z, .asm_300a0
jr z, .set_blimp_music
scf
ccf
ret
.asm_300a0
.set_blimp_music
ld a, MUSIC_GR_BLIMP
ld [wNextMusic], a
scf
@@ -106,12 +106,12 @@ Func_300a8:
ld [wPlayerOWLocation], a
ld a, NPC_VOLCANO_SMOKE_GR
lb de, $3c, $20
lb de, 60, 32
ld b, NORTH
farcall LoadOWObject
ld a, NPC_GR_CASTLE_FLAG
lb de, $b0, $00
lb de, 176, 0
ld b, NORTH
farcall LoadOWObject
@@ -170,7 +170,7 @@ Func_300a8:
cp MAP_OVERHEAD_ISLANDS
jr z, .asm_30159
ld a, NPC_GR_BLIMP
lb de, $18, $b0
lb de, 24, 176
ld b, EAST
farcall LoadOWObject
scf
@@ -178,7 +178,7 @@ Func_300a8:
.asm_30159
ld a, NPC_GR_BLIMP
lb de, $30, $f0
lb de, 48, 240
ld b, EAST
farcall LoadOWObject
ld a, EVENT_SHORT_GR_ISLAND_FLYOVER_SEQUENCE

View File

@@ -26,18 +26,18 @@ Prologue::
; do GR Blimp movement
ld a, NPC_GR_BLIMP
lb de, $a0, $30
lb de, 160, 48
ld b, WEST
farcall LoadOWObject
lb de, $78, $30
lb de, 120, 48
ld b, WEST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
lb de, $78, $10
lb de, 120, 16
ld b, WEST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
lb de, $58, $18
lb de, 88, 24
ld b, WEST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
@@ -47,10 +47,10 @@ Prologue::
; load player object in map
ld a, [wPlayerOWObject]
lb de, $44, $44
lb de, 68, 68
ld b, SOUTH
farcall LoadOWObject
lb de, $40, $30
lb de, 64, 48
ld b, WEST
call .MoveGRBlimp
@@ -68,22 +68,22 @@ Prologue::
call .DoGRBlimpBeamAnimation
; more GR Blimp movement
lb de, $20, $40
lb de, 32, 64
ld b, WEST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
lb de, $30, $58
lb de, 48, 88
ld b, EAST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
lb de, $68, $50
lb de, 104, 80
ld b, EAST
call .MoveGRBlimp
call .DoGRBlimpBeamAnimation
lb de, $50, $5c
lb de, 80, 92
ld b, WEST
call .MoveGRBlimp
lb de, $50, $78
lb de, 80, 120
ld b, EAST
call .MoveGRBlimp
@@ -120,7 +120,7 @@ Prologue::
call WaitForOWObjectAnimation
ld a, [wPlayerOWObject]
farcall _ClearOWObject
lb de, $44, $44
lb de, 68, 68
ld b, SOUTH
farcall LoadOWObject
ld a, 30
@@ -183,16 +183,16 @@ Prologue::
.MovePlayer:
ld a, [wPlayerOWObject]
ld b, $01
ld b, TRUE
farcall _SetOWObjectAnimStruct1Flag2
lb de, $24, $68
lb de, 36, 104
farcall SetOWObjectTargetPosition
.loop_wait_1
call DoFrame
farcall MoveOWObjectToTargetPosition
jr c, .loop_wait_1
ld a, [wPlayerOWObject]
lb de, $c, $68
lb de, 12, 104
farcall SetOWObjectTargetPosition
.loop_wait_2
call DoFrame
@@ -3880,7 +3880,7 @@ Func_3ddb8:
lb de, 9, 4
ld b, WEST
farcall LoadOWObjectInMap
ld de, $600
lb de, 6, 0
farcall CalcOWScroll
ld a, $02
farcall SetOWScrollState

View File

@@ -751,7 +751,7 @@ Func_4048a:
ld [wPlayerOWLocation], a
ld a, NPC_VOLCANO_SMOKE_TCG
lb de, $78, $00
lb de, 120, 0
ld b, NORTH
farcall LoadOWObject
@@ -811,14 +811,14 @@ Func_4048a:
cp MAP_OVERHEAD_ISLANDS
jr z, .asm_40528
ld a, NPC_GR_BLIMP
lb de, $50, $78
lb de, 80, 120
ld b, EAST
farcall LoadOWObject
scf
ret
.asm_40528
ld a, NPC_GR_BLIMP
lb de, $90, $60
lb de, 144, 96
ld b, WEST
farcall LoadOWObject
ld a, $00
@@ -6040,9 +6040,9 @@ Script_43333:
lb de, 1, 2
ld b, NORTH
farcall SetWarpData
ld a, $00
ld a, OWMAP_MASON_LABORATORY
ld [wCurOWLocation], a
ld a, $00
ld a, TCG_ISLAND
ld [wCurIsland], a
ld a, EVENT_MASONS_LAB_CHALLENGE_MACHINE_STATE_DUMMY
farcall MaxOutEventValue