… | |
… | |
16 | |
16 | |
17 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | |
20 | |
21 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at crossfire.de |
22 | */ |
22 | */ |
23 | |
23 | |
24 | /* |
24 | /* |
25 | * The mapstruct is allocated each time a new map is opened. |
25 | * The maptile is allocated each time a new map is opened. |
26 | * It contains pointers (very indirectly) to all objects on the map. |
26 | * It contains pointers (very indirectly) to all objects on the map. |
27 | */ |
27 | */ |
28 | |
28 | |
29 | #ifndef MAP_H |
29 | #ifndef MAP_H |
30 | #define MAP_H |
30 | #define MAP_H |
… | |
… | |
229 | |
229 | |
230 | /* |
230 | /* |
231 | * Each map is in a given region of the game world and links to a region definiton, so |
231 | * Each map is in a given region of the game world and links to a region definiton, so |
232 | * they have to appear here in the headers, before the mapdef |
232 | * they have to appear here in the headers, before the mapdef |
233 | */ |
233 | */ |
234 | struct region |
234 | struct region : zero_initialised |
235 | { |
235 | { |
236 | struct region *next; /* pointer to next region, NULL for the last one */ |
236 | struct region *next; /* pointer to next region, NULL for the last one */ |
237 | const char *name; /* Shortend name of the region as maps refer to it */ |
237 | const char *name; /* Shortend name of the region as maps refer to it */ |
238 | const char *parent_name; /* |
238 | const char *parent_name; /* |
239 | * So that parent and child regions can be defined in |
239 | * So that parent and child regions can be defined in |
… | |
… | |
255 | * this should be the one we fall back on as the default */ |
255 | * this should be the one we fall back on as the default */ |
256 | char *jailmap; /*where a player that is arrested in this region should be imprisoned. */ |
256 | char *jailmap; /*where a player that is arrested in this region should be imprisoned. */ |
257 | sint16 jailx, jaily; /* The coodinates in jailmap to which the player should be sent. */ |
257 | sint16 jailx, jaily; /* The coodinates in jailmap to which the player should be sent. */ |
258 | }; |
258 | }; |
259 | |
259 | |
260 | |
|
|
261 | struct shopitems : zero_initialised |
260 | struct shopitems : zero_initialised |
262 | { |
261 | { |
263 | const char *name; /* name of the item in question, null if it is the default item */ |
262 | const char *name; /* name of the item in question, null if it is the default item */ |
264 | const char *name_pl; /* plural name */ |
263 | const char *name_pl; /* plural name */ |
265 | int typenum; /* itemtype number we need to match 0 if it is the default price */ |
264 | int typenum; /* itemtype number we need to match 0 if it is the default price */ |
… | |
… | |
274 | * almost certainly break various features. You may think |
273 | * almost certainly break various features. You may think |
275 | * it is safe to look at width and height values directly |
274 | * it is safe to look at width and height values directly |
276 | * (or even through the macros), but doing so will completely |
275 | * (or even through the macros), but doing so will completely |
277 | * break map tiling. |
276 | * break map tiling. |
278 | */ |
277 | */ |
279 | ACC_CLASS (mapstruct) |
278 | ACC_CLASS (maptile) |
280 | struct mapstruct:zero_initialised, attachable < mapstruct > |
279 | struct maptile : zero_initialised, attachable<maptile> |
281 | { |
280 | { |
282 | struct mapstruct *ACC (RW, next); /* Next map, linked list */ |
281 | maptile *ACC (RW, next); /* Next map, linked list */ |
283 | char *ACC (RO, tmpname); /* Name of temporary file */ |
282 | char *ACC (RO, tmpname); /* Name of temporary file */ |
284 | char *ACC (RO, name); /* Name of map as given by its creator */ |
283 | char *ACC (RO, name); /* Name of map as given by its creator */ |
285 | struct region *ACC (RW, region); /* What jurisdiction in the game world this map is ruled by |
284 | struct region *ACC (RW, region); /* What jurisdiction in the game world this map is ruled by |
286 | * points to the struct containing all the properties of |
285 | * points to the struct containing all the properties of |
287 | * the region */ |
286 | * the region */ |
… | |
… | |
295 | bool ACC (RW, unique); /* if set, this is a per player unique map */ |
294 | bool ACC (RW, unique); /* if set, this is a per player unique map */ |
296 | bool ACC (RW, templatemap); /* if set, this is a template map */ |
295 | bool ACC (RW, templatemap); /* if set, this is a template map */ |
297 | bool ACC (RW, nosmooth); /* if set the content of this map has smoothlevel=0 forced */ |
296 | bool ACC (RW, nosmooth); /* if set the content of this map has smoothlevel=0 forced */ |
298 | sint32 ACC (RW, timeout); /* swapout is set to this */ |
297 | sint32 ACC (RW, timeout); /* swapout is set to this */ |
299 | sint32 ACC (RW, swap_time); /* When it reaches 0, the map will be swapped out */ |
298 | sint32 ACC (RW, swap_time); /* When it reaches 0, the map will be swapped out */ |
300 | sint16 ACC (RW, players); /* How many plares are on this level right now */ |
299 | sint16 ACC (RW, players); /* How many players are on this level right now */ |
301 | uint32 ACC (RW, in_memory); /* If not true, the map has been freed and must |
300 | uint32 ACC (RW, in_memory); /* If not true, the map has been freed and must |
302 | * be loaded before used. The map,omap and map_ob |
301 | * be loaded before used. The map,omap and map_ob |
303 | * arrays will be allocated when the map is loaded */ |
302 | * arrays will be allocated when the map is loaded */ |
304 | uint16 ACC (RW, difficulty); /* What level the player should be to play here */ |
303 | uint16 ACC (RW, difficulty); /* What level the player should be to play here */ |
305 | |
304 | |
… | |
… | |
318 | sint8 ACC (RW, sky); /* sky conditions */ |
317 | sint8 ACC (RW, sky); /* sky conditions */ |
319 | int ACC (RW, wpartx), ACC (RW, wparty); /*Highly fasten conversion between worldmap and weathermap */ |
318 | int ACC (RW, wpartx), ACC (RW, wparty); /*Highly fasten conversion between worldmap and weathermap */ |
320 | struct shopitems *shopitems; /* a semi-colon seperated list of item-types the map's shop will trade in */ |
319 | struct shopitems *shopitems; /* a semi-colon seperated list of item-types the map's shop will trade in */ |
321 | char *ACC (RO, shoprace); /* the preffered race of the local shopkeeper */ |
320 | char *ACC (RO, shoprace); /* the preffered race of the local shopkeeper */ |
322 | double ACC (RW, shopgreed); /* how much our shopkeeper overcharges */ |
321 | double ACC (RW, shopgreed); /* how much our shopkeeper overcharges */ |
323 | uint64 ACC (RW, shopmin); /* minimum price a shop will trade for */ |
322 | sint64 ACC (RW, shopmin); /* minimum price a shop will trade for */ |
324 | uint64 ACC (RW, shopmax); /* maximum price a shop will offer */ |
323 | sint64 ACC (RW, shopmax); /* maximum price a shop will offer */ |
325 | char *ACC (RO, msg); /* Message map creator may have left */ |
324 | char *ACC (RO, msg); /* Message map creator may have left */ |
326 | char *ACC (RO, maplore); /* Map lore information */ |
325 | char *ACC (RO, maplore); /* Map lore information */ |
327 | char *tile_path[4]; /* path to adjoining maps */ |
326 | char *tile_path[4]; /* path to adjoining maps */ |
328 | struct mapstruct *tile_map[4]; /* Next map, linked list */ |
327 | maptile *tile_map[4]; /* Next map, linked list */ |
329 | char ACC (RW, path)[HUGE_BUF]; /* Filename of the map */ |
328 | char ACC (RW, path)[HUGE_BUF]; /* Filename of the map */ |
|
|
329 | |
|
|
330 | maptile (); |
|
|
331 | void allocate (); |
330 | }; |
332 | }; |
331 | |
333 | |
332 | /* This is used by get_rangevector to determine where the other |
334 | /* This is used by get_rangevector to determine where the other |
333 | * creature is. get_rangevector takes into account map tiling, |
335 | * creature is. get_rangevector takes into account map tiling, |
334 | * so you just can not look the the map coordinates and get the |
336 | * so you just can not look the the map coordinates and get the |
… | |
… | |
346 | int direction; |
348 | int direction; |
347 | object *part; |
349 | object *part; |
348 | }; |
350 | }; |
349 | |
351 | |
350 | #endif |
352 | #endif |
|
|
353 | |