segment feedback when probing long worms

When using a stethoscope or wand of probing on a long worm, report
the number of segments it has in the feedback given.

Some of the extra bhitpos and/or notonhead assigments may not be
necessary.  They were added when I was trying to figure out the
question of why probing of a tail segment revealed a long worm's
inventory even though the code explicitly prevents that.  (Answer:
it didn't; I had misinterpreted bz 12 to think that that was what
was being reported.  You need to use wand of probing--or "insigtful"
Magicbane hit--on the head in order to see its inventory or be told
"not carrying anything".)
This commit is contained in:
PatR
2016-02-26 15:16:49 -08:00
parent 0d7e51e88a
commit a00c8068f0
6 changed files with 84 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1456526104 2016/02/26 22:35:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.221 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1456528594 2016/02/26 23:16:34 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.222 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -323,6 +323,8 @@ register struct obj *obj;
context.stethoscope_move = moves;
context.stethoscope_movement = youmonst.movement;
bhitpos.x = u.ux, bhitpos.y = u.uy; /* tentative, reset below */
notonhead = u.uswallow;
if (u.usteed && u.dz > 0) {
if (interference) {
pline("%s interferes.", Monnam(u.ustuck));
@@ -369,6 +371,10 @@ register struct obj *obj;
const char *mnm = x_monnam(mtmp, ARTICLE_A, (const char *) 0,
SUPPRESS_IT | SUPPRESS_INVISIBLE, FALSE);
/* bhitpos needed by mstatusline() iff mtmp is a long worm */
bhitpos.x = rx, bhitpos.y = ry;
notonhead = (mtmp->mx != rx || mtmp->my != ry);
if (mtmp->mundetected) {
if (!canspotmon(mtmp))
There("is %s hidden there.", mnm);
@@ -393,6 +399,7 @@ register struct obj *obj;
} else if (flags.verbose && !canspotmon(mtmp)) {
There("is %s there.", mnm);
}
mstatusline(mtmp);
if (!canspotmon(mtmp))
map_invisible(rx, ry);
@@ -403,6 +410,7 @@ register struct obj *obj;
newsym(rx, ry);
pline_The("invisible monster must have moved.");
}
lev = &levl[rx][ry];
switch (lev->typ) {
case SDOOR: