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

Function random_engraving

src/engrave.c:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48staticfn const char *blengr(void);
49
50char *
51random_engraving(char *outbuf, char *pristine_copy)
52{
53 const char *rumor;
54
55 /* a random engraving may come from the "rumors" file,
56 or from the "engrave" file (formerly in an array here) */
57 if (!rn2(4) || !(rumor = getrumor(0, pristine_copy, TRUE)) || !*rumor)
58 (void) get_rnd_text(ENGRAVEFILE, pristine_copy, rn2, MD_PAD_RUMORS);
59
60 Strcpy(outbuf, pristine_copy);
61 wipeout_text(outbuf, (int) (strlen(outbuf) / 4), 0);
62 return outbuf;
63}
64
65/* Partial rubouts for engraving characters. -3. */
66static const struct {

Callers 3

doengrave_sfx_item_WANFunction · 0.85
zap_mapFunction · 0.85
fill_ordinary_roomFunction · 0.85

Calls 4

rn2Function · 0.85
getrumorFunction · 0.85
get_rnd_textFunction · 0.85
wipeout_textFunction · 0.85

Tested by

no test coverage detected