1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
… | |
… | |
65 | break; |
65 | break; |
66 | } |
66 | } |
67 | } |
67 | } |
68 | } |
68 | } |
69 | |
69 | |
70 | |
|
|
71 | |
|
|
72 | /* copy in_map into dest_map at point x,y */ |
70 | /* copy in_map into dest_map at point x,y */ |
73 | |
|
|
74 | |
|
|
75 | void |
71 | void |
76 | include_map_in_map (maptile *dest_map, maptile *in_map, int x, int y) |
72 | include_map_in_map (maptile *dest_map, maptile *in_map, int x, int y) |
77 | { |
73 | { |
78 | int i, j; |
74 | int i, j; |
79 | object *tmp; |
75 | object *tmp; |
… | |
… | |
144 | for (m = j; m < j + ysize; m++) |
140 | for (m = j; m < j + ysize; m++) |
145 | if (layout[l][m] == 'C' || layout[l][m] == '>' || layout[l][m] == '<') |
141 | if (layout[l][m] == 'C' || layout[l][m] == '>' || layout[l][m] == '<') |
146 | is_occupied |= 1; |
142 | is_occupied |= 1; |
147 | } |
143 | } |
148 | } |
144 | } |
|
|
145 | |
149 | if (is_occupied) |
146 | if (is_occupied) |
150 | return 0; |
147 | return 0; |
|
|
148 | |
151 | *ix = i; |
149 | *ix = i; |
152 | *iy = j; |
150 | *iy = j; |
153 | return 1; |
151 | return 1; |
154 | } |
152 | } |
155 | |
|
|
156 | |
153 | |
157 | void |
154 | void |
158 | place_fountain_with_specials (maptile *map) |
155 | place_fountain_with_specials (maptile *map) |
159 | { |
156 | { |
160 | int ix, iy, i = -1, tries = 0; |
157 | int ix, iy, i = -1, tries = 0; |
… | |
… | |
283 | } |
280 | } |
284 | |
281 | |
285 | /* Need to be at least this size, otherwise the load |
282 | /* Need to be at least this size, otherwise the load |
286 | * code will generate new size values which are too large. |
283 | * code will generate new size values which are too large. |
287 | */ |
284 | */ |
288 | if (g_xsize < MIN_RANDOM_MAP_SIZE) |
285 | if (g_xsize < MIN_RANDOM_MAP_SIZE) g_xsize = MIN_RANDOM_MAP_SIZE; |
289 | g_xsize = MIN_RANDOM_MAP_SIZE; |
286 | if (g_ysize < MIN_RANDOM_MAP_SIZE) g_ysize = MIN_RANDOM_MAP_SIZE; |
290 | if (g_ysize < MIN_RANDOM_MAP_SIZE) |
|
|
291 | g_ysize = MIN_RANDOM_MAP_SIZE; |
|
|
292 | |
287 | |
293 | write_parameters_to_string (buf, g_xsize, g_ysize, RP->wallstyle, RP->floorstyle, mon, |
288 | write_parameters_to_string (buf, g_xsize, g_ysize, RP->wallstyle, RP->floorstyle, mon, |
294 | "none", style, decor, "none", RP->exitstyle, 0, 0, 0, |
289 | "none", style, decor, "none", RP->exitstyle, 0, 0, 0, |
295 | RMOPT_WALLS_ONLY, 0, 0, 1, RP->dungeon_level, RP->dungeon_level, |
290 | RMOPT_WALLS_ONLY, 0, 0, 1, RP->dungeon_level, RP->dungeon_level, |
296 | RP->difficulty, RP->difficulty, -1, 1, 0, 0, 0, 0, RP->difficulty_increase); |
291 | RP->difficulty, RP->difficulty, -1, 1, 0, 0, 0, 0, RP->difficulty_increase); |
… | |
… | |
298 | the_exit->msg = buf; |
293 | the_exit->msg = buf; |
299 | |
294 | |
300 | insert_ob_in_map (the_exit, map, NULL, 0); |
295 | insert_ob_in_map (the_exit, map, NULL, 0); |
301 | } |
296 | } |
302 | |
297 | |
303 | |
|
|
304 | void |
298 | void |
305 | place_specials_in_map (maptile *map, char **layout, random_map_params *RP) |
299 | place_specials_in_map (maptile *map, char **layout, random_map_params *RP) |
306 | { |
300 | { |
307 | maptile *special_map; |
301 | maptile *special_map; |
308 | int ix, iy; /* map insertion locatons */ |
302 | int ix, iy; /* map insertion locatons */ |
… | |
… | |
333 | case SPECIAL_EXIT: |
327 | case SPECIAL_EXIT: |
334 | /* Make an exit to another random map, e.g. a gloryhole. */ |
328 | /* Make an exit to another random map, e.g. a gloryhole. */ |
335 | place_special_exit (map, 0, RP); |
329 | place_special_exit (map, 0, RP); |
336 | break; |
330 | break; |
337 | } |
331 | } |
338 | |
|
|
339 | } |
332 | } |
|
|
333 | |