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

Function arti_reflects

src/artifact.c:536–550  ·  view source on GitHub ↗

used to check whether a monster is getting reflection from an artifact */

Source from the content-addressed store, hash-verified

534
535/* used to check whether a monster is getting reflection from an artifact */
536boolean
537arti_reflects(struct obj *obj)
538{
539 const struct artifact *arti = get_artifact(obj);
540
541 if (arti != &artilist[ART_NONARTIFACT]) {
542 /* while being worn */
543 if ((obj->owornmask & ~W_ART) && (arti->spfx & SPFX_REFLECT))
544 return TRUE;
545 /* just being carried */
546 if (arti->cspfx & SPFX_REFLECT)
547 return TRUE;
548 }
549 return FALSE;
550}
551
552/* decide whether this obj is effective when attacking against shades;
553 does not consider the bonus for blessed objects versus undead */

Callers 1

mon_reflectsFunction · 0.85

Calls 1

get_artifactFunction · 0.85

Tested by

no test coverage detected