describe monster's size for stethoscope/probing

Monster size affects knockback but it wasn't provided anywhere within
the game.  Have wand of probing and stethscope feedback for monsters
include tiny|small|medium|large|huge|gigantic as applicable.
This commit is contained in:
PatR
2023-05-10 02:23:57 -07:00
parent ead2f94d6e
commit 92ca5dbf71
2 changed files with 38 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1153 $ $NHDT-Date: 1681429662 2023/04/13 23:47:42 $ HDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.1177 $ $NHDT-Date: 1683710637 2023/05/10 09:23:57 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -2106,6 +2106,7 @@ add conduct for petless
preceding #overview with the 'm' prefix brings up the overview display as a preceding #overview with the 'm' prefix brings up the overview display as a
menu allowing selection of any visited level to #annotate; it also menu allowing selection of any visited level to #annotate; it also
shows every level visited rather than just the "interesting" ones shows every level visited rather than just the "interesting" ones
include monster size in feedback for wand of probing and stethoscope
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 insight.c $NHDT-Date: 1683116397 2023/05/03 12:19:57 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.94 $ */ /* NetHack 3.7 insight.c $NHDT-Date: 1683710630 2023/05/10 09:23:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -34,6 +34,7 @@ static void show_achievements(int);
static int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr); static int QSORTCALLBACK vanqsort_cmp(const genericptr, const genericptr);
static int num_extinct(void); static int num_extinct(void);
static int num_gone(int, int *); static int num_gone(int, int *);
static char *size_str(int);
extern const char *const hu_stat[]; /* hunger status from eat.c */ extern const char *const hu_stat[]; /* hunger status from eat.c */
extern const char *const enc_stat[]; /* encumbrance status from botl.c */ extern const char *const enc_stat[]; /* encumbrance status from botl.c */
@@ -3061,6 +3062,37 @@ align_str(aligntyp alignment)
return "unknown"; return "unknown";
} }
static char *
size_str(int msize)
{
static char outbuf[40];
switch (msize) {
case MZ_TINY:
Strcpy(outbuf, "tiny");
break;
case MZ_SMALL:
Strcpy(outbuf, "small");
break;
case MZ_MEDIUM:
Strcpy(outbuf, "medium");
break;
case MZ_LARGE:
Strcpy(outbuf, "large");
break;
case MZ_HUGE:
Strcpy(outbuf, "huge");
break;
case MZ_GIGANTIC:
Strcpy(outbuf, "gigantic");
break;
default:
Sprintf(outbuf, "unknown size (%d)", msize);
break;
}
return outbuf;
}
/* used for self-probing */ /* used for self-probing */
char * char *
piousness(boolean showneg, const char *suffix) piousness(boolean showneg, const char *suffix)
@@ -3220,9 +3252,9 @@ mstatusline(struct monst *mtmp)
Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *) 0, Strcpy(monnambuf, x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(SUPPRESS_IT | SUPPRESS_INVISIBLE), FALSE)); (SUPPRESS_IT | SUPPRESS_INVISIBLE), FALSE));
pline("Status of %s (%s): Level %d HP %d(%d) AC %d%s.", monnambuf, pline("Status of %s (%s, %s): Level %d HP %d(%d) AC %d%s.",
align_str(alignment), mtmp->m_lev, mtmp->mhp, mtmp->mhpmax, monnambuf, align_str(alignment), size_str(mtmp->data->msize),
find_mac(mtmp), info); mtmp->m_lev, mtmp->mhp, mtmp->mhpmax, find_mac(mtmp), info);
} }
/* stethoscope or probing applied to hero -- one-line feedback */ /* stethoscope or probing applied to hero -- one-line feedback */