diff options
Diffstat (limited to 'event/overworld.asm')
-rwxr-xr-x | event/overworld.asm | 114 |
1 files changed, 35 insertions, 79 deletions
diff --git a/event/overworld.asm b/event/overworld.asm index 156ef389f..370162fa9 100755 --- a/event/overworld.asm +++ b/event/overworld.asm @@ -37,7 +37,7 @@ CheckEngineFlag: ; c721 ; Check engine flag de ; Return carry if flag is not set ld b, CHECK_FLAG - callba EngineFlagAction + farcall EngineFlagAction ld a, c and a jr nz, .isset @@ -77,9 +77,9 @@ CheckPartyMove: ; c742 ld a, [hl] and a jr z, .no - cp a, -1 + cp -1 jr z, .no - cp a, EGG + cp EGG jr z, .next ld bc, PARTYMON_STRUCT_LENGTH @@ -177,7 +177,7 @@ CheckMapForSomethingToCut: ; c7ce call GetFacingTileCoord ld c, a push de - callba CheckCutCollision + farcall CheckCutCollision pop de jr nc, .fail ; Get the location of the current block in OverworldMap. @@ -233,7 +233,7 @@ CutDownTreeOrGrass: ; c810 call DelayFrame ld a, [Buffer6] ; Animation type ld e, a - callba OWCutAnimation + farcall OWCutAnimation call BufferScreen call GetMovementPermissions call UpdateSprites @@ -277,53 +277,9 @@ CheckOverworldTileArrays: ; c840 xor a ret -CutTreeBlockPointers: ; c862 -; Which tileset are we in? - dbw TILESET_JOHTO_1, .johto1 - dbw TILESET_JOHTO_2, .johto2 - dbw TILESET_KANTO, .kanto - dbw TILESET_PARK, .park - dbw TILESET_ILEX_FOREST, .ilex - db -1 - -.johto1 ; Johto OW -; Which meta tile are we facing, which should we replace it with, and which animation? - db $03, $02, $01 ; grass - db $5b, $3c, $00 ; tree - db $5f, $3d, $00 ; tree - db $63, $3f, $00 ; tree - db $67, $3e, $00 ; tree - db -1 - -.johto2 ; Goldenrod area - db $03, $02, $01 ; grass - db -1 - -.kanto ; Kanto OW - db $0b, $0a, $01 ; grass - db $32, $6d, $00 ; tree - db $33, $6c, $00 ; tree - db $34, $6f, $00 ; tree - db $35, $4c, $00 ; tree - db $60, $6e, $00 ; tree - db -1 - -.park ; National Park - db $13, $03, $01 ; grass - db $03, $04, $01 ; grass - db -1 - -.ilex ; Ilex Forest - db $0f, $17, $00 - db -1 - -WhirlpoolBlockPointers: ; c8a4 - dbw TILESET_JOHTO_1, .johto - db -1 - -.johto ; c8a8 - db $07, $36, $00 - db -1 + +INCLUDE "data/field_move_blocks.asm" + OWFlash: ; c8ac call .CheckUseFlash @@ -334,10 +290,10 @@ OWFlash: ; c8ac .CheckUseFlash: ; c8b5 ; Flash ld de, ENGINE_ZEPHYRBADGE - callba CheckBadge + farcall CheckBadge jr c, .nozephyrbadge push hl - callba SpecialAerodactylChamber + farcall SpecialAerodactylChamber pop hl jr c, .useflash ld a, [wTimeOfDayPalset] @@ -416,7 +372,7 @@ SurfFunction: ; c909 jr nz, .cannotsurf call CheckDirection jr c, .cannotsurf - callba CheckFacingObject + farcall CheckFacingObject jr c, .cannotsurf ld a, $1 ret @@ -432,7 +388,7 @@ SurfFunction: ; c909 .DoSurf: ; c95f (3:495f) call GetSurfType - ld [Buffer2], a ; wd1eb (aliases: MovementType) + ld [Buffer2], a call GetPartyNick ld hl, SurfFromMenuScript call QueueScript @@ -472,7 +428,7 @@ UsedSurfScript: ; c986 end .empty_fn ; c9a2 - callba TrainerRankings_Surf + farcall TrainerRankings_Surf ret UsedSurfText: ; c9a9 @@ -510,7 +466,7 @@ CheckDirection: ; c9cb ; Get player direction ld a, [PlayerDirection] - and a, %00001100 ; bits 2 and 3 contain direction + and %00001100 ; bits 2 and 3 contain direction rrca rrca ld e, a @@ -569,7 +525,7 @@ TrySurfOW:: ; c9e7 jr nz, .quit call GetSurfType - ld [MovementType], a + ld [Buffer2], a call GetPartyNick ld a, BANK(AskSurfScript) @@ -615,7 +571,7 @@ FlyFunction: ; ca3b ld de, ENGINE_STORMBADGE call CheckBadge jr c, .nostormbadge - call GetMapPermission + call GetMapEnvironment call CheckOutdoorMap jr z, .outdoors jr .indoors @@ -625,14 +581,14 @@ FlyFunction: ; ca3b ld [hMapAnims], a call LoadStandardMenuDataHeader call ClearSprites - callba _FlyMap + farcall _FlyMap ld a, e cp -1 jr z, .illegal cp NUM_SPAWNS jr nc, .illegal - ld [wd001], a + ld [DefaultSpawnpoint], a call CloseWindow ld a, $1 ret @@ -678,10 +634,10 @@ FlyFunction: ; ca3b end .ReturnFromFly: ; cacb - callba Function561d + farcall Function561d call DelayFrame call ReplaceKrisSprite - callba LoadOverworldFont + farcall LoadOverworldFont ret WaterfallFunction: ; cade @@ -693,7 +649,7 @@ WaterfallFunction: ; cade .TryWaterfall: ; cae7 ; Waterfall ld de, ENGINE_RISINGBADGE - callba CheckBadge + farcall CheckBadge ld a, $80 ret c call CheckMapCanWaterfall @@ -745,7 +701,7 @@ Script_UsedWaterfall: ; 0xcb20 ld a, [PlayerStandingTile] call CheckWaterfallTile ret z - callba TrainerRankings_Waterfall + farcall TrainerRankings_Waterfall ld a, $1 ld [ScriptVar], a ret @@ -827,7 +783,7 @@ dig_incave dw .FailDig .CheckCanDig: ; cbb8 - call GetMapPermission + call GetMapEnvironment cp CAVE jr z, .incave cp DUNGEON @@ -837,7 +793,7 @@ dig_incave ret .incave - ld hl, wDigWarp + ld hl, wDigWarpNumber ld a, [hli] and a jr z, .fail @@ -851,7 +807,7 @@ dig_incave ret .DoDig: ; cbd8 - ld hl, wDigWarp + ld hl, wDigWarpNumber ld de, wNextWarp ld bc, 3 call CopyBytes @@ -865,7 +821,7 @@ dig_incave ret .escaperope - callba SpecialKabutoChamber + farcall SpecialKabutoChamber ld hl, .UsedEscapeRopeScript call QueueScript ld a, $81 @@ -925,11 +881,11 @@ dig_incave .DigOut: ; 0xcc59 step_dig 32 - hide_person + hide_object step_end .DigReturn: ; 0xcc5d - show_person + show_object return_dig 32 step_end @@ -949,7 +905,7 @@ TeleportFunction: ; cc61 dw .FailTeleport .TryTeleport: ; cc78 - call GetMapPermission + call GetMapEnvironment call CheckOutdoorMap jr z, .CheckIfSpawnPoint jr .nope @@ -959,10 +915,10 @@ TeleportFunction: ; cc61 ld d, a ld a, [wLastSpawnMapNumber] ld e, a - callba IsSpawnPoint + farcall IsSpawnPoint jr nc, .nope ld a, c - ld [wd001], a + ld [DefaultSpawnpoint], a ld a, $1 ret @@ -1250,7 +1206,7 @@ DisappearWhirlpool: ; ce1d call OverworldTextModeSwitch ld a, [Buffer6] ld e, a - callba PlayWhirlpoolSound + farcall PlayWhirlpoolSound call BufferScreen call GetMovementPermissions ret @@ -1404,7 +1360,7 @@ TryRockSmashFromMenu: ; cef4 ret GetFacingObject: ; cf0d - callba CheckFacingObject + farcall CheckFacingObject jr nc, .fail ld a, [hObjectStructIndexBuffer] @@ -1539,7 +1495,7 @@ FishFunction: ; cf8e ld d, a ld a, [Buffer2] ld e, a - callba Fish + farcall Fish ld a, d and a jr z, .nonibble @@ -1758,7 +1714,7 @@ BikeFunction: ; d0b3 ret .CheckEnvironment: ; d121 - call GetMapPermission + call GetMapEnvironment call CheckOutdoorMap jr z, .ok cp CAVE |