1 | /* |
1 | /* |
2 | * static char *rcsid_define_h = |
2 | * static char *rcsid_define_h = |
3 | * "$Id: map.h,v 1.6 2006/08/13 17:16:02 elmex Exp $"; |
3 | * "$Id: map.h,v 1.10 2006/08/27 16:15:12 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
31 | * It contains pointers (very indirectly) to all objects on the map. |
31 | * It contains pointers (very indirectly) to all objects on the map. |
32 | */ |
32 | */ |
33 | |
33 | |
34 | #ifndef MAP_H |
34 | #ifndef MAP_H |
35 | #define MAP_H |
35 | #define MAP_H |
|
|
36 | |
|
|
37 | #include "cfperl.h" |
36 | |
38 | |
37 | /* We set this size - this is to make magic map work properly on |
39 | /* We set this size - this is to make magic map work properly on |
38 | * tiled maps. There is no requirement that this matches the |
40 | * tiled maps. There is no requirement that this matches the |
39 | * tiled maps size - it just seemed like a reasonable value. |
41 | * tiled maps size - it just seemed like a reasonable value. |
40 | * Magic map code now always starts out putting the player in the |
42 | * Magic map code now always starts out putting the player in the |
… | |
… | |
155 | * arch_blocked and functions that examine the return value. |
157 | * arch_blocked and functions that examine the return value. |
156 | */ |
158 | */ |
157 | |
159 | |
158 | #define AB_NO_PASS 0x04 |
160 | #define AB_NO_PASS 0x04 |
159 | /*#define P_PASS_THRU 0x08 *//* */ |
161 | /*#define P_PASS_THRU 0x08 *//* */ |
|
|
162 | #define P_SAFE 0x08 /* If this is set the map is a safe map, |
|
|
163 | * that means, nothing harmful there will be done, |
|
|
164 | * like: bombs, potion usage, alchemy, spells |
|
|
165 | * this was introduced to make shops more safe |
|
|
166 | * and propably other maps */ |
160 | #define P_IS_ALIVE 0x10 /* something alive is on this space */ |
167 | #define P_IS_ALIVE 0x10 /* something alive is on this space */ |
161 | #define P_NO_CLERIC 0x20 /* no clerical spells cast here */ |
168 | #define P_NO_CLERIC 0x20 /* no clerical spells cast here */ |
162 | #define P_NEED_UPDATE 0x40 /* this space is out of date */ |
169 | #define P_NEED_UPDATE 0x40 /* this space is out of date */ |
163 | #define P_NO_ERROR 0x80 /* Purely temporary - if set, update_position |
170 | #define P_NO_ERROR 0x80 /* Purely temporary - if set, update_position |
164 | * does not complain if the flags are different. |
171 | * does not complain if the flags are different. |
… | |
… | |
270 | * almost certainly break various features. You may think |
277 | * almost certainly break various features. You may think |
271 | * it is safe to look at width and height values directly |
278 | * it is safe to look at width and height values directly |
272 | * (or even through the macros), but doing so will completely |
279 | * (or even through the macros), but doing so will completely |
273 | * break map tiling. |
280 | * break map tiling. |
274 | */ |
281 | */ |
275 | struct mapstruct { |
282 | struct mapstruct : extendable<mapstruct> { |
|
|
283 | static data_type get_dt () { return DT_MAP; } |
|
|
284 | |
276 | struct mapstruct *next; /* Next map, linked list */ |
285 | struct mapstruct *next; /* Next map, linked list */ |
277 | char *tmpname; /* Name of temporary file */ |
286 | char *tmpname; /* Name of temporary file */ |
278 | char *name; /* Name of map as given by its creator */ |
287 | char *name; /* Name of map as given by its creator */ |
279 | struct region *region; /* What jurisdiction in the game world this map is ruled by |
288 | struct region *region; /* What jurisdiction in the game world this map is ruled by |
280 | * points to the struct containing all the properties of |
289 | * points to the struct containing all the properties of |
… | |
… | |
285 | */ |
294 | */ |
286 | uint32 fixed_resettime:1; /* if true, reset time is not affected by |
295 | uint32 fixed_resettime:1; /* if true, reset time is not affected by |
287 | * players entering/exiting map |
296 | * players entering/exiting map |
288 | */ |
297 | */ |
289 | uint32 unique:1; /* if set, this is a per player unique map */ |
298 | uint32 unique:1; /* if set, this is a per player unique map */ |
|
|
299 | uint32 safe_map:1; /* if set, this map doesn't allow using magic or harmful stuff in any way */ |
290 | uint32 templatemap:1; /* if set, this is a template map */ |
300 | uint32 templatemap:1; /* if set, this is a template map */ |
291 | uint32 nosmooth:1; /* if set the content of this map has smoothlevel=0 forced*/ |
301 | uint32 nosmooth:1; /* if set the content of this map has smoothlevel=0 forced*/ |
292 | sint32 timeout; /* swapout is set to this */ |
302 | sint32 timeout; /* swapout is set to this */ |
293 | sint32 swap_time; /* When it reaches 0, the map will be swapped out */ |
303 | sint32 swap_time; /* When it reaches 0, the map will be swapped out */ |
294 | sint16 players; /* How many plares are on this level right now */ |
304 | sint16 players; /* How many plares are on this level right now */ |
… | |
… | |
339 | int distance_y; |
349 | int distance_y; |
340 | int direction; |
350 | int direction; |
341 | object *part; |
351 | object *part; |
342 | }; |
352 | }; |
343 | |
353 | |
344 | extern void (*load_original_map_callback)(mapstruct *map); |
|
|
345 | extern void (*load_temporary_map_callback)(mapstruct *map); |
|
|
346 | extern void (*clean_temporary_map_callback)(mapstruct *map); |
|
|
347 | |
|
|
348 | #endif |
354 | #endif |