| 1699 | } |
| 1700 | |
| 1701 | staticfn void |
| 1702 | hmon_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: |
no test coverage detected