diff options
Diffstat (limited to 'engine/events/overworld.asm')
-rw-r--r-- | engine/events/overworld.asm | 360 |
1 files changed, 179 insertions, 181 deletions
diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index f9d67f0bd..e57635fef 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -1,11 +1,11 @@ -FieldMoveJumptableReset: ; c6ea +FieldMoveJumptableReset: xor a ld hl, wBuffer1 ld bc, 7 call ByteFill ret -FieldMoveJumptable: ; c6f5 +FieldMoveJumptable: ld a, [wBuffer1] rst JumpTable ld [wBuffer1], a @@ -19,7 +19,7 @@ FieldMoveJumptable: ; c6f5 scf ret -GetPartyNick: ; c706 +GetPartyNick: ; write wCurPartyMon nickname to wStringBuffer1-3 ld hl, wPartyMonNicknames ld a, BOXMON @@ -33,7 +33,7 @@ GetPartyNick: ; c706 call CopyName2 ret -CheckEngineFlag: ; c721 +CheckEngineFlag: ; Check engine flag de ; Return carry if flag is not set ld b, CHECK_FLAG @@ -47,7 +47,7 @@ CheckEngineFlag: ; c721 xor a ret -CheckBadge: ; c731 +CheckBadge: ; Check engine flag a (ENGINE_ZEPHYRBADGE thru ENGINE_EARTHBADGE) ; Display "Badge required" text and return carry if the badge is not owned call CheckEngineFlag @@ -57,13 +57,13 @@ CheckBadge: ; c731 scf ret -.BadgeRequiredText: ; c73d +.BadgeRequiredText: ; Sorry! A new BADGE ; is required. text_jump _BadgeRequiredText db "@" -CheckPartyMove: ; c742 +CheckPartyMove: ; Check if a monster in your party has move d. ld e, 0 @@ -107,17 +107,17 @@ CheckPartyMove: ; c742 scf ret -FieldMoveFailed: ; c779 +FieldMoveFailed: ld hl, .CantUseHere call MenuTextBoxBackup ret -.CantUseHere: ; 0xc780 +.CantUseHere: ; Can't use that here. text_jump UnknownText_0x1c05c8 db "@" -CutFunction: ; c785 +CutFunction: call FieldMoveJumptableReset .loop ld hl, .Jumptable @@ -127,12 +127,12 @@ CutFunction: ; c785 ld [wFieldMoveSucceeded], a ret -.Jumptable: ; c796 (3:4796) +.Jumptable: dw .CheckAble dw .DoCut dw .FailCut -.CheckAble: ; c79c (3:479c) +.CheckAble: ld de, ENGINE_HIVEBADGE call CheckBadge jr c, .nohivebadge @@ -149,29 +149,29 @@ CutFunction: ; c785 ld a, $2 ret -.DoCut: ; c7b2 (3:47b2) +.DoCut: ld hl, Script_CutFromMenu call QueueScript ld a, $81 ret -.FailCut: ; c7bb (3:47bb) +.FailCut: ld hl, Text_NothingToCut call MenuTextBoxBackup ld a, $80 ret -Text_UsedCut: ; 0xc7c4 +Text_UsedCut: ; used CUT! text_jump UnknownText_0x1c05dd db "@" -Text_NothingToCut: ; 0xc7c9 +Text_NothingToCut: ; There's nothing to CUT here. text_jump UnknownText_0x1c05ec db "@" -CheckMapForSomethingToCut: ; c7ce +CheckMapForSomethingToCut: ; Does the collision data of the facing tile permit cutting? call GetFacingTileCoord ld c, a @@ -206,11 +206,11 @@ CheckMapForSomethingToCut: ; c7ce scf ret -Script_CutFromMenu: ; c7fe +Script_CutFromMenu: reloadmappart special UpdateTimePals -Script_Cut: ; 0xc802 +Script_Cut: callasm GetPartyNick writetext Text_UsedCut reloadmappart @@ -218,7 +218,7 @@ Script_Cut: ; 0xc802 closetext end -CutDownTreeOrGrass: ; c810 +CutDownTreeOrGrass: ld hl, wBuffer3 ; OverworldMapTile ld a, [hli] ld h, [hl] @@ -240,7 +240,7 @@ CutDownTreeOrGrass: ; c810 call LoadStandardFont ret -CheckOverworldTileArrays: ; c840 +CheckOverworldTileArrays: ; Input: c contains the tile you're facing ; Output: Replacement tile in b and effect on wild encounters in c, plus carry set. ; Carry is not set if the facing tile cannot be replaced, or if the tileset @@ -276,17 +276,15 @@ CheckOverworldTileArrays: ; c840 xor a ret - INCLUDE "data/events/field_move_blocks.asm" - -OWFlash: ; c8ac +OWFlash: call .CheckUseFlash and $7f ld [wFieldMoveSucceeded], a ret -.CheckUseFlash: ; c8b5 +.CheckUseFlash: ; Flash ld de, ENGINE_ZEPHYRBADGE farcall CheckBadge @@ -312,11 +310,11 @@ OWFlash: ; c8ac ld a, $80 ret -UseFlash: ; c8e0 +UseFlash: ld hl, Script_UseFlash jp QueueScript -Script_UseFlash: ; 0xc8e6 +Script_UseFlash: reloadmappart special UpdateTimePals writetext UnknownText_0xc8f3 @@ -324,7 +322,7 @@ Script_UseFlash: ; 0xc8e6 closetext end -UnknownText_0xc8f3: ; 0xc8f3 +UnknownText_0xc8f3: text_jump UnknownText_0x1c0609 start_asm call WaitSFX @@ -334,10 +332,10 @@ UnknownText_0xc8f3: ; 0xc8f3 ld hl, .BlankText ret -.BlankText: ; 0xc908 +.BlankText: db "@" -SurfFunction: ; c909 +SurfFunction: call FieldMoveJumptableReset .loop ld hl, .Jumptable @@ -347,13 +345,13 @@ SurfFunction: ; c909 ld [wFieldMoveSucceeded], a ret -.Jumptable: ; c91a (3:491a) +.Jumptable: dw .TrySurf dw .DoSurf dw .FailSurf dw .AlreadySurfing -.TrySurf: ; c922 (3:4922) +.TrySurf: ld de, ENGINE_FOGBADGE call CheckBadge jr c, .asm_c956 @@ -385,7 +383,7 @@ SurfFunction: ; c909 ld a, $2 ret -.DoSurf: ; c95f (3:495f) +.DoSurf: call GetSurfType ld [wBuffer2], a call GetPartyNick @@ -394,22 +392,22 @@ SurfFunction: ; c909 ld a, $81 ret -.FailSurf: ; c971 (3:4971) +.FailSurf: ld hl, CantSurfText call MenuTextBoxBackup ld a, $80 ret -.AlreadySurfing: ; c97a (3:497a) +.AlreadySurfing: ld hl, AlreadySurfingText call MenuTextBoxBackup ld a, $80 ret -SurfFromMenuScript: ; c983 +SurfFromMenuScript: special UpdateTimePals -UsedSurfScript: ; c986 +UsedSurfScript: writetext UsedSurfText ; "used SURF!" waitbutton closetext @@ -426,23 +424,23 @@ UsedSurfScript: ; c986 applymovement PLAYER, wMovementBuffer end -.empty_fn ; c9a2 +.empty_fn farcall StubbedTrainerRankings_Surf ret -UsedSurfText: ; c9a9 +UsedSurfText: text_jump _UsedSurfText db "@" -CantSurfText: ; c9ae +CantSurfText: text_jump _CantSurfText db "@" -AlreadySurfingText: ; c9b3 +AlreadySurfingText: text_jump _AlreadySurfingText db "@" -GetSurfType: ; c9b8 +GetSurfType: ; Surfing on Pikachu uses an alternate sprite. ; This is done by using a separate movement type. @@ -459,7 +457,7 @@ GetSurfType: ; c9b8 ld a, PLAYER_SURF ret -CheckDirection: ; c9cb +CheckDirection: ; Return carry if a tile permission prevents you ; from moving in the direction you're facing. @@ -490,7 +488,7 @@ CheckDirection: ; c9cb db FACE_LEFT db FACE_RIGHT -TrySurfOW:: ; c9e7 +TrySurfOW:: ; Checking a tile in the overworld. ; Return carry if fail is allowed. @@ -538,7 +536,7 @@ TrySurfOW:: ; c9e7 xor a ret -AskSurfScript: ; ca2c +AskSurfScript: opentext writetext AskSurfText yesorno @@ -546,11 +544,11 @@ AskSurfScript: ; ca2c closetext end -AskSurfText: ; ca36 +AskSurfText: text_jump _AskSurfText ; The water is calm. db "@" ; Want to SURF? -FlyFunction: ; ca3b +FlyFunction: call FieldMoveJumptableReset .loop ld hl, .Jumptable @@ -565,7 +563,7 @@ FlyFunction: ; ca3b dw .DoFly dw .FailFly -.TryFly: ; ca52 +.TryFly: ; Fly ld de, ENGINE_STORMBADGE call CheckBadge @@ -606,18 +604,18 @@ FlyFunction: ; ca3b ld a, $80 ret -.DoFly: ; ca94 +.DoFly: ld hl, .FlyScript call QueueScript ld a, $81 ret -.FailFly: ; ca9d +.FailFly: call FieldMoveFailed ld a, $82 ret -.FlyScript: ; 0xcaa3 +.FlyScript: reloadmappart callasm HideSprites special UpdateTimePals @@ -632,20 +630,20 @@ FlyFunction: ; ca3b callasm .ReturnFromFly end -.ReturnFromFly: ; cacb +.ReturnFromFly: farcall Function561d call DelayFrame call ReplaceKrisSprite farcall LoadOverworldFont ret -WaterfallFunction: ; cade +WaterfallFunction: call .TryWaterfall and $7f ld [wFieldMoveSucceeded], a ret -.TryWaterfall: ; cae7 +.TryWaterfall: ; Waterfall ld de, ENGINE_RISINGBADGE farcall CheckBadge @@ -663,7 +661,7 @@ WaterfallFunction: ; cade ld a, $80 ret -CheckMapCanWaterfall: ; cb07 +CheckMapCanWaterfall: ld a, [wPlayerDirection] and $c cp FACE_UP @@ -678,11 +676,11 @@ CheckMapCanWaterfall: ; cb07 scf ret -Script_WaterfallFromMenu: ; 0xcb1c +Script_WaterfallFromMenu: reloadmappart special UpdateTimePals -Script_UsedWaterfall: ; 0xcb20 +Script_UsedWaterfall: callasm GetPartyNick writetext .Text_UsedWaterfall waitbutton @@ -694,7 +692,7 @@ Script_UsedWaterfall: ; 0xcb20 iffalse .loop end -.CheckContinueWaterfall: ; cb38 +.CheckContinueWaterfall: xor a ld [wScriptVar], a ld a, [wPlayerStandingTile] @@ -705,16 +703,16 @@ Script_UsedWaterfall: ; 0xcb20 ld [wScriptVar], a ret -.WaterfallStep: ; cb4f +.WaterfallStep: turn_waterfall UP step_end -.Text_UsedWaterfall: ; 0xcb51 +.Text_UsedWaterfall: ; used WATERFALL! text_jump UnknownText_0x1c068e db "@" -TryWaterfallOW:: ; cb56 +TryWaterfallOW:: ld d, WATERFALL call CheckPartyMove jr c, .failed @@ -736,15 +734,15 @@ TryWaterfallOW:: ; cb56 scf ret -Script_CantDoWaterfall: ; 0xcb7e +Script_CantDoWaterfall: jumptext .Text_CantDoWaterfall -.Text_CantDoWaterfall: ; 0xcb81 +.Text_CantDoWaterfall: ; Wow, it's a huge waterfall. text_jump UnknownText_0x1c06a3 db "@" -Script_AskWaterfall: ; 0xcb86 +Script_AskWaterfall: opentext writetext .AskUseWaterfall yesorno @@ -752,17 +750,17 @@ Script_AskWaterfall: ; 0xcb86 closetext end -.AskUseWaterfall: ; 0xcb90 +.AskUseWaterfall: ; Do you want to use WATERFALL? text_jump UnknownText_0x1c06bf db "@" -EscapeRopeFunction: ; cb95 +EscapeRopeFunction: call FieldMoveJumptableReset ld a, $1 jr dig_incave -DigFunction: ; cb9c +DigFunction: call FieldMoveJumptableReset ld a, $2 @@ -776,12 +774,12 @@ dig_incave ld [wFieldMoveSucceeded], a ret -.DigTable: ; cbb2 +.DigTable: dw .CheckCanDig dw .DoDig dw .FailDig -.CheckCanDig: ; cbb8 +.CheckCanDig: call GetMapEnvironment cp CAVE jr z, .incave @@ -805,7 +803,7 @@ dig_incave ld a, $1 ret -.DoDig: ; cbd8 +.DoDig: ld hl, wDigWarpNumber ld de, wNextWarp ld bc, 3 @@ -826,7 +824,7 @@ dig_incave ld a, $81 ret -.FailDig: ; cc06 +.FailDig: ld a, [wBuffer2] cp $2 jr nz, .failescaperope @@ -839,33 +837,33 @@ dig_incave ld a, $80 ret -.Text_UsedDig: ; 0xcc1c +.Text_UsedDig: ; used DIG! text_jump UnknownText_0x1c06de db "@" -.Text_UsedEscapeRope: ; 0xcc21 +.Text_UsedEscapeRope: ; used an ESCAPE ROPE. text_jump UnknownText_0x1c06ed db "@" -.Text_CantUseHere: ; 0xcc26 +.Text_CantUseHere: ; Can't use that here. text_jump UnknownText_0x1c0705 db "@" -.UsedEscapeRopeScript: ; 0xcc2b +.UsedEscapeRopeScript: reloadmappart special UpdateTimePals writetext .Text_UsedEscapeRope jump .UsedDigOrEscapeRopeScript -.UsedDigScript: ; 0xcc35 +.UsedDigScript: reloadmappart special UpdateTimePals writetext .Text_UsedDig -.UsedDigOrEscapeRopeScript: ; 0xcc3c +.UsedDigOrEscapeRopeScript: waitbutton closetext playsound SFX_WARP_TO @@ -878,17 +876,17 @@ dig_incave applymovement PLAYER, .DigReturn end -.DigOut: ; 0xcc59 +.DigOut: step_dig 32 hide_object step_end -.DigReturn: ; 0xcc5d +.DigReturn: show_object return_dig 32 step_end -TeleportFunction: ; cc61 +TeleportFunction: call FieldMoveJumptableReset .loop ld hl, .Jumptable @@ -898,12 +896,12 @@ TeleportFunction: ; cc61 ld [wFieldMoveSucceeded], a ret -.Jumptable: ; cc72 +.Jumptable: dw .TryTeleport dw .DoTeleport dw .FailTeleport -.TryTeleport: ; cc78 +.TryTeleport: call GetMapEnvironment call CheckOutdoorMap jr z, .CheckIfSpawnPoint @@ -925,30 +923,30 @@ TeleportFunction: ; cc61 ld a, $2 ret -.DoTeleport: ; cc9c +.DoTeleport: call GetPartyNick ld hl, .TeleportScript call QueueScript ld a, $81 ret -.FailTeleport: ; cca8 +.FailTeleport: ld hl, .Text_CantUseHere call MenuTextBoxBackup ld a, $80 ret -.Text_ReturnToLastMonCenter: ; 0xccb1 +.Text_ReturnToLastMonCenter: ; Return to the last #MON CENTER. text_jump UnknownText_0x1c071a db "@" -.Text_CantUseHere: ; 0xccb6 +.Text_CantUseHere: ; Can't use that here. text_jump UnknownText_0x1c073b db "@" -.TeleportScript: ; 0xccbb +.TeleportScript: reloadmappart special UpdateTimePals writetext .Text_ReturnToLastMonCenter @@ -965,21 +963,21 @@ TeleportFunction: ; cc61 applymovement PLAYER, .TeleportTo end -.TeleportFrom: ; cce1 +.TeleportFrom: teleport_from step_end -.TeleportTo: ; cce3 +.TeleportTo: teleport_to step_end -StrengthFunction: ; cce5 +StrengthFunction: call .TryStrength and $7f ld [wFieldMoveSucceeded], a ret -.TryStrength: ; ccee +.TryStrength: ; Strength ld de, ENGINE_PLAINBADGE call CheckBadge @@ -992,21 +990,21 @@ StrengthFunction: ; cce5 ld a, $80 ret -.JumpText: ; 0xcd01 +.JumpText: text_jump UnknownText_0x1c0751 db "@" -.Failed: ; cd06 +.Failed: ld a, $80 ret -.UseStrength: ; cd09 +.UseStrength: ld hl, Script_StrengthFromMenu call QueueScript ld a, $81 ret -SetStrengthFlag: ; cd12 +SetStrengthFlag: ld hl, wBikeFlags set BIKEFLAGS_STRENGTH_ACTIVE_F, [hl] ld a, [wCurPartyMon] @@ -1019,11 +1017,11 @@ SetStrengthFlag: ; cd12 call GetPartyNick ret -Script_StrengthFromMenu: ; 0xcd29 +Script_StrengthFromMenu: reloadmappart special UpdateTimePals -Script_UsedStrength: ; 0xcd2d +Script_UsedStrength: callasm SetStrengthFlag writetext .UsedStrength copybytetovar wBuffer6 @@ -1033,11 +1031,11 @@ Script_UsedStrength: ; 0xcd2d closetext end -.UsedStrength: ; 0xcd41 +.UsedStrength: text_jump UnknownText_0x1c0774 db "@" -.StrengthAllowedItToMoveBoulders: ; 0xcd46 +.StrengthAllowedItToMoveBoulders: text_jump UnknownText_0x1c0788 db "@" @@ -1047,13 +1045,13 @@ AskStrengthScript: ifequal $1, .DontMeetRequirements jump .AlreadyUsedStrength -.DontMeetRequirements: ; 0xcd59 +.DontMeetRequirements: jumptext UnknownText_0xcd73 -.AlreadyUsedStrength: ; 0xcd5c +.AlreadyUsedStrength: jumptext UnknownText_0xcd6e -.AskStrength: ; 0xcd5f +.AskStrength: opentext writetext UnknownText_0xcd69 yesorno @@ -1061,22 +1059,22 @@ AskStrengthScript: closetext end -UnknownText_0xcd69: ; 0xcd69 +UnknownText_0xcd69: ; A #MON may be able to move this. Want to use STRENGTH? text_jump UnknownText_0x1c07a0 db "@" -UnknownText_0xcd6e: ; 0xcd6e +UnknownText_0xcd6e: ; Boulders may now be moved! text_jump UnknownText_0x1c07d8 db "@" -UnknownText_0xcd73: ; 0xcd73 +UnknownText_0xcd73: ; A #MON may be able to move this. text_jump UnknownText_0x1c07f4 db "@" -TryStrengthOW: ; cd78 +TryStrengthOW: ld d, STRENGTH call CheckPartyMove jr c, .nope @@ -1104,7 +1102,7 @@ TryStrengthOW: ; cd78 ld [wScriptVar], a ret -WhirlpoolFunction: ; cd9d +WhirlpoolFunction: call FieldMoveJumptableReset .loop ld hl, Jumptable_cdae @@ -1114,12 +1112,12 @@ WhirlpoolFunction: ; cd9d ld [wFieldMoveSucceeded], a ret -Jumptable_cdae: ; cdae +Jumptable_cdae: dw .TryWhirlpool dw .DoWhirlpool dw .FailWhirlpool -.TryWhirlpool: ; cdb4 +.TryWhirlpool: ld de, ENGINE_GLACIERBADGE call CheckBadge jr c, .noglacierbadge @@ -1136,23 +1134,23 @@ Jumptable_cdae: ; cdae ld a, $80 ret -.DoWhirlpool: ; cdca +.DoWhirlpool: ld hl, Script_WhirlpoolFromMenu call QueueScript ld a, $81 ret -.FailWhirlpool: ; cdd3 +.FailWhirlpool: call FieldMoveFailed ld a, $80 ret -Text_UsedWhirlpool: ; 0xcdd9 +Text_UsedWhirlpool: ; used WHIRLPOOL! text_jump UnknownText_0x1c0816 db "@" -TryWhirlpoolMenu: ; cdde +TryWhirlpoolMenu: call GetFacingTileCoord ld c, a push de @@ -1181,11 +1179,11 @@ TryWhirlpoolMenu: ; cdde scf ret -Script_WhirlpoolFromMenu: ; 0xce0b +Script_WhirlpoolFromMenu: reloadmappart special UpdateTimePals -Script_UsedWhirlpool: ; 0xce0f +Script_UsedWhirlpool: callasm GetPartyNick writetext Text_UsedWhirlpool reloadmappart @@ -1193,7 +1191,7 @@ Script_UsedWhirlpool: ; 0xce0f closetext end -DisappearWhirlpool: ; ce1d +DisappearWhirlpool: ld hl, wBuffer3 ld a, [hli] ld h, [hl] @@ -1210,7 +1208,7 @@ DisappearWhirlpool: ; ce1d call GetMovementPermissions ret -TryWhirlpoolOW:: ; ce3e +TryWhirlpoolOW:: ld d, WHIRLPOOL call CheckPartyMove jr c, .failed @@ -1232,14 +1230,14 @@ TryWhirlpoolOW:: ; ce3e scf ret -Script_MightyWhirlpool: ; 0xce66 +Script_MightyWhirlpool: jumptext .MightyWhirlpoolText -.MightyWhirlpoolText: ; 0xce69 +.MightyWhirlpoolText: text_jump UnknownText_0x1c082b db "@" -Script_AskWhirlpoolOW: ; 0xce6e +Script_AskWhirlpoolOW: opentext writetext UnknownText_0xce78 yesorno @@ -1247,17 +1245,17 @@ Script_AskWhirlpoolOW: ; 0xce6e closetext end -UnknownText_0xce78: ; 0xce78 +UnknownText_0xce78: text_jump UnknownText_0x1c0864 db "@" -HeadbuttFunction: ; ce7d +HeadbuttFunction: call TryHeadbuttFromMenu and $7f ld [wFieldMoveSucceeded], a ret -TryHeadbuttFromMenu: ; ce86 +TryHeadbuttFromMenu: call GetFacingTileCoord call CheckHeadbuttTreeTile jr nz, .no_tree @@ -1272,21 +1270,21 @@ TryHeadbuttFromMenu: ; ce86 ld a, $80 ret -UnknownText_0xce9d: ; 0xce9d +UnknownText_0xce9d: ; did a HEADBUTT! text_jump UnknownText_0x1c0897 db "@" -UnknownText_0xcea2: ; 0xcea2 +UnknownText_0xcea2: ; Nope. Nothing… text_jump UnknownText_0x1c08ac db "@" -HeadbuttFromMenuScript: ; 0xcea7 +HeadbuttFromMenuScript: reloadmappart special UpdateTimePals -HeadbuttScript: ; 0xceab +HeadbuttScript: callasm GetPartyNick writetext UnknownText_0xce9d @@ -1307,7 +1305,7 @@ HeadbuttScript: ; 0xceab closetext end -TryHeadbuttOW:: ; cec9 +TryHeadbuttOW:: ld d, HEADBUTT call CheckPartyMove jr c, .no @@ -1322,7 +1320,7 @@ TryHeadbuttOW:: ; cec9 xor a ret -AskHeadbuttScript: ; 0xcedc +AskHeadbuttScript: opentext writetext UnknownText_0xcee6 yesorno @@ -1330,18 +1328,18 @@ AskHeadbuttScript: ; 0xcedc closetext end -UnknownText_0xcee6: ; 0xcee6 +UnknownText_0xcee6: ; A #MON could be in this tree. Want to HEADBUTT it? text_jump UnknownText_0x1c08bc db "@" -RockSmashFunction: ; ceeb +RockSmashFunction: call TryRockSmashFromMenu and $7f ld [wFieldMoveSucceeded], a ret -TryRockSmashFromMenu: ; cef4 +TryRockSmashFromMenu: call GetFacingObject jr c, .no_rock ld a, d @@ -1358,7 +1356,7 @@ TryRockSmashFromMenu: ; cef4 ld a, $80 ret -GetFacingObject: ; cf0d +GetFacingObject: farcall CheckFacingObject jr nc, .fail @@ -1380,11 +1378,11 @@ GetFacingObject: ; cf0d scf ret -RockSmashFromMenuScript: ; 0xcf2e +RockSmashFromMenuScript: reloadmappart special UpdateTimePals -RockSmashScript: ; cf32 +RockSmashScript: callasm GetPartyNick writetext UnknownText_0xcf58 closetext @@ -1403,15 +1401,15 @@ RockSmashScript: ; cf32 .done end -MovementData_0xcf55: ; 0xcf55 +MovementData_0xcf55: rock_smash 10 step_end -UnknownText_0xcf58: ; 0xcf58 +UnknownText_0xcf58: text_jump UnknownText_0x1c08f0 db "@" -AskRockSmashScript: ; 0xcf5d +AskRockSmashScript: callasm HasRockSmash ifequal 1, .no @@ -1424,17 +1422,17 @@ AskRockSmashScript: ; 0xcf5d .no jumptext UnknownText_0xcf72 -UnknownText_0xcf72: ; 0xcf72 +UnknownText_0xcf72: ; Maybe a #MON can break this. text_jump UnknownText_0x1c0906 db "@" -UnknownText_0xcf77: ; 0xcf77 +UnknownText_0xcf77: ; This rock looks breakable. Want to use ROCK SMASH? text_jump UnknownText_0x1c0924 db "@" -HasRockSmash: ; cf7c +HasRockSmash: ld d, ROCK_SMASH call CheckPartyMove jr nc, .yes @@ -1448,7 +1446,7 @@ HasRockSmash: ; cf7c ld [wScriptVar], a ret -FishFunction: ; cf8e +FishFunction: ld a, e push af call FieldMoveJumptableReset @@ -1462,14 +1460,14 @@ FishFunction: ; cf8e ld [wFieldMoveSucceeded], a ret -.FishTable: ; cfa5 +.FishTable: dw .TryFish dw .FishNoBite dw .FishGotSomething dw .FailFish dw .FishNoFish -.TryFish: ; cfaf +.TryFish: ld a, [wPlayerState] cp PLAYER_SURF jr z, .fail @@ -1510,11 +1508,11 @@ FishFunction: ; cf8e ld a, $1 ret -.FailFish: ; cff1 +.FailFish: ld a, $80 ret -.FishGotSomething: ; cff4 +.FishGotSomething: ld a, $1 ld [wBuffer6], a ld hl, Script_GotABite @@ -1522,7 +1520,7 @@ FishFunction: ; cf8e ld a, $81 ret -.FishNoBite: ; d002 +.FishNoBite: ld a, $2 ld [wBuffer6], a ld hl, Script_NotEvenANibble @@ -1530,7 +1528,7 @@ FishFunction: ; cf8e ld a, $81 ret -.FishNoFish: ; d010 +.FishNoFish: ld a, $0 ld [wBuffer6], a ld hl, Script_NotEvenANibble2 @@ -1538,32 +1536,32 @@ FishFunction: ; cf8e ld a, $81 ret -Script_NotEvenANibble: ; 0xd01e +Script_NotEvenANibble: scall Script_FishCastRod writetext UnknownText_0xd0a9 jump Script_NotEvenANibble_FallThrough -Script_NotEvenANibble2: ; 0xd027 +Script_NotEvenANibble2: scall Script_FishCastRod writetext UnknownText_0xd0a9 -Script_NotEvenANibble_FallThrough: ; 0xd02d +Script_NotEvenANibble_FallThrough: loademote EMOTE_SHADOW callasm PutTheRodAway closetext end -Script_GotABite: ; 0xd035 +Script_GotABite: scall Script_FishCastRod callasm Fishing_CheckFacingUp iffalse .NotFacingUp applymovement PLAYER, .Movement_FacingUp jump .FightTheHookedPokemon -.NotFacingUp: ; 0xd046 +.NotFacingUp: applymovement PLAYER, .Movement_NotFacingUp -.FightTheHookedPokemon: ; 0xd04a +.FightTheHookedPokemon: pause 40 applymovement PLAYER, .Movement_RestoreRod writetext UnknownText_0xd0a4 @@ -1574,7 +1572,7 @@ Script_GotABite: ; 0xd035 reloadmapafterbattle end -.Movement_NotFacingUp: ; d05c +.Movement_NotFacingUp: fish_got_bite fish_got_bite fish_got_bite @@ -1582,7 +1580,7 @@ Script_GotABite: ; 0xd035 show_emote step_end -.Movement_FacingUp: ; d062 +.Movement_FacingUp: fish_got_bite fish_got_bite fish_got_bite @@ -1591,12 +1589,12 @@ Script_GotABite: ; 0xd035 show_emote step_end -.Movement_RestoreRod: ; d069 +.Movement_RestoreRod: hide_emote fish_cast_rod step_end -Fishing_CheckFacingUp: ; d06c +Fishing_CheckFacingUp: ld a, [wPlayerDirection] and $c cp OW_UP @@ -1608,7 +1606,7 @@ Fishing_CheckFacingUp: ; d06c ld [wScriptVar], a ret -Script_FishCastRod: ; 0xd07c +Script_FishCastRod: reloadmappart loadvar hBGMapMode, $0 special UpdateTimePals @@ -1619,11 +1617,11 @@ Script_FishCastRod: ; 0xd07c pause 40 end -MovementData_0xd093: ; d093 +MovementData_0xd093: fish_cast_rod step_end -PutTheRodAway: ; d095 +PutTheRodAway: xor a ld [hBGMapMode], a ld a, $1 @@ -1632,12 +1630,12 @@ PutTheRodAway: ; d095 call ReplaceKrisSprite ret -UnknownText_0xd0a4: ; 0xd0a4 +UnknownText_0xd0a4: ; Oh! A bite! text_jump UnknownText_0x1c0958 db "@" -UnknownText_0xd0a9: ; 0xd0a9 +UnknownText_0xd0a9: ; Not even a nibble! text_jump UnknownText_0x1c0965 db "@" @@ -1647,13 +1645,13 @@ UnknownText_0xd0ae: ; unused text_jump UnknownText_0x1c0979 db "@" -BikeFunction: ; d0b3 +BikeFunction: call .TryBike and $7f ld [wFieldMoveSucceeded], a ret -.TryBike: ; d0bc +.TryBike: call .CheckEnvironment jr c, .CannotUseBike ld a, [wPlayerState] @@ -1704,7 +1702,7 @@ BikeFunction: ; d0b3 ld a, $1 ret -.CheckIfRegistered: ; d119 +.CheckIfRegistered: ld a, [wUsingItemWithSelect] and a ret z @@ -1712,7 +1710,7 @@ BikeFunction: ; d0b3 ld l, e ret -.CheckEnvironment: ; d121 +.CheckEnvironment: call GetMapEnvironment call CheckOutdoorMap jr z, .ok @@ -1733,7 +1731,7 @@ BikeFunction: ; d0b3 scf ret -Script_GetOnBike: ; 0xd13e +Script_GetOnBike: reloadmappart special UpdateTimePals writecode VAR_MOVEMENT, PLAYER_BIKE @@ -1743,7 +1741,7 @@ Script_GetOnBike: ; 0xd13e special ReplaceKrisSprite end -Script_GetOnBike_Register: ; 0xd14e +Script_GetOnBike_Register: writecode VAR_MOVEMENT, PLAYER_BIKE closetext special ReplaceKrisSprite @@ -1753,7 +1751,7 @@ Script_GetOnBike_Register: ; 0xd14e nop ret -Script_GetOffBike: ; 0xd158 +Script_GetOffBike: reloadmappart special UpdateTimePals writecode VAR_MOVEMENT, PLAYER_NORMAL @@ -1766,32 +1764,32 @@ FinishGettingOffBike: special PlayMapMusic end -Script_GetOffBike_Register: ; 0xd16b +Script_GetOffBike_Register: writecode VAR_MOVEMENT, PLAYER_NORMAL jump FinishGettingOffBike -Script_CantGetOffBike: ; 0xd171 +Script_CantGetOffBike: writetext .CantGetOffBikeText waitbutton closetext end -.CantGetOffBikeText: ; 0xd177 +.CantGetOffBikeText: ; You can't get off here! text_jump UnknownText_0x1c099a db "@" -GotOnTheBikeText: ; 0xd17c +GotOnTheBikeText: ; got on the @ . text_jump UnknownText_0x1c09b2 db "@" -GotOffTheBikeText: ; 0xd181 +GotOffTheBikeText: ; got off the @ . text_jump UnknownText_0x1c09c7 db "@" -TryCutOW:: ; d186 +TryCutOW:: ld d, CUT call CheckPartyMove jr c, .cant_cut @@ -1813,7 +1811,7 @@ TryCutOW:: ; d186 scf ret -AskCutScript: ; 0xd1a9 +AskCutScript: opentext writetext UnknownText_0xd1c8 yesorno @@ -1824,7 +1822,7 @@ AskCutScript: ; 0xd1a9 closetext end -.CheckMap: ; d1ba +.CheckMap: xor a ld [wScriptVar], a call CheckMapForSomethingToCut @@ -1833,13 +1831,13 @@ AskCutScript: ; 0xd1a9 ld [wScriptVar], a ret -UnknownText_0xd1c8: ; 0xd1c8 +UnknownText_0xd1c8: text_jump UnknownText_0x1c09dd db "@" -CantCutScript: ; 0xd1cd +CantCutScript: jumptext UnknownText_0xd1d0 -UnknownText_0xd1d0: ; 0xd1d0 +UnknownText_0xd1d0: text_jump UnknownText_0x1c0a05 db "@" |