24 #define MAGIC_MAP_SIZE 50 25 #define MAGIC_MAP_HALF MAGIC_MAP_SIZE/2 40 #define MAP_LAYER_FLOOR 0 41 #define MAP_LAYER_NO_PICK1 1 42 #define MAP_LAYER_NO_PICK2 2 43 #define MAP_LAYER_ITEM1 3 44 #define MAP_LAYER_ITEM2 4 45 #define MAP_LAYER_ITEM3 5 46 #define MAP_LAYER_LIVING1 6 47 #define MAP_LAYER_LIVING2 7 48 #define MAP_LAYER_FLY1 8 49 #define MAP_LAYER_FLY2 9 59 #define MAP_TYPE_LEGACY 1 60 #define MAP_TYPE_DEFAULT 2 61 #define MAP_TYPE_CHOICE 3 65 #define MAP_WHEN_RESET(m) ((m)->reset_time) 67 #define MAP_RESET_TIMEOUT(m) ((m)->reset_timeout) 68 #define MAP_DIFFICULTY(m) ((m)->difficulty) 69 #define MAP_TIMEOUT(m) ((m)->timeout) 70 #define MAP_OUTDOORS(m) ((m)->outdoor) 73 #define MAP_DARKNESS(m) (m)->darkness 76 #define MAP_WIDTH(m) (m)->width 78 #define MAP_HEIGHT(m) (m)->height 80 #define MAP_SIZE(m) map_size(m) 83 #define MAP_ENTER_X(m) (m)->enter_x 85 #define MAP_ENTER_Y(m) (m)->enter_y 87 #define MAP_NOSMOOTH(m) (m)->nosmooth 95 #define MAP_PLAYER_UNIQUE 0x2 96 #define MAP_NO_DIFFICULTY 0x4 98 #define MAP_OVERLAY 0x10 109 #define SAVE_FLAG_SAVE_UNPAID 1 110 #define SAVE_FLAG_NO_REMOVE 2 119 #define SAVE_MODE_NORMAL 0 120 #define SAVE_MODE_INPLACE 1 121 #define SAVE_MODE_OVERLAY 2 129 #define MAP_IN_MEMORY 1 130 #define MAP_SWAPPED 2 131 #define MAP_LOADING 3 142 #define SAVE_ERROR_OK 0 143 #define SAVE_ERROR_RCREATION -1 144 #define SAVE_ERROR_UCREATION -2 145 #define SAVE_ERROR_WRITE -3 146 #define SAVE_ERROR_NO_PATH -4 147 #define SAVE_ERROR_URENAME -5 148 #define SAVE_ERROR_CLOSE -6 150 #define SAVE_ERROR_NOT_IN_MEMORY -10 151 #define SAVE_ERROR_PLAYER -11 160 #define GET_MAP_FLAGS(M, X, Y) (map_space(M, X, Y)->flags) 162 #define SET_MAP_FLAGS(M, X, Y, C) (map_space(M, X, Y)->flags = C) 165 #define GET_MAP_LIGHT(M, X, Y) (map_space(M, X, Y)->light) 167 #define SET_MAP_LIGHT(M, X, Y, L) (map_space(M, X, Y)->light = L) 169 #define GET_MAP_PLAYER(M, X, Y) (map_space(M, X, Y)->pl) 170 #define SET_MAP_PLAYER(M, X, Y, C) (map_space(M, X, Y)->pl = C) 173 #define GET_MAP_OB(M, X, Y) (map_space(M, X, Y)->bottom) 175 #define GET_MAP_TOP(M, X, Y) (map_space(M, X, Y)->top) 178 #define SET_MAP_OB(M, X, Y, tmp) (map_space(M, X, Y)->bottom = (tmp)) 180 #define SET_MAP_TOP(M, X, Y, tmp) (map_space(M, X, Y)->top = (tmp)) 183 #define SET_MAP_FACE_OBJ(M, X, Y, C, L) (map_space(M, X, Y)->faces_obj[L] = C) 185 #define GET_MAP_FACE_OBJ(M, X, Y, L) (map_space(M, X, Y)->faces_obj[L]) 190 #define GET_MAP_FACE_OBJS(M, X, Y) (map_space(M, X, Y)->faces_obj) 195 #define GET_MAP_MOVE_BLOCK(M, X, Y) (map_space(M, X, Y)->move_block) 197 #define SET_MAP_MOVE_BLOCK(M, X, Y, C) (map_space(M, X, Y)->move_block = C) 200 #define GET_MAP_MOVE_SLOW(M, X, Y) (map_space(M, X, Y)->move_slow) 202 #define SET_MAP_MOVE_SLOW(M, X, Y, C) (map_space(M, X, Y)->move_slow = C) 205 #define GET_MAP_MOVE_ON(M, X, Y) (map_space(M, X, Y)->move_on) 207 #define SET_MAP_MOVE_ON(M, X, Y, C) (map_space(M, X, Y)->move_on = C) 210 #define GET_MAP_MOVE_OFF(M, X, Y) (map_space(M, X, Y)->move_off) 212 #define SET_MAP_MOVE_OFF(M, X, Y, C) (map_space(M, X, Y)->move_off = C) 220 #define OUT_OF_REAL_MAP(M, X, Y) ((X) < 0 || (Y) < 0 || (X) >= (M)->width || (Y) >= (M)->height) 229 #define P_BLOCKSVIEW 0x01 230 #define P_NO_MAGIC 0x02 238 #define AB_NO_PASS 0x04 239 #define P_PLAYER 0x08 240 #define P_IS_ALIVE 0x10 241 #define P_NO_CLERIC 0x20 242 #define P_NEED_UPDATE 0x40 243 #define P_NO_ERROR 0x80 252 #define P_OUT_OF_MAP 0x100 253 #define P_NEW_MAP 0x200 326 uint32_t reset_timeout;
328 uint32_t fixed_resettime:1;
332 uint32_t is_template:1;
340 uint16_t width, height;
341 int16_t enter_x, enter_y;
359 long last_reset_time;
360 char *background_music;
374 unsigned int distance;
This is used by get_rangevector to determine where the other creature is.
bool coords_in_shop(mapstruct *map, int x, int y)
Check if the given map coordinates are in a shop.
std::vector< archetype * > players
#define HUGE_BUF
Used for messages - some can be quite long.
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
char * longname
Official title of the region, this might be defined to be the same as name.
Used to link together several object links.
uint32_t counter
A generic counter for holding temporary data.
bool shop_contains(object *ob)
Check if an object is in a shop.
int8_t fallback
Whether, in the event of a region not existing, this should be the one we fall back on as the default...
char * name
Shortend name of the region as maps refer to it.
#define MAP_LAYERS
This correspondes to the map layers in the map2 protocol.
MapSpace * map_space(const mapstruct *m, int x, int y)
region * parent
Pointer to the region that is a parent of the current region, if a value isn't defined in the current...
bool ob_move_block(object *ob1, object *ob2)
Basic macro to see if ob2 blocks ob1 from moving onto this space.
uint32_t map_size(mapstruct *m)
Calculate map size without intermediate sign extension.
static const flag_definition flags[]
Flag mapping.
char * jailmap
Where a player that is arrested in this region should be imprisoned.
int map_light_on(mapstruct *m, int x, int y)
Return the light level at position (X, Y) on map M.
static event_registration m
This structure contains all information related to one map square.
int16_t jaily
The coodinates in jailmap to which the player should be sent.
char * msg
The description of the region.
Shop-related information for a map.
bool map_path_unique(const char *name)
Return true if the given map path leads to a unique map.
void map_reset_swap(mapstruct *m)
Call this when an in-memory map is used or referenced.
const char *const map_layer_name[MAP_LAYERS]
These correspond to the layer names in map.h - since some of the types can be on multiple layers...