diff options
author | pikalaxalt <PikalaxALT@gmail.com> | 2016-06-22 08:57:12 -0400 |
---|---|---|
committer | pikalaxalt <PikalaxALT@gmail.com> | 2016-06-22 08:57:12 -0400 |
commit | 5a85ac7ca3bd50f3d63b25a3aca4e97fe341195d (patch) | |
tree | 3bd93feecd3e3e26d1718c5b39d13b8cb8885d26 | |
parent | 5dc37338f03f4ad8e3ab464627c7fb9b26331fe6 (diff) |
Fishing rod scripts
-rwxr-xr-x | event/overworld.asm | 203 | ||||
-rw-r--r-- | main.asm | 16 |
2 files changed, 215 insertions, 4 deletions
diff --git a/event/overworld.asm b/event/overworld.asm index 3f39bccf..ed7a3179 100755 --- a/event/overworld.asm +++ b/event/overworld.asm @@ -1368,9 +1368,208 @@ TryRockSmashOW: ; cf7f ret FishingRodFunction: ; cf91 + ld a, e + push af + call FieldMoveBufferReset + pop af + ld [wBuffer2], a +.asm_cf9a + ld hl, .Jumptable ; $4fa8 + call DoFieldMoveAction + jr nc, .asm_cf9a + and $7f + ld [wFieldMoveSucceeded], a + ret + +.Jumptable + dw Fish_CheckMap ; 3:4fb2 + dw Fish_NoBite ; 3:5005 + dw Fish_GotSomething ; 3:4ff7 + dw Fish_Failed ; 3:4ff4 + dw Fish_NoFish ; 3:5013 + +Fish_CheckMap: + ld a, [wPlayerBikeSurfState] + cp PLAYER_SURF + jr z, .asm_cfc7 + cp PLAYER_SURF_PIKA + jr z, .asm_cfc7 + call GetFacingTileCoord + call GetTileCollision + cp $1 + jr z, .asm_cfca +.asm_cfc7 + ld a, $3 + ret + +.asm_cfca + call GetFishingGroup + and a + jr nz, .asm_cfd3 + ld a, $4 + ret + +.asm_cfd3 + ld d, a + ld a, [wBuffer2] + ld e, a + ld a, $24 + ld hl, $697a + rst FarCall + ld a, d + and a + jr z, .asm_cff1 + ld [wd117], a + ld a, e + ld [wd040], a + ld a, $4 + ld [wBattleType], a + ld a, $2 + ret + +.asm_cff1 + ld a, $1 + ret + +Fish_Failed: + ld a, $80 + ret + +Fish_GotSomething: + ld a, $1 + ld [wBuffer6], a + ld hl, Script_GotABite + call QueueScript + ld a, $81 + ret + +Fish_NoBite: + ld a, $2 + ld [wBuffer6], a + ld hl, Script_NotEvenANibble + call QueueScript + ld a, $81 + ret + +Fish_NoFish: + ld a, $0 + ld [wBuffer6], a + ld hl, Script_NotEvenANibble2 + call QueueScript + ld a, $81 + ret + +Script_NotEvenANibble: ; d021 + scall Script_FishCastRod + writetext Text_NotEvenANibble + jump Script_NotEvenANibble_Continue + +Script_NotEvenANibble2: + scall Script_FishCastRod + writetext Text_NotEvenANibble +Script_NotEvenANibble_Continue: + callasm PutTheRodAway + closetext + end + +Script_GotABite: + scall Script_FishCastRod + callasm Fish_CheckFacingUp + iffalse .not_facing_up + applymovement 0, Movement_Fishing_BiteFacingUp + jump .continue + +.not_facing_up + applymovement 0, Movement_Fishing_BiteNotFacingUp +.continue + pause 40 + applymovement 0, Movement_Fishing_RestoreRod + writetext Text_OhABite + callasm PutTheRodAway + closetext + randomwildmon + startbattle + reloadmapafterbattle + end + + +Movement_Fishing_BiteNotFacingUp: + fish_got_bite + fish_got_bite + fish_got_bite + fish_got_bite + show_emote + step_end + +Movement_Fishing_BiteFacingUp: + fish_got_bite + fish_got_bite + fish_got_bite + fish_got_bite + step_sleep 1 + show_emote + step_end + +Movement_Fishing_RestoreRod: + hide_emote + fish_cast_rod + step_end + +Fish_CheckFacingUp: ; d06d + ld a, [wPlayerDirection] + and $c + cp OW_UP + ld a, $1 + jr z, .asm_d079 + xor a +.asm_d079 + ld [wScriptVar], a + ret + +Script_FishCastRod: ; d07d + reloadmappart + loadvar hBGMapMode, 0 + special UpdateTimePals + loademote EMOTE_ROD + callasm LoadFishingGFX + loademote EMOTE_SHOCK + applymovement PLAYER, Movement_CastRod + pause 40 + end + +Movement_CastRod: + fish_cast_rod + step_end + +PutTheRodAway: ; d096 + hlcoord 1, 14 + lb bc, $3, $12 + call ClearBox + call WaitBGMap + xor a + ld [hBGMapMode], a + ld a, $1 + ld [wPlayerAction], a + call UpdateSprites + call ReplacePlayerSprite + ret + +Text_OhABite: + text_jump Text_OhABite_ + db "@" + +Text_NotEvenANibble: + text_jump Text_NotEvenANibble_ + db "@" + +Text_NothingHereToFish: + text_jump Text_NothingHereToFish_ + db "@" + +BikeFunction: ; d0c0 IF DEF(GOLD) - dr $cf91, $d1e2 + dr $d0c0, $d1e2 ENDC IF DEF(SILVER) - dr $cf8f, $d1e0 + dr $d0be, $d1e0 ENDC @@ -814,7 +814,10 @@ SECTION "bank13", ROMX, BANK[$13] SECTION "bank14", ROMX, BANK[$14] Function50000: - dr $50000, $5087d + dr $50000, $5054f + +LoadFishingGFX: + dr $5054f, $5087d CopyPkmnToTempMon:: dr $5087d, $50940 @@ -1457,7 +1460,16 @@ Text_MayBeBreakable_:: dr $1942c7, $1942e8 Text_AskRockSmash_:: - dr $1942e8, $195610 + dr $1942e8, $19431c + +Text_OhABite_:: + dr $19431c, $194329 + +Text_NotEvenANibble_:: + dr $194329, $19433d + +Text_NothingHereToFish_:: + dr $19433d, $195610 ClockTimeUnknownText_:: ; 195610 dr $195610, $195624 |