improve x_monnam results when swallowed

This addresses one of the scenarios that had previously been discussed
in the comments under pull request #979.
This commit is contained in:
nhmall
2023-11-10 17:01:46 -05:00
parent f360cb24b1
commit 088c15b3cd
2 changed files with 11 additions and 1 deletions

View File

@@ -1967,6 +1967,16 @@ x_monnam(
if (article == ARTICLE_YOUR && !mtmp->mtame)
article = ARTICLE_THE;
if (mtmp == u.ustuck) {
/*
* This monster has become important, for the moment anyway.
* As the hero's consumer, it is worthy of ARTICLE_THE.
* Also, suppress invisible as that particular characteristic
* is unimportant now and you can see it's interior anyway.
*/
article = ARTICLE_THE;
suppress |= SUPPRESS_INVISIBLE;
}
do_hallu = Hallucination && !(suppress & SUPPRESS_HALLUCINATION);
do_invis = mtmp->minvis && !(suppress & SUPPRESS_INVISIBLE);
do_it = !canspotmon(mtmp) && article != ARTICLE_YOUR

View File

@@ -622,7 +622,7 @@ lookat(coordxy x, coordxy y, char *buf, char *monbuf)
} else if (u.uswallow) {
/* when swallowed, we're only called for spots adjacent to hero,
and blindness doesn't prevent hero from feeling what holds him */
Sprintf(buf, "interior of %s", a_monnam(u.ustuck));
Sprintf(buf, "interior of %s", mon_nam(u.ustuck));
pm = u.ustuck->data;
} else if (glyph_is_monster(glyph)) {
gb.bhitpos.x = x;