summaryrefslogtreecommitdiff
path: root/include/map.h
diff options
context:
space:
mode:
authorCheng Hann Gan <chenghanngan.us@gmail.com>2021-09-09 19:22:48 -0400
committerGitHub <noreply@github.com>2021-09-09 16:22:48 -0700
commit8237e29a164211eb2ec4cd161eb4183cc1947fee (patch)
tree67dc502264b755dc620f56969f3bea68a40b17af /include/map.h
parent4eff1882443b0004d9c9fa4895cdfefdc356565f (diff)
Defined more in-dungeon structs and enums (#53)
* Defined DungeonEntity * Rename EntityType enums * Revert EntityType rename * Defined more in-dungeon structs and enums * Added more dungeon global structs/enums * Prefixed dungeonGlobalData with g * Fixed compile errors * Removed some CRLFs * Fixed compile after merge * Revert Makefile * Rename DungeonEntityData.entityType Co-authored-by: Seth Barberee <seth.barberee@gmail.com> * Renamed symbols per PR comments Co-authored-by: Cheng Hann Gan <chenghann_gan@ultimatesoftware.com> Co-authored-by: Seth Barberee <seth.barberee@gmail.com>
Diffstat (limited to 'include/map.h')
-rw-r--r--include/map.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/include/map.h b/include/map.h
new file mode 100644
index 0000000..d3d1ed9
--- /dev/null
+++ b/include/map.h
@@ -0,0 +1,61 @@
+#ifndef GUARD_MAP_H
+#define GUARD_MAP_H
+
+#include "dungeon_entity.h"
+
+#define MAX_ROOM_COUNT 24 // Empirical max, not sure if the code supports any more.
+
+struct MapTile
+{
+ /* 0x0 */ u8 tileFlags;
+ /* 0x1 */ bool8 stairs;
+ u8 fill2[0x9 - 0x2];
+ /* 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;
+ u8 fillE[0x10 - 0xE];
+ /* 0x10 */ struct DungeonEntity *pokemon; // Pokémon on the tile.
+ /* 0x14 */ struct DungeonEntity *mapObject; // Item or trap on the tile.
+};
+
+struct MapRoom
+{
+ u8 fill0[0x2 - 0x0];
+ // All coordinates are inclusive.
+ /* 0x2 */ s16 startX;
+ /* 0x4 */ s16 startY;
+ /* 0x6 */ s16 endX;
+ /* 0x8 */ s16 endY;
+ u8 fillA[0x1C - 0xA];
+};
+
+struct RoomExit
+{
+ s16 x;
+ s16 y;
+};
+
+enum TileFlag
+{
+ TILE_TYPE_FLOOR = 1 << 0,
+ TILE_TYPE_LIQUID = 1 << 2, // Water or lava depending on the dungeon.
+ 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