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

Function hmon_hitmon_msg_lightobj

src/uhitm.c:1701–1730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1699}
1700
1701staticfn void
1702hmon_hitmon_msg_lightobj(
1703 struct _hitmon_data *hmd,
1704 struct monst *mon,
1705 struct obj *obj UNUSED)
1706{
1707 const char *fmt;
1708 char *whom = mon_nam(mon);
1709 char emitlightobjbuf[BUFSZ];
1710
1711 if (canspotmon(mon)) {
1712 if (hmd->saved_oname[0]) {
1713 Sprintf(emitlightobjbuf,
1714 "%s radiance penetrates deep into",
1715 s_suffix(hmd->saved_oname));
1716 Strcat(emitlightobjbuf, " %s!");
1717 fmt = emitlightobjbuf;
1718 } else
1719 fmt = "The light sears %s!";
1720 } else {
1721 *whom = highc(*whom); /* "it" -> "It" */
1722 fmt = "%s is seared!";
1723 }
1724 /* note: s_suffix returns a modifiable buffer */
1725 if (!noncorporeal(hmd->mdat) && !amorphous(hmd->mdat))
1726 whom = strcat(s_suffix(whom), " flesh");
1727 DISABLE_WARNING_FORMAT_NONLITERAL
1728 pline(fmt, whom);
1729 RESTORE_WARNING_FORMAT_NONLITERAL
1730}
1731
1732/*
1733 * These will segfault if passed a NULL obj pointer:

Callers 1

hmon_hitmonFunction · 0.85

Calls 3

mon_namFunction · 0.85
s_suffixFunction · 0.85
highcFunction · 0.85

Tested by

no test coverage detected