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

Function dump_artifact_info

src/artifact.c:1176–1209  ·  view source on GitHub ↗

(wizard mode only) show all artifacts and their flags */

Source from the content-addressed store, hash-verified

1174
1175/* (wizard mode only) show all artifacts and their flags */
1176void
1177dump_artifact_info(winid tmpwin)
1178{
1179 int m;
1180 char buf[BUFSZ], buf2[BUFSZ];
1181
1182 /* not a menu, but header uses same bold or whatever attribute as such */
1183 putstr(tmpwin, iflags.menu_headings.attr, "Artifacts");
1184 for (m = 1; m <= NROFARTIFACTS; ++m) {
1185 Snprintf(buf2, sizeof buf2,
1186 "[%s%s%s%s%s%s%s%s%s]", /* 9 bits overall */
1187 artiexist[m].exists ? "exists;" : "",
1188 artiexist[m].found ? " hero knows;" : "",
1189 /* .exists and .found have different punctuation because
1190 they're expected to be combined with one of these */
1191 artiexist[m].gift ? " gift" : "",
1192 artiexist[m].wish ? " wish" : "",
1193 artiexist[m].named ? " named" : "",
1194 artiexist[m].viadip ? " viadip" : "",
1195 artiexist[m].lvldef ? " lvldef" : "",
1196 artiexist[m].bones ? " bones" : "",
1197 artiexist[m].rndm ? " random" : "");
1198#if 0 /* 'tmpwin' here is a text window, not a menu */
1199 if (iflags.menu_tab_sep)
1200 Sprintf(buf, " %s\t%s", artiname(m), buf2);
1201 else
1202#else
1203 /* "The Platinum Yendorian Express Card" is 35 characters */
1204 Snprintf(buf, sizeof buf, " %-36.36s%s", artiname(m), buf2);
1205#endif
1206 putstr(tmpwin, 0, buf);
1207 }
1208 return;
1209}
1210
1211/*
1212 * Magicbane's intrinsic magic is incompatible with normal

Callers 1

doclassdiscoFunction · 0.85

Calls 1

artinameFunction · 0.85

Tested by

no test coverage detected