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

Function get_artifact

src/artifact.c:2820–2833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2818 : &artilist[ART_NONARTIFACT]) */
2819
2820staticfn struct artifact *
2821get_artifact(struct obj *obj)
2822{
2823 if (obj) {
2824 int artidx = (int) obj->oartifact;
2825
2826 /* skip 0, 1st artifact at 1 */
2827 /* SIZE(artilist) would include the terminator,
2828 so use AFTER_LAST_ARTIFACT instead */
2829 if (artidx > 0 && artidx < AFTER_LAST_ARTIFACT)
2830 return &artilist[artidx];
2831 }
2832 return &artilist[ART_NONARTIFACT];
2833}
2834
2835/* is object permanently poisoned? (currently only Grimtooth) */
2836boolean

Callers 15

spec_abilityFunction · 0.85
arti_reflectsFunction · 0.85
shade_glareFunction · 0.85
attacksFunction · 0.85
defendsFunction · 0.85
defends_when_carriedFunction · 0.85
protectsFunction · 0.85
set_artifact_intrinsicFunction · 0.85
touch_artifactFunction · 0.85
arti_immuneFunction · 0.85
spec_m2Function · 0.85
spec_abonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected