Merge branch 'little-fixups' of https://github.com/copperwater/NetHack into pr776

This commit is contained in:
nhmall
2022-05-28 13:53:12 -04:00
7 changed files with 19 additions and 22 deletions

View File

@@ -51,7 +51,6 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
]]);
-- Dungeon Description
des.region(selection.area(00,00,75,19), "lit")
des.region(selection.area(27,08,42,12), "lit")
-- Portal arrival point
des.levregion({ region = {66,17,66,17}, type="branch" })
-- Stairs

View File

@@ -1034,7 +1034,12 @@ dog_move(register struct monst *mtmp,
* 60% to 80%: up to level
* 40% to 60%: up to level - 1
* 25% to 40%: up to level - 2
* below 25%: prevented from attacking at all by a different case
* below 25%: won't attack peacefuls of any level (different case)
* below 20%: up to level - 3
*
* note that balk's maximum value is +3, as it is the lowest level
* the pet will balk at attacking rather than the highest level they
* are willing to attack; note the >= used when comparing it.
*/
int balk = mtmp->m_lev + ((5 * mtmp->mhp) / mtmp->mhpmax) - 2;

View File

@@ -1096,9 +1096,9 @@ dokick(void)
kick_dumb(x, y);
return ECMD_TIME;
}
if ((Luck < 0 || g.maploc->doormask) && !rn2(3)) {
if ((Luck < 0 || g.maploc->looted) && !rn2(3)) {
g.maploc->looted = 0; /* don't leave loose ends.. */
g.maploc->typ = ROOM;
g.maploc->doormask = 0; /* don't leave loose ends.. */
(void) mkgold((long) rnd(200), x, y);
if (Blind)
pline("CRASH! You destroy it.");

View File

@@ -600,7 +600,7 @@ pick_lock(
autounlock ? yname(pick) : "");
c = ynq(qbuf);
if (c != 'y')
return 0;
return PICKLOCK_DID_NOTHING;
/* note: for !autounlock, 'apply' already did touch check */
if (autounlock && !touch_artifact(pick, &g.youmonst))

View File

@@ -1273,7 +1273,7 @@ makemon(
case S_SNAKE:
if (g.in_mklev)
if (x && y)
(void) mkobj_at(0, x, y, TRUE);
(void) mkobj_at(RANDOM_CLASS, x, y, TRUE);
(void) hideunder(mtmp);
break;
case S_LIGHT:

View File

@@ -12,7 +12,7 @@
static boolean generate_stairs_room_good(struct mkroom *, int);
static struct mkroom *generate_stairs_find_room(void);
static void generate_stairs(void);
static void mkfount(int, struct mkroom *);
static void mkfount(struct mkroom *);
static boolean find_okay_roompos(struct mkroom *, coord *);
static void mksink(struct mkroom *);
static void mkaltar(struct mkroom *);
@@ -635,7 +635,7 @@ makeniche(int trap_type)
(void) mksobj_at(SCR_TELEPORTATION, xx, yy + dy, TRUE,
FALSE);
if (!rn2(3))
(void) mkobj_at(0, xx, yy + dy, TRUE);
(void) mkobj_at(RANDOM_CLASS, xx, yy + dy, TRUE);
}
}
return;
@@ -789,7 +789,7 @@ fill_ordinary_room(struct mkroom *croom)
if (Is_rogue_level(&u.uz))
goto skip_nonrogue;
if (!rn2(10))
mkfount(0, croom);
mkfount(croom);
if (!rn2(60))
mksink(croom);
if (!rn2(60))
@@ -833,14 +833,14 @@ fill_ordinary_room(struct mkroom *croom)
skip_nonrogue:
if (!rn2(3) && somexyspace(croom, &pos)) {
(void) mkobj_at(0, pos.x, pos.y, TRUE);
(void) mkobj_at(RANDOM_CLASS, pos.x, pos.y, TRUE);
trycnt = 0;
while (!rn2(5)) {
if (++trycnt > 100) {
impossible("trycnt overflow4");
break;
}
(void) mkobj_at(0, pos.x, pos.y, TRUE);
(void) mkobj_at(RANDOM_CLASS, pos.x, pos.y, TRUE);
}
}
}
@@ -1752,19 +1752,12 @@ generate_stairs(void)
}
static void
mkfount(int mazeflag, struct mkroom *croom)
mkfount(struct mkroom *croom)
{
coord m;
register int tryct = 0;
do {
if (++tryct > 200)
return;
if (mazeflag)
mazexy(&m);
else if (!somexy(croom, &m))
return;
} while (occupied(m.x, m.y) || bydoor(m.x, m.y));
if (!find_okay_roompos(croom, &m))
return;
/* Put a fountain at m.x, m.y */
if (!set_levltyp(m.x, m.y, FOUNTAIN))

View File

@@ -1101,7 +1101,7 @@ makemaz(const char *s)
for (x = rn1(8, 11); x; x--) {
mazexy(&mm);
(void) mkobj_at(rn2(2) ? GEM_CLASS : 0, mm.x, mm.y, TRUE);
(void) mkobj_at(rn2(2) ? GEM_CLASS : RANDOM_CLASS, mm.x, mm.y, TRUE);
}
for (x = rn1(10, 2); x; x--) {
mazexy(&mm);