sTileBitAttributes to sparse array, rename MB_UNNUSED_CAVE

This commit is contained in:
GriffinR 2022-01-19 12:39:11 -05:00
parent e3b49604d4
commit e682c12519
2 changed files with 126 additions and 248 deletions

View File

@ -9,7 +9,7 @@
#define MB_UNUSED_05 0x05
#define MB_DEEP_SAND 0x06
#define MB_SHORT_GRASS 0x07
#define MB_UNUSED_CAVE 0x08
#define MB_CAVE 0x08
#define MB_LONG_GRASS_SOUTH_EDGE 0x09
#define MB_NO_RUNNING 0x0A
#define MB_INDOOR_ENCOUNTER 0x0B
@ -241,6 +241,9 @@
#define MB_UNUSED_ED 0xED
#define MB_UNUSED_EE 0xEE
#define MB_UNUSED_EF 0xEF
#define NUM_METATILE_BEHAVIORS 0xF0
#define MB_INVALID 0xFF
#endif // GUARD_METATILE_BEHAVIORS_H

View File

@ -2,254 +2,129 @@
#include "metatile_behavior.h"
#include "constants/metatile_behaviors.h"
#define TILE_FLAG_ENCOUNTER_TILE 1
#define TILE_FLAG_SURFABLE 2
#define TILE_FLAG_HAS_ENCOUNTERS (1 << 0)
#define TILE_FLAG_SURFABLE (1 << 1)
#define TILE_FLAG_TRAVERSABLE (1 << 2) // Set but never read
#define TILE_ATTRIBUTES(unused, surfable, wildEncounter) (((wildEncounter) ? 1 : 0) | ((surfable) ? 2 : 0) | ((unused) ? 4 : 0))
// wonder what the third flag is supposed to do
static const u8 sTileBitAttributes[] =
static const u8 sTileBitAttributes[NUM_METATILE_BEHAVIORS] =
{
[MB_NORMAL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TALL_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_LONG_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_UNUSED_04] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_05] = TILE_ATTRIBUTES(FALSE, FALSE, TRUE),
[MB_DEEP_SAND] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_SHORT_GRASS] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_CAVE] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_LONG_GRASS_SOUTH_EDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_NO_RUNNING] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_INDOOR_ENCOUNTER] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_MOUNTAIN_TOP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BATTLE_PYRAMID_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_MOSSDEEP_GYM_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_MT_PYRE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_POND_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_SEMI_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_WATERFALL] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_SOOTOPOLIS_DEEP_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_OCEAN_WATER] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_PUDDLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SHALLOW_WATER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_SOOTOPOLIS_DEEP_WATER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_NO_SURFACING] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_UNUSED_SOOTOPOLIS_DEEP_WATER_2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SHOAL_CAVE_ENTRANCE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_1D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_1E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_1F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SAND] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SEAWEED] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_UNUSED_23] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ASHGRASS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_FOOTPRINTS] = TILE_ATTRIBUTES(TRUE, FALSE, TRUE),
[MB_THIN_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_ICE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HOT_SPRINGS] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LAVARIDGE_GYM_B1F_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SEAWEED_NO_SURFACING] = TILE_ATTRIBUTES(TRUE, TRUE, TRUE),
[MB_REFLECTION_UNDER_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_2C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_2F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_IMPASSABLE_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_NORTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_EAST] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_WEST] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_NORTH] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_SOUTH] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_JUMP_NORTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_NORTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_SOUTHEAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_JUMP_SOUTHWEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WALK_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_WEST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SLIDE_SOUTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_49] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_4A] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_4B] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_4F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_EASTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_WESTWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_NORTHWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_SOUTHWARD_CURRENT] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_UNUSED_54] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_55] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_56] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_57] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_58] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_59] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5A] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5B] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5C] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5D] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_5F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_NON_ANIMATED_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LADDER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_EAST_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WEST_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_NORTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SOUTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_FLOOR_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_AQUA_HIDEOUT_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_LAVARIDGE_GYM_1F_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ANIMATED_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UP_ESCALATOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_DOWN_ESCALATOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_WATER_DOOR] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_WATER_SOUTH_ARROW_WARP] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_DEEP_SOUTH_WARP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_6F] = TILE_ATTRIBUTES(TRUE, TRUE, FALSE),
[MB_BRIDGE_OVER_OCEAN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_LOW] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_MED] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_HIGH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_FORTREE_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_79] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_BRIDGE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_COUNTER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_81] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_82] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CABLE_BOX_RESULTS_1] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_REGION_MAP] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TELEVISION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_POKEBLOCK_FEEDER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_88] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SLOT_MACHINE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_ROULETTE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CLOSED_SOOTOPOLIS_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRICK_HOUSE_PUZZLE_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PETALBURG_GYM_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_RUNNING_SHOES_INSTRUCTION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_QUESTIONNAIRE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_RED_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_RED_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BROWN_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BROWN_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_YELLOW_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_YELLOW_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_LEFT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_LEFT_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_SHRUB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_SHRUB_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BLUE_CAVE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_BLUE_CAVE_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_RIGHT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_9E] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_9F] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BERRY_TREE_SOIL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A1] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A3] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A4] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A5] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A7] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_A9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_AF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_REGISTER_PC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_OBSTACLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_TRAINER_SPOT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_DECORATION] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_HOLDS_SMALL_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_B6] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_NORTH_WALL] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_BALLOON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_IMPASSABLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_GLITTER_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_JUMP_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SPIN_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SOUND_MAT] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_SAND_ORNAMENT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_HOLE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HOLDS_LARGE_DECORATION] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_TV_SHIELD] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_PLAYER_ROOM_PC_ON] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_SECRET_BASE_DECORATION_BASE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SECRET_BASE_POSTER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_C8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_C9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_CF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_MUDDY_SLOPE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_BUMPY_SLOPE] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_CRACKED_FLOOR] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ISOLATED_VERTICAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_ISOLATED_HORIZONTAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_VERTICAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_HORIZONTAL_RAIL] = TILE_ATTRIBUTES(TRUE, FALSE, FALSE),
[MB_UNUSED_D7] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_D8] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_D9] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DA] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DD] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_DF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_PICTURE_BOOK_SHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BOOKSHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_POKEMON_CENTER_BOOKSHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_VASE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRASH_CAN] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SHOP_SHELF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_BLUEPRINT] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_CABLE_BOX_RESULTS_2] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_WIRELESS_BOX_RESULTS] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_TRAINER_HILL_TIMER] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_SKY_PILLAR_CLOSED_DOOR] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EB] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EC] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_ED] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EE] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_UNUSED_EF] = TILE_ATTRIBUTES(FALSE, FALSE, FALSE),
[MB_NORMAL] = TILE_FLAG_TRAVERSABLE,
[MB_TALL_GRASS] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_LONG_GRASS] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_UNUSED_05] = TILE_FLAG_HAS_ENCOUNTERS,
[MB_DEEP_SAND] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_SHORT_GRASS] = TILE_FLAG_TRAVERSABLE,
[MB_CAVE] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_LONG_GRASS_SOUTH_EDGE] = TILE_FLAG_TRAVERSABLE,
[MB_NO_RUNNING] = TILE_FLAG_TRAVERSABLE,
[MB_INDOOR_ENCOUNTER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_MOUNTAIN_TOP] = TILE_FLAG_TRAVERSABLE,
[MB_BATTLE_PYRAMID_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_MOSSDEEP_GYM_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_MT_PYRE_HOLE] = TILE_FLAG_TRAVERSABLE,
[MB_POND_WATER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_SEMI_DEEP_WATER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_DEEP_WATER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_WATERFALL] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_SOOTOPOLIS_DEEP_WATER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_OCEAN_WATER] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_PUDDLE] = TILE_FLAG_TRAVERSABLE,
[MB_SHALLOW_WATER] = TILE_FLAG_TRAVERSABLE,
[MB_NO_SURFACING] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_STAIRS_OUTSIDE_ABANDONED_SHIP] = TILE_FLAG_TRAVERSABLE,
[MB_SHOAL_CAVE_ENTRANCE] = TILE_FLAG_TRAVERSABLE,
[MB_ICE] = TILE_FLAG_TRAVERSABLE,
[MB_SAND] = TILE_FLAG_TRAVERSABLE,
[MB_SEAWEED] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_UNUSED_23] = TILE_FLAG_TRAVERSABLE,
[MB_ASHGRASS] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_FOOTPRINTS] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_THIN_ICE] = TILE_FLAG_TRAVERSABLE,
[MB_CRACKED_ICE] = TILE_FLAG_TRAVERSABLE,
[MB_HOT_SPRINGS] = TILE_FLAG_TRAVERSABLE,
[MB_LAVARIDGE_GYM_B1F_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_SEAWEED_NO_SURFACING] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE | TILE_FLAG_HAS_ENCOUNTERS,
[MB_REFLECTION_UNDER_BRIDGE] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_EAST] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_WEST] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_NORTH] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_SOUTH] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_NORTHEAST] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_NORTHWEST] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_SOUTHEAST] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_SOUTHWEST] = TILE_FLAG_TRAVERSABLE,
[MB_JUMP_NORTHEAST] = TILE_FLAG_TRAVERSABLE,
[MB_JUMP_NORTHWEST] = TILE_FLAG_TRAVERSABLE,
[MB_JUMP_SOUTHEAST] = TILE_FLAG_TRAVERSABLE,
[MB_JUMP_SOUTHWEST] = TILE_FLAG_TRAVERSABLE,
[MB_WALK_EAST] = TILE_FLAG_TRAVERSABLE,
[MB_WALK_WEST] = TILE_FLAG_TRAVERSABLE,
[MB_WALK_NORTH] = TILE_FLAG_TRAVERSABLE,
[MB_WALK_SOUTH] = TILE_FLAG_TRAVERSABLE,
[MB_SLIDE_EAST] = TILE_FLAG_TRAVERSABLE,
[MB_SLIDE_WEST] = TILE_FLAG_TRAVERSABLE,
[MB_SLIDE_NORTH] = TILE_FLAG_TRAVERSABLE,
[MB_SLIDE_SOUTH] = TILE_FLAG_TRAVERSABLE,
[MB_TRICK_HOUSE_PUZZLE_8_FLOOR] = TILE_FLAG_TRAVERSABLE,
[MB_UNUSED_49] = TILE_FLAG_TRAVERSABLE,
[MB_UNUSED_4A] = TILE_FLAG_TRAVERSABLE,
[MB_EASTWARD_CURRENT] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_WESTWARD_CURRENT] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_NORTHWARD_CURRENT] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_SOUTHWARD_CURRENT] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_NON_ANIMATED_DOOR] = TILE_FLAG_TRAVERSABLE,
[MB_LADDER] = TILE_FLAG_TRAVERSABLE,
[MB_EAST_ARROW_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_WEST_ARROW_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_NORTH_ARROW_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_SOUTH_ARROW_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_CRACKED_FLOOR_HOLE] = TILE_FLAG_TRAVERSABLE,
[MB_AQUA_HIDEOUT_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_LAVARIDGE_GYM_1F_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_ANIMATED_DOOR] = TILE_FLAG_TRAVERSABLE,
[MB_UP_ESCALATOR] = TILE_FLAG_TRAVERSABLE,
[MB_DOWN_ESCALATOR] = TILE_FLAG_TRAVERSABLE,
[MB_WATER_DOOR] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_WATER_SOUTH_ARROW_WARP] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_DEEP_SOUTH_WARP] = TILE_FLAG_TRAVERSABLE,
[MB_UNUSED_6F] = TILE_FLAG_TRAVERSABLE | TILE_FLAG_SURFABLE,
[MB_BRIDGE_OVER_POND_LOW] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_MED] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_HIGH] = TILE_FLAG_TRAVERSABLE,
[MB_PACIFIDLOG_VERTICAL_LOG_TOP] = TILE_FLAG_TRAVERSABLE,
[MB_PACIFIDLOG_VERTICAL_LOG_BOTTOM] = TILE_FLAG_TRAVERSABLE,
[MB_PACIFIDLOG_HORIZONTAL_LOG_LEFT] = TILE_FLAG_TRAVERSABLE,
[MB_PACIFIDLOG_HORIZONTAL_LOG_RIGHT] = TILE_FLAG_TRAVERSABLE,
[MB_FORTREE_BRIDGE] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_MED_EDGE_1] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_MED_EDGE_2] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_HIGH_EDGE_1] = TILE_FLAG_TRAVERSABLE,
[MB_BRIDGE_OVER_POND_HIGH_EDGE_2] = TILE_FLAG_TRAVERSABLE,
[MB_UNUSED_BRIDGE] = TILE_FLAG_TRAVERSABLE,
[MB_BIKE_BRIDGE_OVER_BARRIER] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_OBSTACLE] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_TRAINER_SPOT] = TILE_FLAG_TRAVERSABLE,
[MB_HOLDS_SMALL_DECORATION] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_BALLOON] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_IMPASSABLE] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_GLITTER_MAT] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_JUMP_MAT] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_SPIN_MAT] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_SOUND_MAT] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_BREAKABLE_DOOR] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_SOUTH_AND_NORTH] = TILE_FLAG_TRAVERSABLE,
[MB_IMPASSABLE_WEST_AND_EAST] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_HOLE] = TILE_FLAG_TRAVERSABLE,
[MB_HOLDS_LARGE_DECORATION] = TILE_FLAG_TRAVERSABLE,
[MB_SECRET_BASE_TV_SHIELD] = TILE_FLAG_TRAVERSABLE,
[MB_PLAYER_ROOM_PC_ON] = TILE_FLAG_TRAVERSABLE,
[MB_MUDDY_SLOPE] = TILE_FLAG_TRAVERSABLE,
[MB_BUMPY_SLOPE] = TILE_FLAG_TRAVERSABLE,
[MB_CRACKED_FLOOR] = TILE_FLAG_TRAVERSABLE,
[MB_ISOLATED_VERTICAL_RAIL] = TILE_FLAG_TRAVERSABLE,
[MB_ISOLATED_HORIZONTAL_RAIL] = TILE_FLAG_TRAVERSABLE,
[MB_VERTICAL_RAIL] = TILE_FLAG_TRAVERSABLE,
[MB_HORIZONTAL_RAIL] = TILE_FLAG_TRAVERSABLE,
};
bool8 MetatileBehavior_IsATile(u8 metatileBehavior)
@ -259,7 +134,7 @@ bool8 MetatileBehavior_IsATile(u8 metatileBehavior)
bool8 MetatileBehavior_IsEncounterTile(u8 metatileBehavior)
{
if ((sTileBitAttributes[metatileBehavior] & TILE_FLAG_ENCOUNTER_TILE))
if ((sTileBitAttributes[metatileBehavior] & TILE_FLAG_HAS_ENCOUNTERS))
return TRUE;
else
return FALSE;