}
level.flags.is_maze_lev = TRUE;
+ level.flags.corrmaze = !rn2(3);
-#ifndef WALLIFIED_MAZE
- for(x = 2; x < x_maze_max; x++)
- for(y = 2; y < y_maze_max; y++)
- levl[x][y].typ = STONE;
-#else
- for(x = 2; x <= x_maze_max; x++)
- for(y = 2; y <= y_maze_max; y++)
- levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL;
-#endif
+ if (level.flags.corrmaze)
+ for(x = 2; x < x_maze_max; x++)
+ for(y = 2; y < y_maze_max; y++)
+ levl[x][y].typ = STONE;
+ else
+ for(x = 2; x <= x_maze_max; x++)
+ for(y = 2; y <= y_maze_max; y++)
+ levl[x][y].typ = ((x % 2) && (y % 2)) ? STONE : HWALL;
maze0xy(&mm);
walkfrom((int) mm.x, (int) mm.y, 0);
/* put a boulder at the maze center */
(void) mksobj_at(BOULDER, (int) mm.x, (int) mm.y, TRUE, FALSE);
-#ifdef WALLIFIED_MAZE
- wallification(2, 2, x_maze_max, y_maze_max);
-#endif
+ if (!level.flags.corrmaze)
+ wallification(2, 2, x_maze_max, y_maze_max);
+
mazexy(&mm);
mkstairs(mm.x, mm.y, 1, (struct mkroom *)0); /* up */
if (!Invocation_lev(&u.uz)) {
int q, a, dir, pos;
int dirs[4];
-#ifndef WALLIFIED_MAZE
- if (!typ) typ = CORR;
-#else
- if (!typ) typ = ROOM;
-#endif
+ if (!typ) {
+ if (level.flags.corrmaze)
+ typ = CORR;
+ else
+ typ = ROOM;
+ }
pos = 1;
mazex[pos] = (char) x;
register int q,a,dir;
int dirs[4];
-#ifndef WALLIFIED_MAZE
- if (!typ) typ = CORR;
-#else
- if (!typ) typ = ROOM;
-#endif
+ if (!typ) {
+ if (level.flags.corrmaze)
+ typ = CORR;
+ else
+ typ = ROOM;
+ }
if(!IS_DOOR(levl[x][y].typ)) {
/* might still be on edge of MAP, so don't overwrite */
void
mazexy(cc) /* find random point in generated corridors,
- so we don't create items in moats, bunkers, or walls */
+ so we don't create items in moats, bunkers, or walls */
coord *cc;
{
int cpt=0;
cc->x = 3 + 2*rn2((x_maze_max>>1) - 1);
cc->y = 3 + 2*rn2((y_maze_max>>1) - 1);
cpt++;
- } while (cpt < 100 && levl[cc->x][cc->y].typ !=
-#ifdef WALLIFIED_MAZE
- ROOM
-#else
- CORR
-#endif
- );
+ } while (cpt < 100 &&
+ levl[cc->x][cc->y].typ != (level.flags.corrmaze ? CORR : ROOM));
if (cpt >= 100) {
register int x, y;
/* last try */
for (y = 0; y < (y_maze_max>>1) - 1; y++) {
cc->x = 3 + 2 * x;
cc->y = 3 + 2 * y;
- if (levl[cc->x][cc->y].typ ==
-#ifdef WALLIFIED_MAZE
- ROOM
-#else
- CORR
-#endif
- ) return;
+ if (levl[cc->x][cc->y].typ == (level.flags.corrmaze ? CORR : ROOM))
+ return;
}
panic("mazexy: can't find a place!");
}
* so the boundary would be breached
*
* we can't bound unconditionally on one beyond the last line, because
- * that provides a window of abuse for WALLIFIED_MAZE special levels
+ * that provides a window of abuse for wallified special levels
*/
{
register int x,y;
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
-#ifndef WALLIFIED_MAZE
- levl[x][y].typ = STONE;
-#else
- levl[x][y].typ =
- (y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
-#endif
+ if (level.flags.corrmaze)
+ levl[x][y].typ = STONE;
+ else
+ levl[x][y].typ =
+ (y < 2 || ((x % 2) && (y % 2))) ? STONE : filling;
}
}
if (lflags & GRAVEYARD) level.flags.graveyard = 1;
if (lflags & ICEDPOOLS) icedpools = TRUE;
if (lflags & SOLIDIFY) coder->solidify = TRUE;
+ if (lflags & CORRMAZE) level.flags.corrmaze = TRUE;
opvar_free(flagdata);
}
if (!isok(x,y)) return;
if (OV_i(ftyp) < 1) {
-#ifndef WALLIFIED_MAZE
- OV_i(ftyp) = CORR;
-#else
- OV_i(ftyp) = ROOM;
-#endif
+ OV_i(ftyp) = level.flags.corrmaze ? CORR : ROOM;
}
/* don't use move() - it doesn't use W_NORTH, etc. */