From 3ed51c2718ee8aef407af4d4aaa604c064c40af0 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 9 Jan 2020 16:59:30 -0800 Subject: [PATCH] enhanced look-at-self ^X reports whether you're caught in a trap, but neither looking at yourself (via '//' or ';' or other getpos autodescribe) nor looking "here" (via ':') said anything about that. Make looking at yourself do so. --- src/pager.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/pager.c b/src/pager.c index 24e0e2783..48bdda9d0 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 pager.c $NHDT-Date: 1578137709 2020/01/04 11:35:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.179 $ */ +/* NetHack 3.6 pager.c $NHDT-Date: 1578617964 2020/01/10 00:59:24 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.180 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -91,6 +91,23 @@ char *outbuf; Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed)); if (u.uundetected || (Upolyd && U_AP_TYPE)) mhidden_description(&g.youmonst, FALSE, eos(outbuf)); + if (Punished) + Sprintf(eos(outbuf), ", chained to %s", + uball ? ansimpleoname(uball) : "nothing?"); + if (u.utrap) { + if (u.utraptype == TT_BURIEDBALL) { + Strcat(outbuf, ", tethered to something buried"); + } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) { + Sprintf(eos(outbuf), ", stuck in %s", the(surface(u.ux, u.uy))); + } else { /* bear trap, [spiked] pit, or web */ + struct trap *t = t_at(u.ux, u.uy); + + Strcat(outbuf, ", trapped"); + if (t) + Sprintf(eos(outbuf), " in %s", + an(trapname(t->ttyp, FALSE))); + } + } return outbuf; } @@ -106,7 +123,7 @@ char *outbuf; boolean fakeobj, isyou = (mon == &g.youmonst); int x = isyou ? u.ux : mon->mx, y = isyou ? u.uy : mon->my, glyph = (g.level.flags.hero_memory && !isyou) ? levl[x][y].glyph - : glyph_at(x, y); + : glyph_at(x, y); *outbuf = '\0'; if (M_AP_TYPE(mon) == M_AP_FURNITURE @@ -144,8 +161,7 @@ char *outbuf; Strcat(outbuf, something); } else if (is_hider(mon->data)) { Sprintf(eos(outbuf), " on the %s", - (is_flyer(mon->data) || mon->data->mlet == S_PIERCER) - ? "ceiling" + ceiling_hider(mon->data) ? "ceiling" : surface(x, y)); /* trapper */ } else { if (mon->data->mlet == S_EEL && is_pool(x, y))