pokered/engine/overworld/player_animations.asm

534 lines
12 KiB
NASM
Raw Normal View History

EnterMapAnim::
call InitFacingDirectionList
2014-05-22 22:13:20 +00:00
ld a, $ec
2014-09-13 07:50:56 +00:00
ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
2014-05-22 22:13:20 +00:00
call Delay3
push hl
2014-09-13 07:50:56 +00:00
call GBFadeInFromWhite
2015-08-31 02:38:41 +00:00
ld hl, wFlags_D733
2014-09-13 07:50:56 +00:00
bit 7, [hl] ; used fly out of battle?
2014-05-22 22:13:20 +00:00
res 7, [hl]
2014-09-13 07:50:56 +00:00
jr nz, .flyAnimation
2015-07-22 14:57:31 +00:00
ld a, SFX_TELEPORT_ENTER_1
2014-05-22 22:13:20 +00:00
call PlaySound
ld hl, wd732
2014-09-13 07:50:56 +00:00
bit 4, [hl] ; used dungeon warp?
2014-05-22 22:13:20 +00:00
res 4, [hl]
pop hl
2014-09-13 07:50:56 +00:00
jr nz, .dungeonWarpAnimation
call PlayerSpinWhileMovingDown
2015-07-22 14:57:31 +00:00
ld a, SFX_TELEPORT_ENTER_2
2014-05-22 22:13:20 +00:00
call PlaySound
2014-09-13 07:50:56 +00:00
call IsPlayerStandingOnWarpPadOrHole
2014-05-22 22:13:20 +00:00
ld a, b
and a
2014-09-13 07:50:56 +00:00
jr nz, .done
; if the player is not standing on a warp pad or hole
ld hl, wPlayerSpinInPlaceAnimFrameDelay
2014-05-22 22:13:20 +00:00
xor a
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelay
2014-05-22 22:13:20 +00:00
inc a
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
2014-05-22 22:13:20 +00:00
ld a, $8
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
ld [hl], $ff ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
2014-09-13 07:50:56 +00:00
call PlayerSpinInPlace
.restoreDefaultMusic
call PlayDefaultMusic
2014-09-13 07:50:56 +00:00
.done
jp RestoreFacingDirectionAndYScreenPos
.dungeonWarpAnimation
ld c, 50
2014-05-22 22:13:20 +00:00
call DelayFrames
2014-09-13 07:50:56 +00:00
call PlayerSpinWhileMovingDown
jr .done
.flyAnimation
2014-05-22 22:13:20 +00:00
pop hl
2014-09-13 07:50:56 +00:00
ld de, BirdSprite
2014-05-29 08:31:46 +00:00
ld hl, vNPCSprites
2015-08-05 21:20:29 +00:00
lb bc, BANK(BirdSprite), $0c
2014-05-22 22:13:20 +00:00
call CopyVideoData
2014-09-13 07:50:56 +00:00
call LoadBirdSpriteGraphics
2015-07-22 14:57:31 +00:00
ld a, SFX_FLY
2014-05-22 22:13:20 +00:00
call PlaySound
2014-09-13 07:50:56 +00:00
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
ld [hli], a ; wFlyAnimUsingCoordList
ld a, 12
ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing right)
ld de, FlyAnimationEnterScreenCoords
2014-09-13 07:50:56 +00:00
call DoFlyAnimation
2014-05-22 22:13:20 +00:00
call LoadPlayerSpriteGraphics
2014-09-13 07:50:56 +00:00
jr .restoreDefaultMusic
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
FlyAnimationEnterScreenCoords:
2014-05-22 22:13:20 +00:00
; y, x pairs
; This is the sequence of screen coordinates used by the overworld
; Fly animation when the player is entering a map.
db $05, $98
db $0F, $90
db $18, $88
db $20, $80
db $27, $78
db $2D, $70
db $32, $68
db $36, $60
db $39, $58
db $3B, $50
db $3C, $48
db $3C, $40
2016-06-12 00:24:04 +00:00
PlayerSpinWhileMovingDown:
2014-09-13 07:50:56 +00:00
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
2014-05-22 22:13:20 +00:00
ld a, $10
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY
2014-05-22 22:13:20 +00:00
ld a, $3c
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimMaxY
call GetPlayerTeleportAnimFrameDelay
ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
jp PlayerSpinWhileMovingUpOrDown
2014-05-22 22:13:20 +00:00
_LeaveMapAnim::
call InitFacingDirectionList
2014-09-13 07:50:56 +00:00
call IsPlayerStandingOnWarpPadOrHole
2014-05-22 22:13:20 +00:00
ld a, b
and a
2014-09-13 07:50:56 +00:00
jr z, .playerNotStandingOnWarpPadOrHole
2014-05-22 22:13:20 +00:00
dec a
2014-09-13 07:50:56 +00:00
jp nz, LeaveMapThroughHoleAnim
.spinWhileMovingUp
2015-07-22 14:57:31 +00:00
ld a, SFX_TELEPORT_EXIT_1
2014-05-22 22:13:20 +00:00
call PlaySound
2014-09-13 07:50:56 +00:00
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, -$10
ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY
2014-05-22 22:13:20 +00:00
ld a, $ec
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimMaxY
call GetPlayerTeleportAnimFrameDelay
ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
call PlayerSpinWhileMovingUpOrDown
call IsPlayerStandingOnWarpPadOrHole
2014-05-22 22:13:20 +00:00
ld a, b
dec a
2014-09-13 07:50:56 +00:00
jr z, .playerStandingOnWarpPad
; if not standing on a warp pad, there is an extra delay
ld c, 10
2014-05-22 22:13:20 +00:00
call DelayFrames
2014-09-13 07:50:56 +00:00
.playerStandingOnWarpPad
call GBFadeOutToWhite
jp RestoreFacingDirectionAndYScreenPos
.playerNotStandingOnWarpPadOrHole
2014-05-22 22:13:20 +00:00
ld a, $4
call StopMusic
ld a, [wd732]
2014-09-13 07:50:56 +00:00
bit 6, a ; is the last used pokemon center the destination?
jr z, .flyAnimation
; if going to the last used pokemon center
ld hl, wPlayerSpinInPlaceAnimFrameDelay
ld a, 16
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelay
ld a, -1
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
2014-05-22 22:13:20 +00:00
xor a
2014-09-13 07:50:56 +00:00
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
2015-07-22 14:57:31 +00:00
ld [hl], SFX_TELEPORT_EXIT_2 ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
2014-09-13 07:50:56 +00:00
call PlayerSpinInPlace
jr .spinWhileMovingUp
.flyAnimation
call LoadBirdSpriteGraphics
ld hl, wFlyAnimUsingCoordList
ld a, $ff ; is not using coord list (flap in place)
ld [hli], a ; wFlyAnimUsingCoordList
ld a, 8
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex
call DoFlyAnimation
2015-07-22 14:57:31 +00:00
ld a, SFX_FLY
2014-05-22 22:13:20 +00:00
call PlaySound
2014-09-13 07:50:56 +00:00
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
ld [hli], a ; wFlyAnimUsingCoordList
2014-05-22 22:13:20 +00:00
ld a, $c
2014-09-13 07:50:56 +00:00
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex (facing right)
ld de, FlyAnimationScreenCoords1
2014-09-13 07:50:56 +00:00
call DoFlyAnimation
ld c, 40
2014-05-22 22:13:20 +00:00
call DelayFrames
2014-09-13 07:50:56 +00:00
ld hl, wFlyAnimCounter
ld a, 11
ld [hli], a ; wFlyAnimCounter
ld [hl], $8 ; wFlyAnimBirdSpriteImageIndex (facing left)
ld de, FlyAnimationScreenCoords2
2014-09-13 07:50:56 +00:00
call DoFlyAnimation
call GBFadeOutToWhite
jp RestoreFacingDirectionAndYScreenPos
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
FlyAnimationScreenCoords1:
2014-05-22 22:13:20 +00:00
; y, x pairs
; This is the sequence of screen coordinates used by the first part
; of the Fly overworld animation.
db $3C, $48
db $3C, $50
db $3B, $58
db $3A, $60
db $39, $68
db $37, $70
db $37, $78
db $33, $80
db $30, $88
db $2D, $90
db $2A, $98
db $27, $A0
2016-06-12 00:24:04 +00:00
FlyAnimationScreenCoords2:
2014-05-22 22:13:20 +00:00
; y, x pairs
; This is the sequence of screen coordinates used by the second part
; of the Fly overworld animation.
db $1A, $90
db $19, $80
db $17, $70
db $15, $60
db $12, $50
db $0F, $40
db $0C, $30
db $09, $20
db $05, $10
db $00, $00
db $F0, $00
2016-06-12 00:24:04 +00:00
LeaveMapThroughHoleAnim:
2014-05-22 22:13:20 +00:00
ld a, $ff
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a ; disable UpdateSprites
; shift upper half of player's sprite down 8 pixels and hide lower half
ld a, [wOAMBuffer + 0 * 4 + 2]
ld [wOAMBuffer + 2 * 4 + 2], a
ld a, [wOAMBuffer + 1 * 4 + 2]
ld [wOAMBuffer + 3 * 4 + 2], a
2014-05-22 22:13:20 +00:00
ld a, $a0
2014-09-13 07:50:56 +00:00
ld [wOAMBuffer + 0 * 4], a
ld [wOAMBuffer + 1 * 4], a
ld c, 2
2014-05-22 22:13:20 +00:00
call DelayFrames
; hide upper half of player's sprite
2014-05-22 22:13:20 +00:00
ld a, $a0
2014-09-13 07:50:56 +00:00
ld [wOAMBuffer + 2 * 4], a
ld [wOAMBuffer + 3 * 4], a
call GBFadeOutToWhite
2014-05-22 22:13:20 +00:00
ld a, $1
2014-09-13 07:50:56 +00:00
ld [wUpdateSpritesEnabled], a ; enable UpdateSprites
jp RestoreFacingDirectionAndYScreenPos
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
DoFlyAnimation:
2014-09-13 07:50:56 +00:00
ld a, [wFlyAnimBirdSpriteImageIndex]
xor $1 ; make the bird flap its wings
ld [wFlyAnimBirdSpriteImageIndex], a
ld [wSpriteStateData1 + 2], a
2014-05-22 22:13:20 +00:00
call Delay3
2014-09-13 07:50:56 +00:00
ld a, [wFlyAnimUsingCoordList]
2014-05-22 22:13:20 +00:00
cp $ff
jr z, .skipCopyingCoords ; if the bird is flapping its wings in place
ld hl, wSpriteStateData1 + 4
2014-05-22 22:13:20 +00:00
ld a, [de]
inc de
ld [hli], a
inc hl
ld a, [de]
inc de
ld [hl], a
.skipCopyingCoords
2014-09-13 07:50:56 +00:00
ld a, [wFlyAnimCounter]
2014-05-22 22:13:20 +00:00
dec a
2014-09-13 07:50:56 +00:00
ld [wFlyAnimCounter], a
jr nz, DoFlyAnimation
2014-05-22 22:13:20 +00:00
ret
2016-06-12 00:24:04 +00:00
LoadBirdSpriteGraphics:
ld de, BirdSprite
2014-05-29 08:31:46 +00:00
ld hl, vNPCSprites
2015-08-05 21:20:29 +00:00
lb bc, BANK(BirdSprite), $0c
2014-05-22 22:13:20 +00:00
call CopyVideoData
ld de, BirdSprite + $c0 ; moving animation sprite
2014-05-29 08:31:46 +00:00
ld hl, vNPCSprites2
2015-08-05 21:20:29 +00:00
lb bc, BANK(BirdSprite), $0c
2014-05-22 22:13:20 +00:00
jp CopyVideoData
2016-06-12 00:24:04 +00:00
InitFacingDirectionList:
2014-09-13 07:50:56 +00:00
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
ld [wSavedPlayerFacingDirection], a
2014-09-13 07:50:56 +00:00
ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
ld [wSavedPlayerScreenY], a
2014-09-13 07:50:56 +00:00
ld hl, PlayerSpinningFacingOrder
ld de, wFacingDirectionList
ld bc, 4
2014-05-22 22:13:20 +00:00
call CopyData
2014-09-13 07:50:56 +00:00
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
ld hl, wFacingDirectionList
; find the place in the list that matches the current facing direction
2014-09-13 07:50:56 +00:00
.loop
2014-05-22 22:13:20 +00:00
cp [hl]
inc hl
2014-09-13 07:50:56 +00:00
jr nz, .loop
2014-05-22 22:13:20 +00:00
dec hl
ret
2016-06-12 00:24:04 +00:00
PlayerSpinningFacingOrder:
2014-05-22 22:13:20 +00:00
; The order of the direction the player's sprite is facing when teleporting
; away. Creates a spinning effect.
2014-09-13 07:50:56 +00:00
db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
SpinPlayerSprite:
; copy the current value from the list into the sprite data and rotate the list
2014-05-22 22:13:20 +00:00
ld a, [hl]
2014-09-13 07:50:56 +00:00
ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images)
2014-05-22 22:13:20 +00:00
push hl
ld hl, wFacingDirectionList
ld de, wFacingDirectionList - 1
ld bc, 4
2014-05-22 22:13:20 +00:00
call CopyData
ld a, [wFacingDirectionList - 1]
ld [wFacingDirectionList + 3], a
2014-05-22 22:13:20 +00:00
pop hl
ret
2016-06-12 00:24:04 +00:00
PlayerSpinInPlace:
2014-09-13 07:50:56 +00:00
call SpinPlayerSprite
ld a, [wPlayerSpinInPlaceAnimFrameDelay]
2014-05-22 22:13:20 +00:00
ld c, a
and $3
jr nz, .skipPlayingSound
; when the last delay was a multiple of 4, play a sound if there is one
2014-09-13 07:50:56 +00:00
ld a, [wPlayerSpinInPlaceAnimSoundID]
2014-05-22 22:13:20 +00:00
cp $ff
call nz, PlaySound
.skipPlayingSound
2014-09-13 07:50:56 +00:00
ld a, [wPlayerSpinInPlaceAnimFrameDelayDelta]
2014-05-22 22:13:20 +00:00
add c
2014-09-13 07:50:56 +00:00
ld [wPlayerSpinInPlaceAnimFrameDelay], a
2014-05-22 22:13:20 +00:00
ld c, a
2014-09-13 07:50:56 +00:00
ld a, [wPlayerSpinInPlaceAnimFrameDelayEndValue]
2014-05-22 22:13:20 +00:00
cp c
ret z
call DelayFrames
2014-09-13 07:50:56 +00:00
jr PlayerSpinInPlace
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
PlayerSpinWhileMovingUpOrDown:
2014-09-13 07:50:56 +00:00
call SpinPlayerSprite
ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY]
2014-05-22 22:13:20 +00:00
ld c, a
2014-09-13 07:50:56 +00:00
ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
2014-05-22 22:13:20 +00:00
add c
ld [wSpriteStateData1 + 4], a
2014-05-22 22:13:20 +00:00
ld c, a
2014-09-13 07:50:56 +00:00
ld a, [wPlayerSpinWhileMovingUpOrDownAnimMaxY]
2014-05-22 22:13:20 +00:00
cp c
ret z
2014-09-13 07:50:56 +00:00
ld a, [wPlayerSpinWhileMovingUpOrDownAnimFrameDelay]
2014-05-22 22:13:20 +00:00
ld c, a
call DelayFrames
2014-09-13 07:50:56 +00:00
jr PlayerSpinWhileMovingUpOrDown
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
RestoreFacingDirectionAndYScreenPos:
ld a, [wSavedPlayerScreenY]
ld [wSpriteStateData1 + 4], a
ld a, [wSavedPlayerFacingDirection]
ld [wSpriteStateData1 + 2], a
2014-05-22 22:13:20 +00:00
ret
2014-09-13 07:50:56 +00:00
; if SGB, 2 frames, else 3 frames
2016-06-12 00:24:04 +00:00
GetPlayerTeleportAnimFrameDelay:
2014-09-13 07:50:56 +00:00
ld a, [wOnSGB]
2014-05-22 22:13:20 +00:00
xor $1
inc a
inc a
ret
IsPlayerStandingOnWarpPadOrHole::
2014-05-22 22:13:20 +00:00
ld b, 0
ld hl, WarpPadAndHoleData
2015-08-31 02:38:41 +00:00
ld a, [wCurMapTileset]
2014-05-22 22:13:20 +00:00
ld c, a
2014-09-13 07:50:56 +00:00
.loop
2014-05-22 22:13:20 +00:00
ld a, [hli]
cp $ff
2014-09-13 07:50:56 +00:00
jr z, .done
2014-05-22 22:13:20 +00:00
cp c
2014-09-13 07:50:56 +00:00
jr nz, .nextEntry
aCoord 8, 9
2014-05-22 22:13:20 +00:00
cp [hl]
2014-09-13 07:50:56 +00:00
jr z, .foundMatch
.nextEntry
2014-05-22 22:13:20 +00:00
inc hl
inc hl
2014-09-13 07:50:56 +00:00
jr .loop
.foundMatch
2014-05-22 22:13:20 +00:00
inc hl
ld b, [hl]
2014-09-13 07:50:56 +00:00
.done
2014-05-22 22:13:20 +00:00
ld a, b
2015-07-25 03:27:59 +00:00
ld [wStandingOnWarpPadOrHole], a
2014-05-22 22:13:20 +00:00
ret
INCLUDE "data/tilesets/warp_pad_hole_tile_ids.asm"
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
FishingAnim:
ld c, 10
2014-05-22 22:13:20 +00:00
call DelayFrames
ld hl, wd736
set 6, [hl] ; reserve the last 4 OAM entries
ld de, RedSprite
2014-05-29 08:31:46 +00:00
ld hl, vNPCSprites
2016-06-12 04:30:05 +00:00
lb bc, BANK(RedSprite), $c
2014-05-22 22:13:20 +00:00
call CopyVideoData
ld a, $4
ld hl, RedFishingTiles
2015-03-14 02:22:55 +00:00
call LoadAnimSpriteGfx
ld a, [wSpriteStateData1 + 2]
2014-05-22 22:13:20 +00:00
ld c, a
ld b, $0
ld hl, FishingRodOAM
2014-05-22 22:13:20 +00:00
add hl, bc
ld de, wOAMBuffer + $9c
2014-05-22 22:13:20 +00:00
ld bc, $4
call CopyData
ld c, 100
2014-05-22 22:13:20 +00:00
call DelayFrames
ld a, [wRodResponse]
2014-05-22 22:13:20 +00:00
and a
ld hl, NoNibbleText
jr z, .done
2014-05-22 22:13:20 +00:00
cp $2
ld hl, NothingHereText
jr z, .done
; there was a bite
; shake the player's sprite vertically
ld b, 10
.loop
ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position
call .ShakePlayerSprite
ld hl, wOAMBuffer + $9c
call .ShakePlayerSprite
2014-05-22 22:13:20 +00:00
call Delay3
dec b
jr nz, .loop
; If the player is facing up, hide the fishing rod so it doesn't overlap with
; the exclamation bubble that will be shown next.
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod
2014-05-22 22:13:20 +00:00
ld a, $a0
ld [wOAMBuffer + $9c], a
.skipHidingFishingRod
ld hl, wEmotionBubbleSpriteIndex
2014-05-22 22:13:20 +00:00
xor a
ld [hli], a ; player's sprite
ld [hl], a ; EXCLAMATION_BUBBLE
predef EmotionBubble
; If the player is facing up, unhide the fishing rod.
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr nz, .skipUnhidingFishingRod
2014-05-22 22:13:20 +00:00
ld a, $44
ld [wOAMBuffer + $9c], a
.skipUnhidingFishingRod
2014-05-22 22:13:20 +00:00
ld hl, ItsABiteText
.done
2014-05-22 22:13:20 +00:00
call PrintText
ld hl, wd736
res 6, [hl] ; unreserve the last 4 OAM entries
2014-05-22 22:13:20 +00:00
call LoadFontTilePatterns
ret
.ShakePlayerSprite
2014-05-22 22:13:20 +00:00
ld a, [hl]
xor $1
ld [hl], a
ret
2016-06-12 00:24:04 +00:00
NoNibbleText:
text_far _NoNibbleText
text_end
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
NothingHereText:
text_far _NothingHereText
text_end
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
ItsABiteText:
text_far _ItsABiteText
text_end
2014-05-22 22:13:20 +00:00
2016-06-12 00:24:04 +00:00
FishingRodOAM:
2014-09-13 07:50:56 +00:00
; specifies how the fishing rod should be drawn on the screen
2014-05-22 22:13:20 +00:00
; first byte = screen y coordinate
; second byte = screen x coordinate
; third byte = tile number
; fourth byte = sprite properties
db $5B, $4C, $FD, $00 ; player facing down
db $44, $4C, $FD, $00 ; player facing up
db $50, $40, $FE, $00 ; player facing left
db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile")
2016-06-12 00:24:04 +00:00
RedFishingTiles:
2014-05-22 22:13:20 +00:00
dw RedFishingTilesFront
2014-05-29 08:31:46 +00:00
db 2, BANK(RedFishingTilesFront)
dw vNPCSprites + $20
2014-05-22 22:13:20 +00:00
dw RedFishingTilesBack
2014-05-29 08:31:46 +00:00
db 2, BANK(RedFishingTilesBack)
dw vNPCSprites + $60
2014-05-22 22:13:20 +00:00
dw RedFishingTilesSide
2014-05-29 08:31:46 +00:00
db 2, BANK(RedFishingTilesSide)
dw vNPCSprites + $a0
2014-05-22 22:13:20 +00:00
dw RedFishingRodTiles
2014-05-29 08:31:46 +00:00
db 3, BANK(RedFishingRodTiles)
dw vNPCSprites2 + $7d0
2014-05-22 22:13:20 +00:00
_HandleMidJump::
2014-09-13 07:50:56 +00:00
ld a, [wPlayerJumpingYScreenCoordsIndex]
2014-05-22 22:13:20 +00:00
ld c, a
inc a
cp $10
2014-09-13 07:50:56 +00:00
jr nc, .finishedJump
ld [wPlayerJumpingYScreenCoordsIndex], a
ld b, 0
ld hl, PlayerJumpingYScreenCoords
2014-05-22 22:13:20 +00:00
add hl, bc
ld a, [hl]
ld [wSpriteStateData1 + 4], a ; player's sprite y coordinate
2014-05-22 22:13:20 +00:00
ret
2014-09-13 07:50:56 +00:00
.finishedJump
ld a, [wWalkCounter]
cp 0
2014-05-22 22:13:20 +00:00
ret nz
call UpdateSprites
call Delay3
xor a
2014-05-25 17:51:53 +00:00
ld [hJoyHeld], a
ld [hJoyPressed], a
ld [hJoyReleased], a
2014-09-13 07:50:56 +00:00
ld [wPlayerJumpingYScreenCoordsIndex], a
ld hl, wd736
2014-09-13 07:50:56 +00:00
res 6, [hl] ; not jumping down a ledge any more
ld hl, wd730
2014-09-13 07:50:56 +00:00
res 7, [hl] ; not simulating joypad states any more
2014-05-22 22:13:20 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-22 22:13:20 +00:00
ret
2016-06-12 00:24:04 +00:00
PlayerJumpingYScreenCoords:
2014-05-22 22:13:20 +00:00
; Sequence of y screen coordinates for player's sprite when jumping over a ledge.
db $38, $36, $34, $32, $31, $30, $30, $30, $31, $32, $33, $34, $36, $38, $3C, $3C