positive value: class; negative value: specific object type. can also return non-existing object class (eg. VEGETARIAN_CLASS) */
| 826 | /* positive value: class; negative value: specific object type. |
| 827 | can also return non-existing object class (eg. VEGETARIAN_CLASS) */ |
| 828 | int |
| 829 | get_shop_item(int type) |
| 830 | { |
| 831 | const struct shclass *shp = shtypes + type; |
| 832 | int i, j; |
| 833 | |
| 834 | /* select an appropriate object type at random */ |
| 835 | for (j = rnd(100), i = 0; (j -= shp->iprobs[i].iprob) > 0; i++) |
| 836 | continue; |
| 837 | |
| 838 | return shp->iprobs[i].itype; |
| 839 | } |
| 840 | |
| 841 | /* version of shkname() for beginning of sentence */ |
| 842 | char * |
no test coverage detected