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 Waterfall technique (#34)
This commit is contained in:
@@ -667,7 +667,7 @@ WaterfallFunction:
|
||||
ld a, $80
|
||||
ret
|
||||
|
||||
CheckMapCanWaterfall:
|
||||
CheckMapCanWaterfall::
|
||||
ld a, [wPlayerDirection]
|
||||
and $c
|
||||
cp FACE_UP
|
||||
@@ -682,6 +682,19 @@ CheckMapCanWaterfall:
|
||||
scf
|
||||
ret
|
||||
|
||||
Script_WaterfallAuto::
|
||||
.loop
|
||||
playsound SFX_SURF
|
||||
applymovement PLAYER, .SlowStepUp
|
||||
callasm CheckContinueWaterfall
|
||||
iffalse .loop
|
||||
callasm SFXChannelsOff ; end SFX_SURF if still playing
|
||||
end
|
||||
|
||||
.SlowStepUp:
|
||||
slow_step UP
|
||||
step_end
|
||||
|
||||
Script_WaterfallFromMenu:
|
||||
reloadmappart
|
||||
special UpdateTimePals
|
||||
@@ -693,12 +706,16 @@ Script_UsedWaterfall:
|
||||
closetext
|
||||
playsound SFX_BUBBLEBEAM
|
||||
.loop
|
||||
applymovement PLAYER, .WaterfallStep
|
||||
callasm .CheckContinueWaterfall
|
||||
applymovement PLAYER, WaterfallStep
|
||||
callasm CheckContinueWaterfall
|
||||
iffalse .loop
|
||||
end
|
||||
|
||||
.CheckContinueWaterfall:
|
||||
.UseWaterfallText:
|
||||
text_far _UseWaterfallText
|
||||
text_end
|
||||
|
||||
CheckContinueWaterfall:
|
||||
xor a
|
||||
ldh [hScriptVar], a
|
||||
ld a, [wPlayerTile]
|
||||
@@ -708,14 +725,10 @@ Script_UsedWaterfall:
|
||||
ldh [hScriptVar], a
|
||||
ret
|
||||
|
||||
.WaterfallStep:
|
||||
WaterfallStep:
|
||||
turn_waterfall UP
|
||||
step_end
|
||||
|
||||
.UseWaterfallText:
|
||||
text_far _UseWaterfallText
|
||||
text_end
|
||||
|
||||
TryWaterfallOW::
|
||||
ld d, WATERFALL
|
||||
call CheckPartyMove
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user