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

Function disp_artifact_discoveries

src/artifact.c:1146–1173  ·  view source on GitHub ↗

display a list of discovered artifacts; return their count */

Source from the content-addressed store, hash-verified

1144
1145/* display a list of discovered artifacts; return their count */
1146int
1147disp_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 */
1176void

Callers 2

dodiscoveredFunction · 0.85
doclassdiscoFunction · 0.85

Calls 3

align_strFunction · 0.85
artinameFunction · 0.85
simple_typenameFunction · 0.85

Tested by

no test coverage detected