diff options
author | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-01-25 22:46:40 -0500 |
---|---|---|
committer | AnonymousRandomPerson <chenghanngan.us@gmail.com> | 2022-01-25 22:46:40 -0500 |
commit | 154c44250512828d56f5431188a7907cd149ef10 (patch) | |
tree | efcc44e62d9699b51cac25a68cb4b762544c5ed4 /include | |
parent | 408fe77d7b9440d7eb5d46eda5f920572d516d67 (diff) |
Decomped CanMoveInDirection()
Diffstat (limited to 'include')
-rw-r--r-- | include/dungeon_capabilities_1.h | 2 | ||||
-rw-r--r-- | include/map.h | 48 |
2 files changed, 25 insertions, 25 deletions
diff --git a/include/dungeon_capabilities_1.h b/include/dungeon_capabilities_1.h index 1d10a0f..c19391b 100644 --- a/include/dungeon_capabilities_1.h +++ b/include/dungeon_capabilities_1.h @@ -7,5 +7,7 @@ bool8 CannotUseItems(struct DungeonEntity *pokemon); // 0x70CD0 bool8 CannotAct(struct DungeonEntity *pokemon); +// 0x70D6C +bool8 CanMoveInDirection(struct DungeonEntity *pokemon, u32 facingDir); #endif diff --git a/include/map.h b/include/map.h index bb991ff..9122f00 100644 --- a/include/map.h +++ b/include/map.h @@ -7,6 +7,27 @@ #define MAX_ROOM_COUNT 24 // Empirical max, not sure if the code supports any more. #define CORRIDOR_ROOM_INDEX 0xFF +enum TileType +{ + TILE_TYPE_FLOOR = 1 << 0, + TILE_TYPE_LIQUID = 1 << 1, // Water or lava depending on the dungeon. + TILE_TYPE_UNK_2 = 1 << 2, + TILE_TYPE_ROOM_EXIT = 1 << 3, + TILE_TYPE_MAP_EDGE = 1 << 4, + TILE_TYPE_SHOP = 1 << 5, + TILE_TYPE_MONSTER_HOUSE = 1 << 6, + TILE_TYPE_STAIRS = 1 << 9 +}; + +enum CrossableTerrain +{ + CROSSABLE_TERRAIN_REGULAR = 0, + CROSSABLE_TERRAIN_LIQUID = 1, + CROSSABLE_TERRAIN_CREVICE = 2, + CROSSABLE_TERRAIN_WALL = 3, + NUM_CROSSABLE_TERRAIN +}; + struct MapTile { // Uses the TileType bit flags. @@ -17,11 +38,8 @@ struct MapTile u8 unk8; /* 0x9 */ u8 roomIndex; // Bitwise flags for whether Pokémon can move to an adjacent tile. Bits correspond to directions in direction.h. - // Different sets of flags are used for Pokémon that can cross special terrain. - /* 0xA */ u8 canMoveAdjacent; - /* 0xB */ u8 canMoveAdjacentLiquid; - /* 0xC */ u8 canMoveAdjacentCrevice; - /* 0xD */ u8 canMoveAdjacentWall; + // Different sets of flags are used for Pokémon that can cross special terrain, corresponding to Cthe rossableTerrain enum. + /* 0xA */ u8 canMoveAdjacent[NUM_CROSSABLE_TERRAIN]; u8 fillE[0x10 - 0xE]; /* 0x10 */ struct DungeonEntity *pokemon; // Pokémon on the tile. /* 0x14 */ struct DungeonEntity *mapObject; // Item or trap on the tile. @@ -39,24 +57,4 @@ struct MapRoom u8 fillA[0x1A - 0xA]; }; -enum TileType -{ - TILE_TYPE_FLOOR = 1 << 0, - TILE_TYPE_LIQUID = 1 << 1, // Water or lava depending on the dungeon. - TILE_TYPE_UNK_2 = 1 << 2, - TILE_TYPE_ROOM_EXIT = 1 << 3, - TILE_TYPE_MAP_EDGE = 1 << 4, - TILE_TYPE_SHOP = 1 << 5, - TILE_TYPE_MONSTER_HOUSE = 1 << 6, - TILE_TYPE_STAIRS = 1 << 9 -}; - -enum CrossableTerrain -{ - CROSSABLE_TERRAIN_REGULAR = 0, - CROSSABLE_TERRAIN_LIQUID = 1, - CROSSABLE_TERRAIN_CREVICE = 2, - CROSSABLE_TERRAIN_WALL = 3, -}; - #endif |