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:
Pasi Kallinen
2024-02-18 11:44:55 +02:00
parent 2e6802d2b3
commit 2952bdab63
4 changed files with 19 additions and 5 deletions

View File

@@ -1362,6 +1362,7 @@ if confused #loot while on a throne moved whole stack of quivered gold into
leading to crash when quiver was subsequently accessed
when filling quiver slot, don't bother asking "what do you want to ready?" if
invent is empty
no secret doors or corridors on the first two dungeon levels
Fixes to 3.7.0-x General Problems Exposed Via git Repository

View File

@@ -1531,6 +1531,7 @@ extern void topologize(struct mkroom *) NONNULLARG1;
extern void place_branch(branch *, coordxy, coordxy) NO_NNARGS;
extern boolean occupied(coordxy, coordxy);
extern int okdoor(coordxy, coordxy);
extern boolean maybe_sdoor(int);
extern void dodoor(coordxy, coordxy, struct mkroom *) NONNULLARG3;
extern void mktrap(int, unsigned, struct mkroom *, coord *) NO_NNARGS;
extern void mkstairs(coordxy, coordxy, char, struct mkroom *, boolean);

View File

@@ -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

View File

@@ -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 ... */