Implement Waterfall technique (#34)

This commit is contained in:
xCrystal
2023-12-31 13:39:00 +01:00
parent aa91909388
commit a40f7cdde7
11 changed files with 71 additions and 27 deletions

View File

@@ -769,6 +769,22 @@ CheckFacingTileEvent:
ret ; c
.next_event_1
;; Waterfall
ld a, [wFacingTileID]
call CheckWaterfallTile
jr nz, .next_event_2
; Must be facing up and facing a waterfall tile to trigger the waterfall up sequence.
; Otherwise HI_NYBBLE_CURRENT collision (forced walking in walking direction) applies.
farcall CheckMapCanWaterfall
jr c, .next_event_2
ld a, BANK(Script_WaterfallAuto)
ld hl, Script_WaterfallAuto
call CallScript
ret ; c
.next_event_2
.no_event
xor a
ret ; nc

View File

@@ -340,7 +340,7 @@ DoPlayerMovement::
add hl, bc
ld a, [hl]
ld [wWalkingDirection], a
jr .continue_walk
jr .continue_fast_slide
.water_table
db RIGHT ; COLL_WATERFALL_RIGHT
@@ -414,8 +414,15 @@ DoPlayerMovement::
xor a
ret
.continue_fast_slide
ld a, STEP_ICE
jr .continue_step
.continue_walk
ld a, STEP_WALK
; fallthrough
.continue_step
call .DoStep
ld a, PLAYERMOVEMENT_CONTINUE
scf