From 88bbdb6a2ff59b1e00e1ad1020be49f72ccf23da Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 13 Feb 2020 19:01:47 -0500 Subject: [PATCH] Define TileCollisionTable as a standard 'db' series --- constants/collision_constants.asm | 8 +- data/collision_permissions.asm | 515 +++++++++++++-------------- engine/events/overworld.asm | 10 +- engine/overworld/npc_movement.asm | 8 +- engine/overworld/player_movement.asm | 6 +- home/map_objects.asm | 2 +- 6 files changed, 273 insertions(+), 276 deletions(-) diff --git a/constants/collision_constants.asm b/constants/collision_constants.asm index f9724da60..a03f4a0bb 100644 --- a/constants/collision_constants.asm +++ b/constants/collision_constants.asm @@ -1,8 +1,8 @@ ; collision permissions (see data/collision_permissions.asm) -LANDTILE EQU $00 -WATERTILE EQU $01 -WALLTILE EQU $0f -TALK EQU $10 +LAND_TILE EQU $00 +WATER_TILE EQU $01 +WALL_TILE EQU $0f +TALK EQU $10 ; collision data types (see data/tilesets/*_collision.asm) ; TileCollisionTable indexes (see data/collision_permissions.asm) diff --git a/data/collision_permissions.asm b/data/collision_permissions.asm index 82ebb770a..57172ca51 100644 --- a/data/collision_permissions.asm +++ b/data/collision_permissions.asm @@ -1,261 +1,258 @@ -NONTALKABLE EQUS "db" -TALKABLE EQUS "db TALK +" - TileCollisionTable:: ; entries correspond to COLL_* constants - NONTALKABLE LANDTILE ; COLL_FLOOR - NONTALKABLE LANDTILE ; COLL_01 - NONTALKABLE LANDTILE ; 02 - NONTALKABLE LANDTILE ; COLL_03 - NONTALKABLE LANDTILE ; COLL_04 - NONTALKABLE LANDTILE ; 05 - NONTALKABLE LANDTILE ; 06 - NONTALKABLE WALLTILE ; COLL_WALL - NONTALKABLE LANDTILE ; COLL_CUT_08 - NONTALKABLE LANDTILE ; 09 - NONTALKABLE LANDTILE ; 0a - NONTALKABLE LANDTILE ; 0b - NONTALKABLE LANDTILE ; 0c - NONTALKABLE LANDTILE ; 0d - NONTALKABLE LANDTILE ; 0e - NONTALKABLE WALLTILE ; 0f - NONTALKABLE LANDTILE ; COLL_TALL_GRASS_10 - NONTALKABLE LANDTILE ; 11 - TALKABLE WALLTILE ; COLL_CUT_TREE - NONTALKABLE LANDTILE ; 13 - NONTALKABLE LANDTILE ; COLL_LONG_GRASS - TALKABLE WALLTILE ; COLL_HEADBUTT_TREE - NONTALKABLE LANDTILE ; 16 - NONTALKABLE LANDTILE ; 17 - NONTALKABLE LANDTILE ; COLL_TALL_GRASS - NONTALKABLE LANDTILE ; 19 - TALKABLE WALLTILE ; COLL_CUT_TREE_1A - NONTALKABLE LANDTILE ; 1b - NONTALKABLE LANDTILE ; COLL_LONG_GRASS_1C - TALKABLE WALLTILE ; COLL_HEADBUTT_TREE_1D - NONTALKABLE LANDTILE ; 1e - NONTALKABLE LANDTILE ; 1f - NONTALKABLE WATERTILE ; 20 - NONTALKABLE WATERTILE ; COLL_WATER_21 - TALKABLE WATERTILE ; 22 - NONTALKABLE LANDTILE ; COLL_ICE - TALKABLE WATERTILE ; COLL_WHIRLPOOL - NONTALKABLE WATERTILE ; 25 - NONTALKABLE WATERTILE ; 26 - NONTALKABLE WALLTILE ; COLL_BUOY - NONTALKABLE WATERTILE ; COLL_CUT_28 - NONTALKABLE WATERTILE ; COLL_WATER - TALKABLE WATERTILE ; 2a - NONTALKABLE LANDTILE ; COLL_ICE_2B - TALKABLE WATERTILE ; COLL_WHIRLPOOL_2C - NONTALKABLE WATERTILE ; 2d - NONTALKABLE WATERTILE ; 2e - NONTALKABLE WALLTILE ; 2f - NONTALKABLE WATERTILE ; COLL_WATERFALL_RIGHT - NONTALKABLE WATERTILE ; COLL_WATERFALL_LEFT - NONTALKABLE WATERTILE ; COLL_WATERFALL_UP - NONTALKABLE WATERTILE ; COLL_WATERFALL - NONTALKABLE WATERTILE ; 34 - NONTALKABLE WATERTILE ; 35 - NONTALKABLE WATERTILE ; 36 - NONTALKABLE WATERTILE ; 37 - NONTALKABLE WATERTILE ; COLL_CURRENT_RIGHT - NONTALKABLE WATERTILE ; COLL_CURRENT_LEFT - NONTALKABLE WATERTILE ; COLL_CURRENT_UP - NONTALKABLE WATERTILE ; COLL_CURRENT_DOWN - NONTALKABLE WATERTILE ; 3c - NONTALKABLE WATERTILE ; 3d - NONTALKABLE WATERTILE ; 3e - NONTALKABLE WATERTILE ; 3f - NONTALKABLE LANDTILE ; COLL_BRAKE - NONTALKABLE LANDTILE ; COLL_WALK_RIGHT - NONTALKABLE LANDTILE ; COLL_WALK_LEFT - NONTALKABLE LANDTILE ; COLL_WALK_UP - NONTALKABLE LANDTILE ; COLL_WALK_DOWN - NONTALKABLE LANDTILE ; COLL_BRAKE_45 - NONTALKABLE LANDTILE ; COLL_BRAKE_46 - NONTALKABLE LANDTILE ; COLL_BRAKE_47 - NONTALKABLE LANDTILE ; COLL_GRASS_48 - NONTALKABLE LANDTILE ; COLL_GRASS_49 - NONTALKABLE LANDTILE ; COLL_GRASS_4A - NONTALKABLE LANDTILE ; COLL_GRASS_4B - NONTALKABLE LANDTILE ; COLL_GRASS_4C - NONTALKABLE LANDTILE ; 4d - NONTALKABLE LANDTILE ; 4e - NONTALKABLE LANDTILE ; 4f - NONTALKABLE LANDTILE ; COLL_WALK_RIGHT_ALT - NONTALKABLE LANDTILE ; COLL_WALK_LEFT_ALT - NONTALKABLE LANDTILE ; COLL_WALK_UP_ALT - NONTALKABLE LANDTILE ; COLL_WALK_DOWN_ALT - NONTALKABLE LANDTILE ; COLL_BRAKE_ALT - NONTALKABLE LANDTILE ; COLL_BRAKE_55 - NONTALKABLE LANDTILE ; COLL_BRAKE_56 - NONTALKABLE LANDTILE ; COLL_BRAKE_57 - NONTALKABLE LANDTILE ; 58 - NONTALKABLE LANDTILE ; 59 - NONTALKABLE LANDTILE ; 5a - NONTALKABLE LANDTILE ; COLL_5B - NONTALKABLE LANDTILE ; 5c - NONTALKABLE LANDTILE ; 5d - NONTALKABLE LANDTILE ; 5e - NONTALKABLE LANDTILE ; 5f - NONTALKABLE LANDTILE ; COLL_PIT - NONTALKABLE LANDTILE ; COLL_VIRTUAL_BOY - NONTALKABLE WALLTILE ; 62 - NONTALKABLE LANDTILE ; 63 - NONTALKABLE LANDTILE ; COLL_64 - NONTALKABLE LANDTILE ; COLL_65 - NONTALKABLE LANDTILE ; 66 - NONTALKABLE LANDTILE ; 67 - NONTALKABLE LANDTILE ; COLL_PIT_68 - NONTALKABLE LANDTILE ; 69 - NONTALKABLE WALLTILE ; 6a - NONTALKABLE LANDTILE ; 6b - NONTALKABLE LANDTILE ; 6c - NONTALKABLE LANDTILE ; 6d - NONTALKABLE LANDTILE ; 6e - NONTALKABLE LANDTILE ; 6f - NONTALKABLE LANDTILE ; COLL_WARP_CARPET_DOWN - NONTALKABLE LANDTILE ; COLL_DOOR - NONTALKABLE LANDTILE ; COLL_LADDER - NONTALKABLE LANDTILE ; COLL_STAIRCASE_73 - NONTALKABLE LANDTILE ; COLL_CAVE_74 - NONTALKABLE LANDTILE ; COLL_DOOR_75 - NONTALKABLE LANDTILE ; COLL_WARP_CARPET_LEFT - NONTALKABLE LANDTILE ; COLL_WARP_77 - NONTALKABLE LANDTILE ; COLL_WARP_CARPET_UP - NONTALKABLE LANDTILE ; COLL_DOOR_79 - NONTALKABLE LANDTILE ; COLL_STAIRCASE - NONTALKABLE LANDTILE ; COLL_CAVE - NONTALKABLE LANDTILE ; COLL_WARP_PANEL - NONTALKABLE LANDTILE ; COLL_DOOR_7D - NONTALKABLE LANDTILE ; COLL_WARP_CARPET_RIGHT - NONTALKABLE LANDTILE ; COLL_WARP_7F - NONTALKABLE WALLTILE ; 80 - NONTALKABLE WALLTILE ; 81 - NONTALKABLE WALLTILE ; 82 - NONTALKABLE WALLTILE ; 83 - NONTALKABLE WALLTILE ; 84 - NONTALKABLE LANDTILE ; 85 - NONTALKABLE LANDTILE ; 86 - NONTALKABLE LANDTILE ; 87 - NONTALKABLE WALLTILE ; 88 - NONTALKABLE WALLTILE ; 89 - NONTALKABLE WALLTILE ; 8a - NONTALKABLE WALLTILE ; 8b - NONTALKABLE WALLTILE ; 8c - NONTALKABLE LANDTILE ; 8d - NONTALKABLE LANDTILE ; 8e - NONTALKABLE LANDTILE ; 8f - NONTALKABLE WALLTILE ; COLL_COUNTER - NONTALKABLE WALLTILE ; COLL_BOOKSHELF - NONTALKABLE WALLTILE ; 92 - NONTALKABLE WALLTILE ; COLL_PC - NONTALKABLE WALLTILE ; COLL_RADIO - NONTALKABLE WALLTILE ; COLL_TOWN_MAP - NONTALKABLE WALLTILE ; COLL_MART_SHELF - NONTALKABLE WALLTILE ; COLL_TV - NONTALKABLE WALLTILE ; COLL_COUNTER_98 - NONTALKABLE WALLTILE ; 99 - NONTALKABLE WALLTILE ; 9a - NONTALKABLE WALLTILE ; 9b - NONTALKABLE WALLTILE ; COLL_9C - NONTALKABLE WALLTILE ; COLL_WINDOW - NONTALKABLE WALLTILE ; 9e - NONTALKABLE WALLTILE ; COLL_INCENSE_BURNER - NONTALKABLE LANDTILE ; COLL_HOP_RIGHT - NONTALKABLE LANDTILE ; COLL_HOP_LEFT - NONTALKABLE LANDTILE ; COLL_HOP_UP - NONTALKABLE LANDTILE ; COLL_HOP_DOWN - NONTALKABLE LANDTILE ; COLL_HOP_DOWN_RIGHT - NONTALKABLE LANDTILE ; COLL_HOP_DOWN_LEFT - NONTALKABLE LANDTILE ; COLL_HOP_UP_RIGHT - NONTALKABLE LANDTILE ; COLL_HOP_UP_LEFT - NONTALKABLE LANDTILE ; a8 - NONTALKABLE LANDTILE ; a9 - NONTALKABLE LANDTILE ; aa - NONTALKABLE LANDTILE ; ab - NONTALKABLE LANDTILE ; ac - NONTALKABLE LANDTILE ; ad - NONTALKABLE LANDTILE ; ae - NONTALKABLE LANDTILE ; af - NONTALKABLE LANDTILE ; COLL_RIGHT_WALL - NONTALKABLE LANDTILE ; COLL_LEFT_WALL - NONTALKABLE LANDTILE ; COLL_UP_WALL - NONTALKABLE LANDTILE ; COLL_DOWN_WALL - NONTALKABLE LANDTILE ; COLL_DOWN_RIGHT_WALL - NONTALKABLE LANDTILE ; COLL_DOWN_LEFT_WALL - NONTALKABLE LANDTILE ; COLL_UP_RIGHT_WALL - NONTALKABLE LANDTILE ; COLL_UP_LEFT_WALL - NONTALKABLE LANDTILE ; b8 - NONTALKABLE LANDTILE ; b9 - NONTALKABLE LANDTILE ; ba - NONTALKABLE LANDTILE ; bb - NONTALKABLE LANDTILE ; bc - NONTALKABLE LANDTILE ; bd - NONTALKABLE LANDTILE ; be - NONTALKABLE LANDTILE ; bf - NONTALKABLE WATERTILE ; COLL_RIGHT_BUOY - NONTALKABLE WATERTILE ; COLL_LEFT_BUOY - NONTALKABLE WATERTILE ; COLL_UP_BUOY - NONTALKABLE WATERTILE ; COLL_DOWN_BUOY - NONTALKABLE WATERTILE ; COLL_DOWN_RIGHT_BUOY - NONTALKABLE WATERTILE ; COLL_DOWN_LEFT_BUOY - NONTALKABLE WATERTILE ; COLL_UP_RIGHT_BUOY - NONTALKABLE WATERTILE ; COLL_UP_LEFT_BUOY - NONTALKABLE WATERTILE ; c8 - NONTALKABLE WATERTILE ; c9 - NONTALKABLE WATERTILE ; ca - NONTALKABLE WATERTILE ; cb - NONTALKABLE WATERTILE ; cc - NONTALKABLE WATERTILE ; cd - NONTALKABLE WATERTILE ; ce - NONTALKABLE WATERTILE ; cf - NONTALKABLE LANDTILE ; d0 - NONTALKABLE LANDTILE ; d1 - NONTALKABLE LANDTILE ; d2 - NONTALKABLE LANDTILE ; d3 - NONTALKABLE LANDTILE ; d4 - NONTALKABLE LANDTILE ; d5 - NONTALKABLE LANDTILE ; d6 - NONTALKABLE LANDTILE ; d7 - NONTALKABLE LANDTILE ; d8 - NONTALKABLE LANDTILE ; d9 - NONTALKABLE LANDTILE ; da - NONTALKABLE LANDTILE ; db - NONTALKABLE LANDTILE ; dc - NONTALKABLE LANDTILE ; dd - NONTALKABLE LANDTILE ; de - NONTALKABLE LANDTILE ; df - NONTALKABLE LANDTILE ; e0 - NONTALKABLE LANDTILE ; e1 - NONTALKABLE LANDTILE ; e2 - NONTALKABLE LANDTILE ; e3 - NONTALKABLE LANDTILE ; e4 - NONTALKABLE LANDTILE ; e5 - NONTALKABLE LANDTILE ; e6 - NONTALKABLE LANDTILE ; e7 - NONTALKABLE LANDTILE ; e8 - NONTALKABLE LANDTILE ; e9 - NONTALKABLE LANDTILE ; ea - NONTALKABLE LANDTILE ; eb - NONTALKABLE LANDTILE ; ec - NONTALKABLE LANDTILE ; ed - NONTALKABLE LANDTILE ; ee - NONTALKABLE LANDTILE ; ef - NONTALKABLE LANDTILE ; f0 - NONTALKABLE LANDTILE ; f1 - NONTALKABLE LANDTILE ; f2 - NONTALKABLE LANDTILE ; f3 - NONTALKABLE LANDTILE ; f4 - NONTALKABLE LANDTILE ; f5 - NONTALKABLE LANDTILE ; f6 - NONTALKABLE LANDTILE ; f7 - NONTALKABLE LANDTILE ; f8 - NONTALKABLE LANDTILE ; f9 - NONTALKABLE LANDTILE ; fa - NONTALKABLE LANDTILE ; fb - NONTALKABLE LANDTILE ; fc - NONTALKABLE LANDTILE ; fd - NONTALKABLE LANDTILE ; fe - NONTALKABLE WALLTILE ; COLL_FF + db LAND_TILE ; COLL_FLOOR + db LAND_TILE ; COLL_01 + db LAND_TILE ; 02 + db LAND_TILE ; COLL_03 + db LAND_TILE ; COLL_04 + db LAND_TILE ; 05 + db LAND_TILE ; 06 + db WALL_TILE ; COLL_WALL + db LAND_TILE ; COLL_CUT_08 + db LAND_TILE ; 09 + db LAND_TILE ; 0a + db LAND_TILE ; 0b + db LAND_TILE ; 0c + db LAND_TILE ; 0d + db LAND_TILE ; 0e + db WALL_TILE ; 0f + db LAND_TILE ; COLL_TALL_GRASS_10 + db LAND_TILE ; 11 + db WALL_TILE | TALK ; COLL_CUT_TREE + db LAND_TILE ; 13 + db LAND_TILE ; COLL_LONG_GRASS + db WALL_TILE | TALK ; COLL_HEADBUTT_TREE + db LAND_TILE ; 16 + db LAND_TILE ; 17 + db LAND_TILE ; COLL_TALL_GRASS + db LAND_TILE ; 19 + db WALL_TILE | TALK ; COLL_CUT_TREE_1A + db LAND_TILE ; 1b + db LAND_TILE ; COLL_LONG_GRASS_1C + db WALL_TILE | TALK ; COLL_HEADBUTT_TREE_1D + db LAND_TILE ; 1e + db LAND_TILE ; 1f + db WATER_TILE ; 20 + db WATER_TILE ; COLL_WATER_21 + db WATER_TILE | TALK ; 22 + db LAND_TILE ; COLL_ICE + db WATER_TILE | TALK ; COLL_WHIRLPOOL + db WATER_TILE ; 25 + db WATER_TILE ; 26 + db WALL_TILE ; COLL_BUOY + db WATER_TILE ; COLL_CUT_28 + db WATER_TILE ; COLL_WATER + db WATER_TILE | TALK ; 2a + db LAND_TILE ; COLL_ICE_2B + db WATER_TILE | TALK ; COLL_WHIRLPOOL_2C + db WATER_TILE ; 2d + db WATER_TILE ; 2e + db WALL_TILE ; 2f + db WATER_TILE ; COLL_WATERFALL_RIGHT + db WATER_TILE ; COLL_WATERFALL_LEFT + db WATER_TILE ; COLL_WATERFALL_UP + db WATER_TILE ; COLL_WATERFALL + db WATER_TILE ; 34 + db WATER_TILE ; 35 + db WATER_TILE ; 36 + db WATER_TILE ; 37 + db WATER_TILE ; COLL_CURRENT_RIGHT + db WATER_TILE ; COLL_CURRENT_LEFT + db WATER_TILE ; COLL_CURRENT_UP + db WATER_TILE ; COLL_CURRENT_DOWN + db WATER_TILE ; 3c + db WATER_TILE ; 3d + db WATER_TILE ; 3e + db WATER_TILE ; 3f + db LAND_TILE ; COLL_BRAKE + db LAND_TILE ; COLL_WALK_RIGHT + db LAND_TILE ; COLL_WALK_LEFT + db LAND_TILE ; COLL_WALK_UP + db LAND_TILE ; COLL_WALK_DOWN + db LAND_TILE ; COLL_BRAKE_45 + db LAND_TILE ; COLL_BRAKE_46 + db LAND_TILE ; COLL_BRAKE_47 + db LAND_TILE ; COLL_GRASS_48 + db LAND_TILE ; COLL_GRASS_49 + db LAND_TILE ; COLL_GRASS_4A + db LAND_TILE ; COLL_GRASS_4B + db LAND_TILE ; COLL_GRASS_4C + db LAND_TILE ; 4d + db LAND_TILE ; 4e + db LAND_TILE ; 4f + db LAND_TILE ; COLL_WALK_RIGHT_ALT + db LAND_TILE ; COLL_WALK_LEFT_ALT + db LAND_TILE ; COLL_WALK_UP_ALT + db LAND_TILE ; COLL_WALK_DOWN_ALT + db LAND_TILE ; COLL_BRAKE_ALT + db LAND_TILE ; COLL_BRAKE_55 + db LAND_TILE ; COLL_BRAKE_56 + db LAND_TILE ; COLL_BRAKE_57 + db LAND_TILE ; 58 + db LAND_TILE ; 59 + db LAND_TILE ; 5a + db LAND_TILE ; COLL_5B + db LAND_TILE ; 5c + db LAND_TILE ; 5d + db LAND_TILE ; 5e + db LAND_TILE ; 5f + db LAND_TILE ; COLL_PIT + db LAND_TILE ; COLL_VIRTUAL_BOY + db WALL_TILE ; 62 + db LAND_TILE ; 63 + db LAND_TILE ; COLL_64 + db LAND_TILE ; COLL_65 + db LAND_TILE ; 66 + db LAND_TILE ; 67 + db LAND_TILE ; COLL_PIT_68 + db LAND_TILE ; 69 + db WALL_TILE ; 6a + db LAND_TILE ; 6b + db LAND_TILE ; 6c + db LAND_TILE ; 6d + db LAND_TILE ; 6e + db LAND_TILE ; 6f + db LAND_TILE ; COLL_WARP_CARPET_DOWN + db LAND_TILE ; COLL_DOOR + db LAND_TILE ; COLL_LADDER + db LAND_TILE ; COLL_STAIRCASE_73 + db LAND_TILE ; COLL_CAVE_74 + db LAND_TILE ; COLL_DOOR_75 + db LAND_TILE ; COLL_WARP_CARPET_LEFT + db LAND_TILE ; COLL_WARP_77 + db LAND_TILE ; COLL_WARP_CARPET_UP + db LAND_TILE ; COLL_DOOR_79 + db LAND_TILE ; COLL_STAIRCASE + db LAND_TILE ; COLL_CAVE + db LAND_TILE ; COLL_WARP_PANEL + db LAND_TILE ; COLL_DOOR_7D + db LAND_TILE ; COLL_WARP_CARPET_RIGHT + db LAND_TILE ; COLL_WARP_7F + db WALL_TILE ; 80 + db WALL_TILE ; 81 + db WALL_TILE ; 82 + db WALL_TILE ; 83 + db WALL_TILE ; 84 + db LAND_TILE ; 85 + db LAND_TILE ; 86 + db LAND_TILE ; 87 + db WALL_TILE ; 88 + db WALL_TILE ; 89 + db WALL_TILE ; 8a + db WALL_TILE ; 8b + db WALL_TILE ; 8c + db LAND_TILE ; 8d + db LAND_TILE ; 8e + db LAND_TILE ; 8f + db WALL_TILE ; COLL_COUNTER + db WALL_TILE ; COLL_BOOKSHELF + db WALL_TILE ; 92 + db WALL_TILE ; COLL_PC + db WALL_TILE ; COLL_RADIO + db WALL_TILE ; COLL_TOWN_MAP + db WALL_TILE ; COLL_MART_SHELF + db WALL_TILE ; COLL_TV + db WALL_TILE ; COLL_COUNTER_98 + db WALL_TILE ; 99 + db WALL_TILE ; 9a + db WALL_TILE ; 9b + db WALL_TILE ; COLL_9C + db WALL_TILE ; COLL_WINDOW + db WALL_TILE ; 9e + db WALL_TILE ; COLL_INCENSE_BURNER + db LAND_TILE ; COLL_HOP_RIGHT + db LAND_TILE ; COLL_HOP_LEFT + db LAND_TILE ; COLL_HOP_UP + db LAND_TILE ; COLL_HOP_DOWN + db LAND_TILE ; COLL_HOP_DOWN_RIGHT + db LAND_TILE ; COLL_HOP_DOWN_LEFT + db LAND_TILE ; COLL_HOP_UP_RIGHT + db LAND_TILE ; COLL_HOP_UP_LEFT + db LAND_TILE ; a8 + db LAND_TILE ; a9 + db LAND_TILE ; aa + db LAND_TILE ; ab + db LAND_TILE ; ac + db LAND_TILE ; ad + db LAND_TILE ; ae + db LAND_TILE ; af + db LAND_TILE ; COLL_RIGHT_WALL + db LAND_TILE ; COLL_LEFT_WALL + db LAND_TILE ; COLL_UP_WALL + db LAND_TILE ; COLL_DOWN_WALL + db LAND_TILE ; COLL_DOWN_RIGHT_WALL + db LAND_TILE ; COLL_DOWN_LEFT_WALL + db LAND_TILE ; COLL_UP_RIGHT_WALL + db LAND_TILE ; COLL_UP_LEFT_WALL + db LAND_TILE ; b8 + db LAND_TILE ; b9 + db LAND_TILE ; ba + db LAND_TILE ; bb + db LAND_TILE ; bc + db LAND_TILE ; bd + db LAND_TILE ; be + db LAND_TILE ; bf + db WATER_TILE ; COLL_RIGHT_BUOY + db WATER_TILE ; COLL_LEFT_BUOY + db WATER_TILE ; COLL_UP_BUOY + db WATER_TILE ; COLL_DOWN_BUOY + db WATER_TILE ; COLL_DOWN_RIGHT_BUOY + db WATER_TILE ; COLL_DOWN_LEFT_BUOY + db WATER_TILE ; COLL_UP_RIGHT_BUOY + db WATER_TILE ; COLL_UP_LEFT_BUOY + db WATER_TILE ; c8 + db WATER_TILE ; c9 + db WATER_TILE ; ca + db WATER_TILE ; cb + db WATER_TILE ; cc + db WATER_TILE ; cd + db WATER_TILE ; ce + db WATER_TILE ; cf + db LAND_TILE ; d0 + db LAND_TILE ; d1 + db LAND_TILE ; d2 + db LAND_TILE ; d3 + db LAND_TILE ; d4 + db LAND_TILE ; d5 + db LAND_TILE ; d6 + db LAND_TILE ; d7 + db LAND_TILE ; d8 + db LAND_TILE ; d9 + db LAND_TILE ; da + db LAND_TILE ; db + db LAND_TILE ; dc + db LAND_TILE ; dd + db LAND_TILE ; de + db LAND_TILE ; df + db LAND_TILE ; e0 + db LAND_TILE ; e1 + db LAND_TILE ; e2 + db LAND_TILE ; e3 + db LAND_TILE ; e4 + db LAND_TILE ; e5 + db LAND_TILE ; e6 + db LAND_TILE ; e7 + db LAND_TILE ; e8 + db LAND_TILE ; e9 + db LAND_TILE ; ea + db LAND_TILE ; eb + db LAND_TILE ; ec + db LAND_TILE ; ed + db LAND_TILE ; ee + db LAND_TILE ; ef + db LAND_TILE ; f0 + db LAND_TILE ; f1 + db LAND_TILE ; f2 + db LAND_TILE ; f3 + db LAND_TILE ; f4 + db LAND_TILE ; f5 + db LAND_TILE ; f6 + db LAND_TILE ; f7 + db LAND_TILE ; f8 + db LAND_TILE ; f9 + db LAND_TILE ; fa + db LAND_TILE ; fb + db LAND_TILE ; fc + db LAND_TILE ; fd + db LAND_TILE ; fe + db WALL_TILE ; COLL_FF diff --git a/engine/events/overworld.asm b/engine/events/overworld.asm index cf393ca92..09fc92aa7 100644 --- a/engine/events/overworld.asm +++ b/engine/events/overworld.asm @@ -360,7 +360,7 @@ SurfFunction: jr z, .alreadyfail call GetFacingTileCoord call GetTileCollision - cp WATERTILE + cp WATER_TILE jr nz, .cannotsurf call CheckDirection jr c, .cannotsurf @@ -497,7 +497,7 @@ TrySurfOW:: ; Must be facing water. ld a, [wFacingTileID] call GetTileCollision - cp WATERTILE + cp WATER_TILE jr nz, .quit ; Check tile permissions. @@ -1453,7 +1453,7 @@ FishFunction: jr z, .fail call GetFacingTileCoord call GetTileCollision - cp WATERTILE + cp WATER_TILE jr z, .facingwater .fail ld a, $3 @@ -1697,8 +1697,8 @@ BikeFunction: .ok call GetPlayerStandingTile - and WALLTILE | WATERTILE ; can't use our bike in a wall or on water - jr nz, .nope + and $f ; lo nybble only + jr nz, .nope ; not FLOOR_TILE xor a ret diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm index f4c730247..d6b02fc45 100644 --- a/engine/overworld/npc_movement.asm +++ b/engine/overworld/npc_movement.asm @@ -75,7 +75,7 @@ WillObjectBumpIntoWater: ld a, [hl] ld d, a call GetTileCollision - and a ; LANDTILE + and a ; LAND_TILE jr z, WillObjectBumpIntoTile scf ret @@ -87,7 +87,7 @@ WillObjectBumpIntoLand: add hl, bc ld a, [hl] call GetTileCollision - cp WATERTILE + cp WATER_TILE jr z, WillObjectBumpIntoTile scf ret @@ -213,11 +213,11 @@ Function6fa1: call GetCoordTile call GetTileCollision pop de - and a ; LANDTILE + and a ; LAND_TILE jr nz, .not_land call GetCoordTile call GetTileCollision - and a ; LANDTILE + and a ; LAND_TILE jr nz, .not_land xor a ret diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm index 9f372640b..3beec6ccb 100644 --- a/engine/overworld/player_movement.asm +++ b/engine/overworld/player_movement.asm @@ -738,7 +738,7 @@ ENDM ; Return 0 if tile a is land. Otherwise, return carry. call GetTileCollision - and a ; LANDTILE? + and a ; LAND_TILE ret z scf ret @@ -748,11 +748,11 @@ ENDM ; Otherwise, return carry. call GetTileCollision - cp WATERTILE + cp WATER_TILE jr z, .Water ; Can walk back onto land from water. - and a ; LANDTILE? + and a ; LAND_TILE jr z, .Land jr .Neither diff --git a/home/map_objects.asm b/home/map_objects.asm index 42ac95cf2..64e21e546 100644 --- a/home/map_objects.asm +++ b/home/map_objects.asm @@ -80,7 +80,7 @@ GetPlayerStandingTile:: CheckOnWater:: ld a, [wPlayerStandingTile] call GetTileCollision - sub WATERTILE + sub WATER_TILE ret z and a ret