… | |
… | |
221 | } |
221 | } |
222 | |
222 | |
223 | if (!hole_type) |
223 | if (!hole_type) |
224 | hole_type = rmg_rndm (NR_OF_HOLE_TYPES) + 1; |
224 | hole_type = rmg_rndm (NR_OF_HOLE_TYPES) + 1; |
225 | |
225 | |
226 | char buf[16384]; |
|
|
227 | const char *style, *decor, *mon; |
226 | const char *style, *decor, *mon; |
228 | int g_xsize, g_ysize; |
227 | int g_xsize, g_ysize; |
229 | |
228 | |
230 | switch (hole_type) |
229 | switch (hole_type) |
231 | { |
230 | { |
… | |
… | |
268 | * code will generate new size values which are too large. |
267 | * code will generate new size values which are too large. |
269 | */ |
268 | */ |
270 | max_it (g_xsize, MIN_RANDOM_MAP_SIZE); |
269 | max_it (g_xsize, MIN_RANDOM_MAP_SIZE); |
271 | max_it (g_ysize, MIN_RANDOM_MAP_SIZE); |
270 | max_it (g_ysize, MIN_RANDOM_MAP_SIZE); |
272 | |
271 | |
|
|
272 | dynbuf_text buf; |
|
|
273 | |
273 | { |
274 | { |
274 | random_map_params &rp = *new random_map_params; // for zero_intiialised to work... |
275 | random_map_params &rp = *new random_map_params; // for zero_intiialised to work... |
275 | |
276 | |
|
|
277 | //TODO: deep copy |
|
|
278 | rp.hv = (HV *)SvREFCNT_inc_NN ((SV *)RP->hv); |
|
|
279 | |
276 | rp.xsize = g_xsize; |
280 | rp.xsize = g_xsize; |
277 | rp.ysize = g_ysize; |
281 | rp.ysize = g_ysize; |
278 | |
282 | |
279 | assign (rp.wallstyle , RP->wallstyle); |
|
|
280 | assign (rp.floorstyle , RP->floorstyle); |
|
|
281 | assign (rp.monsterstyle , mon); |
283 | assign (rp.monsterstyle , mon); |
282 | assign (rp.treasurestyle, "none"); |
284 | assign (rp.treasurestyle, "none"); |
283 | assign (rp.layoutstyle , style); |
285 | assign (rp.layoutstyle , style); |
284 | assign (rp.decorstyle , decor); |
286 | assign (rp.decorstyle , decor); |
285 | assign (rp.exitstyle , RP->exitstyle); |
|
|
286 | |
287 | |
287 | rp.layoutoptions1 = RMOPT_WALLS_ONLY; |
288 | rp.layoutoptions1 = RMOPT_WALLS_ONLY; |
288 | rp.symmetry = SYMMETRY_NONE; |
289 | rp.symmetry = SYMMETRY_NONE; |
289 | rp.dungeon_depth = RP->dungeon_level; |
290 | rp.dungeon_depth = RP->dungeon_level; |
290 | rp.dungeon_level = RP->dungeon_level; |
291 | rp.dungeon_level = RP->dungeon_level; |
291 | rp.difficulty = RP->difficulty; |
292 | rp.difficulty = RP->difficulty; |
292 | rp.difficulty_given = RP->difficulty; |
293 | rp.difficulty_given = RP->difficulty; |
293 | rp.difficulty_increase = RP->difficulty_increase; |
294 | rp.difficulty_increase = RP->difficulty_increase; |
294 | rp.decoroptions = -1; |
295 | rp.decoroptions = -1; |
295 | rp.orientation = 1; |
296 | rp.orientation = 1; |
296 | rp.random_seed = RP->random_seed ^ 0xdeadbeef; |
297 | rp.random_seed = RP->random_seed + 0xdeadbeef; |
297 | rp.region = RP->region; |
298 | rp.region = RP->region; |
298 | |
299 | |
299 | write_map_parameters_to_string (buf, &rp); |
300 | write_map_parameters_to_string (buf, &rp); |
300 | delete &rp; |
301 | delete &rp; |
301 | } |
302 | } |