MCPcopy Index your code
hub / github.com/NetHack/NetHack / fruitname

Function fruitname

src/objnam.c:413–427  ·  view source on GitHub ↗

convert player specified fruit name into corresponding fruit juice name ("slice of pizza" -> "pizza juice" rather than "slice of pizza juice") */

Source from the content-addressed store, hash-verified

411/* convert player specified fruit name into corresponding fruit juice name
412 ("slice of pizza" -> "pizza juice" rather than "slice of pizza juice") */
413char *
414fruitname(
415 boolean juice) /* whether or not to append " juice" to the name */
416{
417 char *buf = nextobuf();
418 const char *fruit_nam = strstri(svp.pl_fruit, " of ");
419
420 if (fruit_nam)
421 fruit_nam += 4; /* skip past " of " */
422 else
423 fruit_nam = svp.pl_fruit; /* use it as is */
424
425 Sprintf(buf, "%s%s", makesingular(fruit_nam), juice ? " juice" : "");
426 return buf;
427}
428
429/* look up a named fruit by index (1..127) */
430struct fruit *

Callers 4

peffect_see_invisibleFunction · 0.85
peffect_sicknessFunction · 0.85
dosinkringFunction · 0.85
drinkfountainFunction · 0.85

Calls 3

nextobufFunction · 0.85
strstriFunction · 0.85
makesingularFunction · 0.85

Tested by

no test coverage detected