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

Function discover_artifact

src/artifact.c:1112–1127  ·  view source on GitHub ↗

add identified artifact to discoveries list */

Source from the content-addressed store, hash-verified

1110
1111/* add identified artifact to discoveries list */
1112void
1113discover_artifact(xint16 m)
1114{
1115 int i;
1116
1117 /* look for this artifact in the discoveries list;
1118 if we hit an empty slot then it's not present, so add it */
1119 for (i = 0; i < NROFARTIFACTS; i++)
1120 if (artidisco[i] == 0 || artidisco[i] == m) {
1121 artidisco[i] = m;
1122 return;
1123 }
1124 /* there is one slot per artifact, so we should never reach the
1125 end without either finding the artifact or an empty slot... */
1126 impossible("couldn't discover artifact (%d)", (int) m);
1127}
1128
1129/* used to decide whether an artifact has been fully identified */
1130boolean

Callers 4

gcrownuFunction · 0.85
bestow_artifactFunction · 0.85
fully_identify_objFunction · 0.85
dipfountainFunction · 0.85

Calls 1

impossibleFunction · 0.70

Tested by

no test coverage detected