-
Notifications
You must be signed in to change notification settings - Fork 806
Allow fishing while surfing
Generation III games introduced the ability to fish while surfing; while Gen I and II games do not allow the player to do this. Thankfully, this is fairly simple to implement.
These tutorial uses the code that the author, The Void, contributed to Rangi's Polished Crystal.
- Add new player surfing sprites
- Remove check in fishing event code
- Add new fishing sprite tiles
- Load unique fishing sprite tiles while surfing
- Prevent fishing on top of NPCs
Sadly, Gens I and II reused pokemon sprites while the player is surfing. We will need to add custom surfing sprites that incorporate the default player sprite so that we can eventually support fishing while surfing.
Instead of rehashing other tutorials, follow the tutorial for adding new overworld sprites here: Add a new overworld sprite.
Add the following two sprites:
CHRIS_SURF
KRIS_SURF
Remove the following check from engine/events/overworld.asm
:
.FishTable:
dw .TryFish
dw .FishNoBite
dw .FishGotSomething
dw .FailFish
dw .FishNoFish
dw .FishGotItem
.TryFish:
ld a, [wPlayerState]
- cp PLAYER_SURF
- jr z, .fail
cp PLAYER_SURF_PIKA
jr z, .fail
call GetFacingTileCoord
call GetTileCollision
dec a ; cp WATER_TILE
jr z, .facingwater
.fail
ld a, $3
ret
Add the following new fishing sprite tiles to the folder gfx/overworld/
:
chris_surf_fish.png
kris_surf_fish.png
Add the following to engine/events/fishing_gfx.asm
LoadFishingGFX:
ldh a, [rVBK]
push af
xor a
ldh [rVBK], a
+ ld a, [wPlayerState]
+ cp PLAYER_SURF
+ jr z, .surfing
+
ld de, FishingGFX
ld a, [wPlayerGender]
bit 0, a
jr z, .got_gender
ld de, KrisFishingGFX
+ jr .got_gender
+.surfing
+
+ ld de, SurfFishingGFX
+ ld a, [wPlayerGender]
+ bit 0, a
+ jr z, .got_gender
+ ld de, KrisSurfFishingGFX
.got_gender
ld hl, vTiles0 tile $02
call .LoadGFX
ld hl, vTiles0 tile $06
call .LoadGFX
ld hl, vTiles0 tile $0a
call .LoadGFX
pop af
ldh [rVBK], a
ret
.LoadGFX:
lb bc, BANK(FishingGFX), 2
push de
call Get2bpp
pop de
ld hl, 2 tiles
add hl, de
ld d, h
ld e, l
ret
FishingGFX:
INCBIN "gfx/overworld/chris_fish.2bpp"
KrisFishingGFX:
INCBIN "gfx/overworld/kris_fish.2bpp"
+
+SurfFishingGFX:
+INCBIN "gfx/overworld/chris_surf_fish.2bpp"
+
+KrisSurfFishingGFX:
+INCBIN "gfx/overworld/kris_surf_fish.2bpp"
+
And with that, we can now fish while surfing!
As a final extra bit, make sure you fix the bug that allows you to fish on top on NPCs! Check the bug docs.