… | |
… | |
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 | { |
232 | case GLORY_HOLE: /* treasures */ |
231 | case GLORY_HOLE: /* treasures */ |
233 | { |
232 | { |
234 | g_xsize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
233 | g_xsize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
235 | g_ysize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
234 | g_ysize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
236 | style = "onion"; |
235 | style = "onion"; |
237 | decor = "wealth2"; |
236 | decor = "special_wealth"; |
238 | mon = "none"; |
237 | mon = "none"; |
239 | break; |
238 | break; |
240 | } |
239 | } |
241 | |
240 | |
242 | case ORC_ZONE: /* hole with orcs in it. */ |
241 | case ORC_ZONE: /* hole with orcs in it. */ |
243 | { |
242 | { |
244 | g_xsize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
243 | g_xsize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
245 | g_ysize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
244 | g_ysize = rmg_rndm (3) + 4 + RP->difficulty / 4; |
246 | style = "onion"; |
245 | style = "onion"; |
247 | decor = "wealth2"; |
246 | decor = "special_wealth"; |
248 | mon = "orc"; |
247 | mon = "orc"; |
249 | break; |
248 | break; |
250 | } |
249 | } |
251 | |
250 | |
252 | case MINING_ZONE: /* hole with orcs in it. */ |
251 | case MINING_ZONE: /* hole with orcs in it. */ |
… | |
… | |
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 | rp.hv = (HV *)SvREFCNT_inc_NN ((SV *)RP->hv); |
|
|
278 | rp.hv_clone (); |
|
|
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); |
283 | rp.set ("treasurestyle", "none"); |
280 | assign (rp.floorstyle , RP->floorstyle); |
284 | rp.set ("decorstyle" , decor); |
|
|
285 | rp.set ("decoroptions" , (IV)-1); |
|
|
286 | |
281 | assign (rp.monsterstyle , mon); |
287 | assign (rp.monsterstyle, mon); |
282 | assign (rp.treasurestyle, "none"); |
|
|
283 | assign (rp.layoutstyle , style); |
288 | assign (rp.layoutstyle , style); |
284 | assign (rp.decorstyle , decor); |
|
|
285 | assign (rp.exitstyle , RP->exitstyle); |
|
|
286 | |
289 | |
287 | rp.layoutoptions1 = RMOPT_WALLS_ONLY; |
290 | rp.layoutoptions1 = RMOPT_WALLS_ONLY; |
288 | rp.symmetry = SYMMETRY_NONE; |
291 | rp.symmetry = SYMMETRY_NONE; |
289 | rp.dungeon_depth = RP->dungeon_level; |
292 | rp.dungeon_depth = RP->dungeon_level; |
290 | rp.dungeon_level = RP->dungeon_level; |
293 | rp.dungeon_level = RP->dungeon_level; |
291 | rp.difficulty = RP->difficulty; |
294 | rp.difficulty = RP->difficulty; |
292 | rp.difficulty_given = RP->difficulty; |
295 | rp.difficulty_given = RP->difficulty; |
293 | rp.difficulty_increase = RP->difficulty_increase; |
296 | rp.difficulty_increase = RP->difficulty_increase; |
294 | rp.decoroptions = -1; |
|
|
295 | rp.orientation = 1; |
297 | rp.orientation = 1; |
296 | rp.random_seed = RP->random_seed ^ 0xdeadbeef; |
298 | rp.random_seed = uint32_t (RP->random_seed + 0xdeadbeef); |
297 | rp.region = RP->region; |
299 | rp.region = RP->region; |
298 | rp.difficulty=99;//D |
|
|
299 | |
300 | |
300 | write_map_parameters_to_string (buf, &rp); |
301 | the_exit->slaying = shstr_random_map_exit; |
|
|
302 | the_exit->msg = rp.as_shstr (); |
|
|
303 | |
301 | delete &rp; |
304 | delete &rp; |
302 | } |
305 | } |
303 | |
306 | |
304 | the_exit->slaying = shstr_random_map_exit; |
|
|
305 | the_exit->msg = buf; |
|
|
306 | |
|
|
307 | insert_ob_in_map (the_exit, map, NULL, 0); |
307 | insert_ob_in_map (the_exit, map, NULL, 0); |
308 | } |
308 | } |
309 | |
309 | |
310 | void |
310 | void |
311 | place_specials_in_map (maptile *map, char **layout, random_map_params *RP) |
311 | place_specials_in_map (maptile *map, char **layout, random_map_params *RP) |
312 | { |
312 | { |
313 | for(int i=0;i<100;++i)//D |
|
|
314 | switch (rmg_rndm (NUM_OF_SPECIAL_TYPES)) |
313 | switch (rmg_rndm (NUM_OF_SPECIAL_TYPES)) |
315 | { |
314 | { |
316 | case SPECIAL_SUBMAP: |
315 | case SPECIAL_SUBMAP: |
317 | { |
316 | { |
318 | /* includes a special map into the random map being made. */ |
317 | /* includes a special map into the random map being made. */ |
319 | maptile *special_map = find_style ("/styles/specialmaps", 0, RP->difficulty); |
318 | maptile *special_map = find_style ("/styles/specialmaps", 0, RP->difficulty, true); |
320 | |
319 | |
321 | if (!special_map) |
320 | if (!special_map) |
322 | break; |
321 | break; |
323 | |
322 | |
324 | int ix, iy; /* map insertion locatons */ |
323 | int ix, iy; /* map insertion locatons */ |
… | |
… | |
339 | place_fountain_with_specials (map); |
338 | place_fountain_with_specials (map); |
340 | break; |
339 | break; |
341 | |
340 | |
342 | case SPECIAL_EXIT: |
341 | case SPECIAL_EXIT: |
343 | /* Make an exit to another random map, e.g. a gloryhole. */ |
342 | /* Make an exit to another random map, e.g. a gloryhole. */ |
344 | //place_special_exit (map, 0, RP); |
343 | place_special_exit (map, 0, RP); |
345 | place_special_exit (map, GLORY_HOLE, RP); |
|
|
346 | break; |
344 | break; |
347 | } |
345 | } |
348 | } |
346 | } |
349 | |
347 | |