| 1486 | } |
| 1487 | |
| 1488 | staticfn int |
| 1489 | tin_variety( |
| 1490 | struct obj *obj, |
| 1491 | boolean displ) /* we're just displaying so leave things alone */ |
| 1492 | { |
| 1493 | int r, mnum = obj->corpsenm; |
| 1494 | |
| 1495 | if (obj->spe == 1) { |
| 1496 | r = SPINACH_TIN; |
| 1497 | } else if (obj->cursed) { |
| 1498 | r = ROTTEN_TIN; /* always rotten if cursed */ |
| 1499 | } else if (obj->spe < 0) { |
| 1500 | r = -(obj->spe); |
| 1501 | --r; /* get rid of the offset */ |
| 1502 | } else { |
| 1503 | r = rn2(TTSZ - 1); |
| 1504 | } |
| 1505 | |
| 1506 | if (!displ && r == HOMEMADE_TIN && !obj->blessed && !rn2(7)) |
| 1507 | r = ROTTEN_TIN; /* some homemade tins go bad */ |
| 1508 | |
| 1509 | if (r == ROTTEN_TIN && (ismnum(mnum) && nonrotting_corpse(mnum))) |
| 1510 | r = HOMEMADE_TIN; /* lizards don't rot */ |
| 1511 | return r; |
| 1512 | } |
| 1513 | |
| 1514 | /* finish consume_tin(); also potentially used by cprefx() and cpostfx() */ |
| 1515 | staticfn void |
no test coverage detected