des.region(selection.area(00,00,34,16), "lit")
-- Stairs
-- Note: The up stairs are *intentionally* off of the map.
+-- if the stairs are surrounded by lava, maybe give some room
+des.replace_terrain({ region = {44,09, 46,11}, fromterrain='L', toterrain='.', chance=50 });
des.stair("up", 45,10)
-- Non diggable walls
des.non_diggable(selection.area(00,00,34,16))
extern int okdoor(xchar, xchar);
extern void dodoor(int, int, struct mkroom *);
extern void mktrap(int, int, struct mkroom *, coord *);
-extern void mkstairs(xchar, xchar, char, struct mkroom *);
+extern void mkstairs(xchar, xchar, char, struct mkroom *, boolean);
extern void mkinvokearea(void);
extern void mineralize(int, int, int, int, boolean);
}
}
+/* Create stairs up or down at x,y.
+ If force is TRUE, change the terrain to ROOM first */
void
mkstairs(
xchar x, xchar y,
char up, /* [why 'char' when usage is boolean?] */
- struct mkroom *croom UNUSED)
+ struct mkroom *croom UNUSED,
+ boolean force)
{
int ltyp;
d_level dest;
impossible("mkstairs: bogus stair attempt at <%d,%d>", x, y);
return;
}
+ if (force)
+ levl[x][y].typ = ROOM;
ltyp = levl[x][y].typ; /* somexyspace() allows ice */
if (ltyp != ROOM && ltyp != CORR && ltyp != ICE) {
int glyph = back_to_glyph(x, y),
pos.x = somex(croom);
pos.y = somey(croom);
}
- mkstairs(pos.x, pos.y, 0, croom); /* down */
+ mkstairs(pos.x, pos.y, 0, croom, FALSE); /* down */
}
if (g.nroom > 1)
pos.x = somex(croom);
pos.y = somey(croom);
}
- mkstairs(pos.x, pos.y, 1, croom); /* up */
+ mkstairs(pos.x, pos.y, 1, croom, FALSE); /* up */
}
}
}
You("are standing at the top of a stairwell leading down!");
- mkstairs(u.ux, u.uy, 0, (struct mkroom *) 0); /* down */
+ mkstairs(u.ux, u.uy, 0, (struct mkroom *) 0, FALSE); /* down */
newsym(u.ux, u.uy);
g.vision_full_recalc = 1; /* everything changed */
}
break;
case LR_DOWNSTAIR:
case LR_UPSTAIR:
- mkstairs(x, y, (char) rtype, (struct mkroom *) 0);
+ mkstairs(x, y, (char) rtype, (struct mkroom *) 0, FALSE);
break;
case LR_BRANCH:
place_branch(Is_branchlev(&u.uz), x, y);
wallification(2, 2, g.x_maze_max, g.y_maze_max);
mazexy(&mm);
- mkstairs(mm.x, mm.y, 1, (struct mkroom *) 0); /* up */
+ mkstairs(mm.x, mm.y, 1, (struct mkroom *) 0, FALSE); /* up */
if (!Invocation_lev(&u.uz)) {
mazexy(&mm);
- mkstairs(mm.x, mm.y, 0, (struct mkroom *) 0); /* down */
+ mkstairs(mm.x, mm.y, 0, (struct mkroom *) 0, FALSE); /* down */
} else { /* choose "vibrating square" location */
stairway *stway;
int trycnt = 0;
levl[x][y].ladder = LA_DOWN;
}
} else {
- /* hack for Valkyrie goal level where upstairs are at a fixed
- location outside the mapped area; make sure they don't get
- placed on a lava spot */
- if (levl[x][y].typ == LAVAPOOL) {
- int tx, ty;
-
- for (tx = x - 1; tx <= x + 1; ++tx)
- for (ty = y - 1; ty <= y + 1; ++ty)
- if (isok(tx, ty) && levl[tx][ty].typ == LAVAPOOL
- && ((tx == x && ty == y) || !rn2(2))) {
- levl[tx][ty].typ = ROOM;
- SpLev_Map[tx][ty] = 1;
- }
- }
-
- mkstairs(x, y, (char) up, g.coder->croom);
+ mkstairs(x, y, (char) up, g.coder->croom,
+ !(scoord & SP_COORD_IS_RANDOM));
}
return 0;
}