MCPcopy Index your code
hub / github.com/NetHack/NetHack / trap_description

Function trap_description

src/pager.c:166–181  ·  view source on GitHub ↗

copy a trap's description into outbuf[] */

Source from the content-addressed store, hash-verified

164
165/* copy a trap's description into outbuf[] */
166staticfn void
167trap_description(char *outbuf, int tnum, coordxy x, coordxy y)
168{
169 /*
170 * Trap detection used to display a bear trap at locations having
171 * a trapped door or trapped container or both. They're semi-real
172 * traps now (defined trap types but not part of ftrap chain).
173 */
174 if (trapped_chest_at(tnum, x, y))
175 Strcpy(outbuf, "trapped chest"); /* might actually be a large box */
176 else if (trapped_door_at(tnum, x, y))
177 Strcpy(outbuf, "trapped door"); /* not "trap door"... */
178 else
179 Strcpy(outbuf, trapname(tnum, FALSE));
180 return;
181}
182
183/* describe a hidden monster; used for look_at during extended monster
184 detection and for probing; also when looking at self and camera feedback */

Callers 2

lookatFunction · 0.85
look_trapsFunction · 0.85

Calls 3

trapped_chest_atFunction · 0.85
trapped_door_atFunction · 0.85
trapnameFunction · 0.85

Tested by

no test coverage detected