MCPcopy Create free account
hub / github.com/NetHack/NetHack / self_lookat

Function self_lookat

src/pager.c:107–133  ·  view source on GitHub ↗

shared by monster probing (via query_objlist!) as well as lookat() */

Source from the content-addressed store, hash-verified

105
106/* shared by monster probing (via query_objlist!) as well as lookat() */
107char *
108self_lookat(char *outbuf)
109{
110 char race[QBUFSZ], trapbuf[QBUFSZ];
111
112 /* include race with role unless polymorphed */
113 race[0] = '\0';
114 if (!Upolyd)
115 Sprintf(race, "%s ", gu.urace.adj);
116 Sprintf(outbuf, "%s%s%s called %s",
117 /* being blinded may hide invisibility from self */
118 (Invis && (senseself() || !Blind)) ? "invisible " : "", race,
119 pmname(&mons[u.umonnum], Ugender), svp.plname);
120 if (u.usteed)
121 Sprintf(eos(outbuf), ", mounted on %s", y_monnam(u.usteed));
122 if (u.uundetected || (Upolyd && U_AP_TYPE)
123 || visible_region_at(u.ux, u.uy))
124 mhidden_description(&gy.youmonst,
125 MHID_PREFIX | MHID_ARTICLE | MHID_REGION,
126 eos(outbuf));
127 if (Punished)
128 Sprintf(eos(outbuf), ", chained to %s",
129 uball ? ansimpleoname(uball) : "nothing?");
130 if (u.utrap) /* bear trap, pit, web, in-floor, in-lava, tethered */
131 Sprintf(eos(outbuf), ", %s", trap_predicament(trapbuf, 0, FALSE));
132 return outbuf;
133}
134
135/* format a description of 'mon's health for look_at_monster(), done_in_by();
136 result isn't Healer-specific (not trained for arbitrary creatures) */

Callers 3

query_objlistFunction · 0.85
lookatFunction · 0.85
look_allFunction · 0.85

Calls 7

pmnameFunction · 0.85
eosFunction · 0.85
y_monnamFunction · 0.85
visible_region_atFunction · 0.85
mhidden_descriptionFunction · 0.85
ansimpleonameFunction · 0.85
trap_predicamentFunction · 0.85

Tested by

no test coverage detected