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

Function attrval

src/insight.c:286–299  ·  view source on GitHub ↗

format a characteristic value, accommodating Strength's strangeness */

Source from the content-addressed store, hash-verified

284
285/* format a characteristic value, accommodating Strength's strangeness */
286staticfn char *
287attrval(
288 int attrindx,
289 int attrvalue,
290 char resultbuf[]) /* should be at least [7] to hold "18/100\0" */
291{
292 if (attrindx != A_STR || attrvalue <= 18)
293 Sprintf(resultbuf, "%d", attrvalue);
294 else if (attrvalue > STR18(100)) /* 19 to 25 */
295 Sprintf(resultbuf, "%d", attrvalue - 100);
296 else /* simplify "18/\**" to be "18/100" */
297 Sprintf(resultbuf, "18/%02d", attrvalue - 18);
298 return resultbuf;
299}
300
301/* format urealtime.realtime as
302 " D days, H hours, M minutes and S seconds"

Callers 1

one_characteristicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected