No secret doors or corridors on the early levels
New players often get stuck on the first level when they can't find the secret door or corridor. Make the first two levels have no such features.
This commit is contained in:
12
src/mklev.c
12
src/mklev.c
@@ -425,6 +425,7 @@ join(register int a, register int b, boolean nxcor)
|
||||
gs.smeq[a] = gs.smeq[b];
|
||||
}
|
||||
|
||||
/* create random corridors between rooms */
|
||||
void
|
||||
makecorridors(void)
|
||||
{
|
||||
@@ -447,6 +448,7 @@ makecorridors(void)
|
||||
any = TRUE;
|
||||
}
|
||||
}
|
||||
/* add some extra corridors which may be blocked off */
|
||||
if (gn.nroom > 2)
|
||||
for (i = rn2(gn.nroom) + 4; i; i--) {
|
||||
a = rn2(gn.nroom);
|
||||
@@ -1599,10 +1601,18 @@ okdoor(coordxy x, coordxy y)
|
||||
&& !near_door);
|
||||
}
|
||||
|
||||
/* do we want a secret door/corridor? */
|
||||
boolean
|
||||
maybe_sdoor(int chance)
|
||||
{
|
||||
return (depth(&u.uz) > 2) && !rn2(max(2, chance));
|
||||
}
|
||||
|
||||
/* create a door at x,y in room aroom */
|
||||
void
|
||||
dodoor(coordxy x, coordxy y, struct mkroom *aroom)
|
||||
{
|
||||
dosdoor(x, y, aroom, rn2(8) ? DOOR : SDOOR);
|
||||
dosdoor(x, y, aroom, maybe_sdoor(8) ? SDOOR : DOOR);
|
||||
}
|
||||
|
||||
boolean
|
||||
|
||||
10
src/sp_lev.c
10
src/sp_lev.c
@@ -2498,7 +2498,9 @@ search_door(
|
||||
}
|
||||
|
||||
/*
|
||||
* Dig a corridor between two points.
|
||||
* Dig a corridor between two points, using terrain ftyp.
|
||||
* if nxcor is TRUE, he corridor may be blocked by a boulder,
|
||||
* or just end without reaching the destination.
|
||||
*/
|
||||
boolean
|
||||
dig_corridor(
|
||||
@@ -2545,12 +2547,12 @@ dig_corridor(
|
||||
|
||||
crm = &levl[xx][yy];
|
||||
if (crm->typ == btyp) {
|
||||
if (ftyp != CORR || rn2(100)) {
|
||||
if (ftyp == CORR && maybe_sdoor(100)) {
|
||||
crm->typ = SCORR;
|
||||
} else {
|
||||
crm->typ = ftyp;
|
||||
if (nxcor && !rn2(50))
|
||||
(void) mksobj_at(BOULDER, xx, yy, TRUE, FALSE);
|
||||
} else {
|
||||
crm->typ = SCORR;
|
||||
}
|
||||
} else if (crm->typ != ftyp && crm->typ != SCORR) {
|
||||
/* strange ... */
|
||||
|
||||
Reference in New Issue
Block a user