fix bz 12 - long worm inventory feedback

I initially misunderstood this bug report about a nymph who was
polymorphed into a long worm while carrying a cursed figurine.
It wasn't about a long worm having inventory or about probing of
the worm's tail revealing that it had inventory, it was about the
message given when the cursed figurine activated itself.  If that
happened while the head was out of view but at least one tail
segment was visible, the message about the new monster emerging
from the long worm's backpack implied that that pack was carried
by the tail segment.

Only give the emerge-from-backpack message when the worm's head
is visible.  Likewise if a carried egg hatches.
This commit is contained in:
PatR
2016-02-26 14:37:07 -08:00
parent 45d1a45458
commit 0d7e51e88a
3 changed files with 18 additions and 9 deletions

View File

@@ -165,6 +165,10 @@ when examining hidden monsters (probing, persistent monster detection), tell
some quest text corrections
use a much tighter upper bound when summoning nasties; old method could
theoretically create 200 critters at a time
if a long worm inherited inventory from a previous shape, and if an egg or
figurine in that inventory hatched or auto-activated, messages were
given when hero could see any tail segment even if head was unseen,
making it seem as if worm's inventory was kept in the visible segment
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 apply.c $NHDT-Date: 1455140802 2016/02/10 21:46:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.220 $ */
/* NetHack 3.6 apply.c $NHDT-Date: 1456526104 2016/02/26 22:35:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.221 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1966,8 +1966,8 @@ long timeout;
if (mtmp) {
char and_vanish[BUFSZ];
struct obj *mshelter = level.objects[mtmp->mx][mtmp->my];
Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
Sprintf(monnambuf, "%s", an(m_monnam(mtmp)));
and_vanish[0] = '\0';
if ((mtmp->minvis && !See_invisible)
|| (mtmp->data->mlet == S_MIMIC
@@ -2009,11 +2009,13 @@ long timeout;
case OBJ_MINVENT:
if (cansee_spot && !silent && !suppress_see) {
struct monst *mon;
mon = figurine->ocarry;
/* figurine carrying monster might be invisible */
if (canseemon(figurine->ocarry)) {
if (canseemon(figurine->ocarry)
&& (!mon->wormno || cansee(mon->mx, mon->my)))
Sprintf(carriedby, "%s pack", s_suffix(a_monnam(mon)));
} else if (is_pool(mon->mx, mon->my))
else if (is_pool(mon->mx, mon->my))
Strcpy(carriedby, "empty water");
else
Strcpy(carriedby, "thin air");

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 timeout.c $NHDT-Date: 1452660198 2016/01/13 04:43:18 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.64 $ */
/* NetHack 3.6 timeout.c $NHDT-Date: 1456526165 2016/02/26 22:36:05 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.65 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -614,14 +614,17 @@ long timeout;
case OBJ_MINVENT:
if (cansee_hatchspot) {
/* egg carrying monster might be invisible */
if (canseemon(egg->ocarry)) {
mon2 = egg->ocarry;
if (canseemon(mon2)
&& (!mon2->wormno || cansee(mon2->mx, mon2->my))) {
Sprintf(carriedby, "%s pack",
s_suffix(a_monnam(egg->ocarry)));
s_suffix(a_monnam(mon2)));
knows_egg = TRUE;
} else if (is_pool(mon->mx, mon->my))
} else if (is_pool(mon->mx, mon->my)) {
Strcpy(carriedby, "empty water");
else
} else {
Strcpy(carriedby, "thin air");
}
You_see("%s %s out of %s!", monnambuf,
locomotion(mon->data, "drop"), carriedby);
}