 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
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
57 #define MAP_TYPE_LEGACY 1
58 #define MAP_TYPE_DEFAULT 2
59 #define MAP_TYPE_CHOICE 3
62 #define MAP_WHEN_RESET(m) ((m)->reset_time)
64 #define MAP_RESET_TIMEOUT(m) ((m)->reset_timeout)
65 #define MAP_DIFFICULTY(m) ((m)->difficulty)
66 #define MAP_TIMEOUT(m) ((m)->timeout)
67 #define MAP_OUTDOORS(m) ((m)->outdoor)
70 #define MAP_DARKNESS(m) (m)->darkness
73 #define MAP_WIDTH(m) (m)->width
75 #define MAP_HEIGHT(m) (m)->height
77 #define MAP_SIZE(m) map_size(m)
80 #define MAP_ENTER_X(m) (m)->enter_x
82 #define MAP_ENTER_Y(m) (m)->enter_y
84 #define MAP_NOSMOOTH(m) (m)->nosmooth
92 #define MAP_PLAYER_UNIQUE 0x2
93 #define MAP_NO_DIFFICULTY 0x4
95 #define MAP_OVERLAY 0x10
106 #define SAVE_FLAG_SAVE_UNPAID 1
107 #define SAVE_FLAG_NO_REMOVE 2
116 #define SAVE_MODE_NORMAL 0
117 #define SAVE_MODE_INPLACE 1
118 #define SAVE_MODE_OVERLAY 2
126 #define MAP_IN_MEMORY 1
127 #define MAP_SWAPPED 2
128 #define MAP_LOADING 3
139 #define SAVE_ERROR_OK 0
140 #define SAVE_ERROR_RCREATION -1
141 #define SAVE_ERROR_UCREATION -2
142 #define SAVE_ERROR_WRITE -3
143 #define SAVE_ERROR_NO_PATH -4
144 #define SAVE_ERROR_URENAME -5
145 #define SAVE_ERROR_CLOSE -6
147 #define SAVE_ERROR_NOT_IN_MEMORY -10
148 #define SAVE_ERROR_PLAYER -11
157 #define GET_MAP_FLAGS(M, X, Y) (map_space(M, X, Y)->flags)
159 #define SET_MAP_FLAGS(M, X, Y, C) (map_space(M, X, Y)->flags = C)
162 #define GET_MAP_LIGHT(M, X, Y) (map_space(M, X, Y)->light)
164 #define SET_MAP_LIGHT(M, X, Y, L) (map_space(M, X, Y)->light = L)
166 #define GET_MAP_PLAYER(M, X, Y) (map_space(M, X, Y)->pl)
167 #define SET_MAP_PLAYER(M, X, Y, C) (map_space(M, X, Y)->pl = C)
170 #define GET_MAP_OB(M, X, Y) (map_space(M, X, Y)->bottom)
172 #define GET_MAP_TOP(M, X, Y) (map_space(M, X, Y)->top)
175 #define SET_MAP_OB(M, X, Y, tmp) (map_space(M, X, Y)->bottom = (tmp))
177 #define SET_MAP_TOP(M, X, Y, tmp) (map_space(M, X, Y)->top = (tmp))
180 #define SET_MAP_FACE_OBJ(M, X, Y, C, L) (map_space(M, X, Y)->faces_obj[L] = C)
182 #define GET_MAP_FACE_OBJ(M, X, Y, L) (map_space(M, X, Y)->faces_obj[L])
187 #define GET_MAP_FACE_OBJS(M, X, Y) (map_space(M, X, Y)->faces_obj)
192 #define GET_MAP_MOVE_BLOCK(M, X, Y) (map_space(M, X, Y)->move_block)
194 #define SET_MAP_MOVE_BLOCK(M, X, Y, C) (map_space(M, X, Y)->move_block = C)
197 #define GET_MAP_MOVE_SLOW(M, X, Y) (map_space(M, X, Y)->move_slow)
199 #define SET_MAP_MOVE_SLOW(M, X, Y, C) (map_space(M, X, Y)->move_slow = C)
202 #define GET_MAP_MOVE_ON(M, X, Y) (map_space(M, X, Y)->move_on)
204 #define SET_MAP_MOVE_ON(M, X, Y, C) (map_space(M, X, Y)->move_on = C)
207 #define GET_MAP_MOVE_OFF(M, X, Y) (map_space(M, X, Y)->move_off)
209 #define SET_MAP_MOVE_OFF(M, X, Y, C) (map_space(M, X, Y)->move_off = C)
217 #define OUT_OF_REAL_MAP(M, X, Y) ((X) < 0 || (Y) < 0 || (X) >= (M)->width || (Y) >= (M)->height)
226 #define P_BLOCKSVIEW 0x01
227 #define P_NO_MAGIC 0x02
235 #define AB_NO_PASS 0x04
236 #define P_PLAYER 0x08
237 #define P_IS_ALIVE 0x10
238 #define P_NO_CLERIC 0x20
239 #define P_NEED_UPDATE 0x40
240 #define P_NO_ERROR 0x80
249 #define P_OUT_OF_MAP 0x100
250 #define P_NEW_MAP 0x200
double shopgreed
How much our shopkeeper overcharges.
char * tile_path[4]
Path to adjoining maps.
MoveType move_on
What movement types are activated.
int8_t strength
The degree of specialisation the shop has in this item, as a percentage from -100 to 100.
bool ob_move_block(object *ob1, object *ob2)
Basic macro to see if ob2 blocks ob1 from moving onto this space.
struct region * region
What jurisdiction in the game world this map is ruled by points to the struct containing all the prop...
int8_t light
How much light this space provides.
uint16_t difficulty
What level the player should be to play here.
int8_t fallback
Whether, in the event of a region not existing, this should be the one we fall back on as the default...
uint32_t outdoor
True if an outdoor map.
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,...
uint64_t shopmin
Minimum price a shop will trade for.
int map_light_on(mapstruct *m, int x, int y)
Return the light level at position (X, Y) on map M.
oblinkpt * buttons
Linked list of linked lists of buttons.
int16_t players
How many players are on this level right now.
char * tmpname
Name of temporary file.
bool coords_in_shop(mapstruct *map, int x, int y)
Check if the given map coordinates are in a shop.
MoveType move_off
What movement types are activated.
unsigned char MoveType
Typdef here to define type large enough to hold bitmask of all movement types.
int index
Being the size of the shopitems array.
uint16_t height
Width and height of map.
void map_reset_swap(mapstruct *m)
Call this when an in-memory map is used or referenced.
Used to link together several object links.
char * name
Shortend name of the region as maps refer to it.
object * part
Part we found.
uint32_t is_template
If set, this is a template map.
char path[HUGE_BUF]
Filename of the map.
#define HUGE_BUF
Used for messages - some can be quite long.
Plugin animator file specs[Config] name
object * bottom
Lowest object on this space.
char * longname
Official title of the region, this might be defined to be the same as name.
struct shopitems * shopitems
List of item-types the map's shop will trade in.
static event_registration m
bool shop_contains(object *ob)
Check if an object is in a shop.
object * top
Highest object on this space.
char * shoprace
The preffered race of the local shopkeeper.
region * parent
Pointer to the region that is a parent of the current region, if a value isn't defined in the current...
MapSpace * map_space(const mapstruct *m, int x, int y)
char * msg
The description of the region.
char * jailmap
Where a player that is arrested in this region should be imprisoned.
const char * name_pl
Plural name.
sstring reset_group
For reset purpose, all maps in the same group reset at the same time.
This structure contains all information related to one map square.
long last_reset_time
A timestamp of the last original map loading.
char * maplore
Map lore information.
int typenum
Itemtype number we need to match, -1 if it is the default price.
uint64_t shopmax
MMaximum price a shop will offer.
bool map_path_unique(const char *name)
Return true if the given map path leads to a unique map.
MoveType move_block
What movement types this space blocks.
char * background_music
Background music to use for this map.
const char * name
Name of the item in question, null if it is the default item.
uint32_t reset_timeout
How many seconds must elapse before this map should be reset.
const typedef char * sstring
uint32_t nosmooth
If set the content of this map has smoothlevel=0 forced.
uint8_t flags
Flags about this space (see the P_ values above).
char * name
Name of map as given by its creator.
uint32_t in_memory
Combination of IN_MEMORY_xxx flags.
This is used by get_rangevector to determine where the other creature is.
Shop-related information for a map.
int32_t timeout
Swapout is set to this.
object * pl
Player who is on this space, may be NULL.
mapstruct * tile_map[4]
Adjoining maps.
MapSpace * spaces
Array of spaces on this map.
char * msg
Message map creator may have left.
uint32_t counter
A generic counter for holding temporary data.
uint32_t map_size(mapstruct *m)
Calculate map size without intermediate sign extension.
object * faces_obj[MAP_LAYERS]
Face objects for the layers.
int16_t enter_y
Enter_x and enter_y are default entrance coordinates to use for a map such that when an exit specifie...
uint32_t unique
If set, this is a per player unique map.
mapstruct * next
Next map, linked list.
uint32_t reset_time
Server time when map gets reset, seconds since epoch.
uint8_t darkness
Indicates level of darkness of map.
int direction
General direction to the targer.
uint32_t fixed_resettime
If true, reset time is not affected by players entering/exiting map.
unsigned int distance
Distance, in squares.
MoveType move_slow
What movement types this space slows.
int16_t jaily
The coodinates in jailmap to which the player should be sent.