display a list of discovered artifacts; return their count */
| 1144 | |
| 1145 | /* display a list of discovered artifacts; return their count */ |
| 1146 | int |
| 1147 | disp_artifact_discoveries( |
| 1148 | winid tmpwin) /* supplied by dodiscover(); type is NHW_TEXT */ |
| 1149 | { |
| 1150 | int i, m, otyp; |
| 1151 | const char *algnstr; |
| 1152 | char buf[BUFSZ]; |
| 1153 | |
| 1154 | for (i = 0; i < NROFARTIFACTS; i++) { |
| 1155 | if (artidisco[i] == 0) |
| 1156 | break; /* empty slot implies end of list */ |
| 1157 | if (tmpwin == WIN_ERR) |
| 1158 | continue; /* for WIN_ERR, we just count */ |
| 1159 | |
| 1160 | if (i == 0) |
| 1161 | putstr(tmpwin, iflags.menu_headings.attr, "Artifacts"); |
| 1162 | m = artidisco[i]; |
| 1163 | otyp = artilist[m].otyp; |
| 1164 | algnstr = align_str(artilist[m].alignment); |
| 1165 | if (!strcmp(algnstr, "unaligned")) |
| 1166 | algnstr = "non-aligned"; |
| 1167 | |
| 1168 | Sprintf(buf, " %s [%s %s]", artiname(m), |
| 1169 | algnstr, simple_typename(otyp)); |
| 1170 | putstr(tmpwin, 0, buf); |
| 1171 | } |
| 1172 | return i; |
| 1173 | } |
| 1174 | |
| 1175 | /* (wizard mode only) show all artifacts and their flags */ |
| 1176 | void |
no test coverage detected