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

Function shade_glare

src/artifact.c:554–571  ·  view source on GitHub ↗

decide whether this obj is effective when attacking against shades; does not consider the bonus for blessed objects versus undead */

Source from the content-addressed store, hash-verified

552/* decide whether this obj is effective when attacking against shades;
553 does not consider the bonus for blessed objects versus undead */
554boolean
555shade_glare(struct obj *obj)
556{
557 const struct artifact *arti;
558
559 /* any silver object is effective */
560 if (objects[obj->otyp].oc_material == SILVER)
561 return TRUE;
562 /* non-silver artifacts with bonus against undead also are effective */
563 arti = get_artifact(obj);
564 if (arti != &artilist[ART_NONARTIFACT] && (arti->spfx & SPFX_DFLAG2)
565 && arti->mtype == M2_UNDEAD)
566 return TRUE;
567 /* [if there was anything with special bonus against noncorporeals,
568 it would be effective too] */
569 /* otherwise, harmless to shades */
570 return FALSE;
571}
572
573/* returns 1 if name is restricted for otmp->otyp */
574boolean

Callers 2

dmgvalFunction · 0.85

Calls 1

get_artifactFunction · 0.85

Tested by

no test coverage detected