* This assumes that buf already contains the word "tin", * as is the case with caller xname(). */
| 1425 | * as is the case with caller xname(). |
| 1426 | */ |
| 1427 | void |
| 1428 | tin_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 | |
| 1460 | void |
| 1461 | set_tin_variety(struct obj *obj, int forcetype) |
no test coverage detected