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

Function tin_details

src/eat.c:1427–1458  ·  view source on GitHub ↗

* This assumes that buf already contains the word "tin", * as is the case with caller xname(). */

Source from the content-addressed store, hash-verified

1425 * as is the case with caller xname().
1426 */
1427void
1428tin_details(struct obj *obj, int mnum, char *buf)
1429{
1430 char buf2[BUFSZ];
1431
1432 if (!obj || !buf)
1433 return;
1434
1435 int r = tin_variety(obj, TRUE);
1436
1437 if (r == SPINACH_TIN)
1438 Strcat(buf, " of spinach");
1439 else if (mnum == NON_PM)
1440 Strcpy(buf, "empty tin");
1441 else {
1442 if ((obj->cknown || iflags.override_ID) && obj->spe < 0) {
1443 if (r == ROTTEN_TIN || r == HOMEMADE_TIN) {
1444 /* put these before the word tin */
1445 Sprintf(buf2, "%s %s of ", tintxts[r].txt, buf);
1446 Strcpy(buf, buf2);
1447 } else {
1448 Sprintf(eos(buf), " of %s ", tintxts[r].txt);
1449 }
1450 } else {
1451 Strcpy(eos(buf), " of ");
1452 }
1453 if (vegetarian(&mons[mnum]))
1454 Sprintf(eos(buf), "%s", mons[mnum].pmnames[NEUTRAL]);
1455 else
1456 Sprintf(eos(buf), "%s meat", mons[mnum].pmnames[NEUTRAL]);
1457 }
1458}
1459
1460void
1461set_tin_variety(struct obj *obj, int forcetype)

Callers 1

xname_flagsFunction · 0.85

Calls 2

tin_varietyFunction · 0.85
eosFunction · 0.85

Tested by

no test coverage detected