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

Function enlght_line

src/insight.c:126–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126staticfn void
127enlght_line(
128 const char *start,
129 const char *middle,
130 const char *end,
131 const char *ps)
132{
133#ifndef NO_ENLGHT_CONTRACTIONS
134 static const struct contrctn {
135 const char *twowords, *contrctn;
136 } contra[] = {
137 { " are not ", " aren't " },
138 { " were not ", " weren't " },
139 { " have not ", " haven't " },
140 { " had not ", " hadn't " },
141 { " can not ", " can't " },
142 { " could not ", " couldn't " },
143 };
144 int i;
145#endif
146 char buf[BUFSZ];
147
148 Sprintf(buf, " %s%s%s%s.", start, middle, end, ps);
149#ifndef NO_ENLGHT_CONTRACTIONS
150 if (strstri(buf, " not ")) { /* TODO: switch to libc strstr() */
151 for (i = 0; i < SIZE(contra); ++i)
152 (void) strsubst(buf, contra[i].twowords, contra[i].contrctn);
153 }
154#endif
155 enlght_out(buf);
156}
157
158/* format increased chance to hit or damage or defense (Protection) */
159staticfn char *

Callers 1

background_enlightenmentFunction · 0.85

Calls 3

strstriFunction · 0.85
strsubstFunction · 0.85
enlght_outFunction · 0.85

Tested by

no test coverage detected