version 1.33 | | version 1.34 |
---|
| | |
/* | | /* |
* static char *rcsid_random_map_c = | | * static char *rcsid_random_map_c = |
* "$Id: random_map.c,v 1.33 2003/03/07 07:33:13 mwedel Exp $"; | | * "$Id: random_map.c,v 1.34 2003/03/09 00:18:41 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
else | | else |
RP->difficulty_given=1; | | RP->difficulty_given=1; |
| | |
| | if(RP->Xsize<MIN_RANDOM_MAP_SIZE) RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM()%25 + 5; |
| | if(RP->Ysize<MIN_RANDOM_MAP_SIZE) RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM()%25 + 5; |
| | |
if(RP->expand2x > 0) { | | if(RP->expand2x > 0) { |
RP->Xsize /=2; | | RP->Xsize /=2; |
RP->Ysize /=2; | | RP->Ysize /=2; |
| | |
char **layoutgen(RMParms *RP) { | | char **layoutgen(RMParms *RP) { |
char **maze=0; | | char **maze=0; |
| | |
if(RP->Xsize<MIN_RANDOM_MAP_SIZE) RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM()%25 + 5; | | if(RP->symmetry == RANDOM_SYM) |
if(RP->Ysize<MIN_RANDOM_MAP_SIZE) RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM()%25 + 5; | | |
| | |
if(RP->symmetry == RANDOM_SYM) { | | |
RP->symmetry_used = (RANDOM() % ( XY_SYM))+1; | | RP->symmetry_used = (RANDOM() % ( XY_SYM))+1; |
| | else RP->symmetry_used = RP->symmetry; |
| | |
if(RP->symmetry_used==Y_SYM||RP->symmetry_used==XY_SYM) RP->Ysize = RP->Ysize/2+1; | | if(RP->symmetry_used==Y_SYM||RP->symmetry_used==XY_SYM) RP->Ysize = RP->Ysize/2+1; |
if(RP->symmetry_used==X_SYM||RP->symmetry_used==XY_SYM) RP->Xsize = RP->Xsize/2+1; | | if(RP->symmetry_used==X_SYM||RP->symmetry_used==XY_SYM) RP->Xsize = RP->Xsize/2+1; |
} | | |
else RP->symmetry_used = RP->symmetry; | | |
| | |
if(RP->symmetry==Y_SYM||RP->symmetry==XY_SYM) RP->Ysize = RP->Ysize/2+1; | | if(RP->Xsize<MIN_RANDOM_MAP_SIZE) RP->Xsize = MIN_RANDOM_MAP_SIZE + RANDOM()%5; |
if(RP->symmetry==X_SYM||RP->symmetry==XY_SYM) RP->Xsize = RP->Xsize/2+1; | | if(RP->Ysize<MIN_RANDOM_MAP_SIZE) RP->Ysize = MIN_RANDOM_MAP_SIZE + RANDOM()%5; |
| | |
if(strstr(RP->layoutstyle,"onion")) { | | if(strstr(RP->layoutstyle,"onion")) { |
maze = map_gen_onion(RP->Xsize,RP->Ysize,RP->layoutoptions1,RP->layoutoptions2); | | maze = map_gen_onion(RP->Xsize,RP->Ysize,RP->layoutoptions1,RP->layoutoptions2); |