version 1.13 | | version 1.14 |
---|
| | |
/* | | /* |
* static char *rcsid_random_map_c = | | * static char *rcsid_random_map_c = |
* "$Id: random_map.c,v 1.13 2001/01/16 07:46:04 peterm Exp $"; | | * "$Id: random_map.c,v 1.14 2001/01/16 08:20:53 peterm Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
/* rotate the layout randomly */ | | /* rotate the layout randomly */ |
layout=rotate_layout(layout,RANDOM()%4,RP); | | layout=rotate_layout(layout,RANDOM()%4,RP); |
/* { int i,j; | | #ifdef RMAP_DEBUG |
| | { int i,j; |
for(i=0;i<RP->Xsize;i++) { | | for(i=0;i<RP->Xsize;i++) { |
for(j=0;j<RP->Ysize;j++) { | | for(j=0;j<RP->Ysize;j++) { |
if(layout[i][j]==0) layout[i][j]=' '; | | if(layout[i][j]==0) layout[i][j]=' '; |
| | |
if(layout[i][j]==' ') layout[i][j]=0; | | if(layout[i][j]==' ') layout[i][j]=0; |
} | | } |
printf("\n"); | | printf("\n"); |
}}*/ | | }} |
| | #endif |
/* allocate the map and set the floor */ | | /* allocate the map and set the floor */ |
theMap = make_map_floor(layout,RP->floorstyle,RP); | | theMap = make_map_floor(layout,RP->floorstyle,RP); |
| | |
| | |
if(!(RANDOM()%2)) doorify_layout(maze,RP); | | if(!(RANDOM()%2)) doorify_layout(maze,RP); |
} | | } |
| | |
| | if(strstr(RP->layoutstyle,"rogue")) { |
| | maze = roguelike_layout_gen(RP->Xsize,RP->Ysize,RP->layoutoptions1); |
| | RP->map_layout_style = ROGUELIKE_LAYOUT; |
| | /* no doorification */ |
| | } |
| | |
if(maze == 0) /* unknown or unspecified layout type, pick one at random */ | | if(maze == 0) /* unknown or unspecified layout type, pick one at random */ |
switch(RANDOM()%NROFLAYOUTS) { | | switch(RANDOM()%NROFLAYOUTS) { |
case 0: | | case 0: |
| | |
RP->map_layout_style = SPIRAL_LAYOUT; | | RP->map_layout_style = SPIRAL_LAYOUT; |
if(!(RANDOM()%2)) doorify_layout(maze,RP); | | if(!(RANDOM()%2)) doorify_layout(maze,RP); |
break; | | break; |
case 4: | | case 3: |
maze = roguelike_layout_gen(RP->Xsize,RP->Ysize,RP->layoutoptions1); | | maze = roguelike_layout_gen(RP->Xsize,RP->Ysize,RP->layoutoptions1); |
RP->map_layout_style = ROGUELIKE_LAYOUT; | | RP->map_layout_style = ROGUELIKE_LAYOUT; |
/* no doorifying... done already */ | | /* no doorifying... done already */ |
| | break; |
} | | } |
| | |
maze = symmetrize_layout(maze, RP->symmetry_used,RP); | | maze = symmetrize_layout(maze, RP->symmetry_used,RP); |
| | |
for(i=0;i<Xsize_orig;i++) | | for(i=0;i<Xsize_orig;i++) |
free(maze[i]); | | free(maze[i]); |
free(maze); | | free(maze); |
/* reconnected disjointed spirals */ | | /* reconnect disjointed spirals */ |
if(RP->map_layout_style==SPIRAL_LAYOUT) | | if(RP->map_layout_style==SPIRAL_LAYOUT) |
connect_spirals(RP->Xsize,RP->Ysize,sym,sym_maze); | | connect_spirals(RP->Xsize,RP->Ysize,sym,sym_maze); |
| | /* reconnect disjointed nethackmazes: the routine for |
| | spirals will do the trick?*/ |
| | if(RP->map_layout_style==ROGUELIKE_LAYOUT) |
| | connect_spirals(RP->Xsize,RP->Ysize,sym,sym_maze); |
| | |
return sym_maze; | | return sym_maze; |
} | | } |
| | |