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

Function arti_immune

src/artifact.c:978–990  ·  view source on GitHub ↗

decide whether an artifact itself is vulnerable to a particular type of erosion damage, independent of the properties of its bearer */

Source from the content-addressed store, hash-verified

976/* decide whether an artifact itself is vulnerable to a particular type
977 of erosion damage, independent of the properties of its bearer */
978boolean
979arti_immune(struct obj *obj, int dtyp)
980{
981 const struct artifact *weap = get_artifact(obj);
982
983 if (weap == &artilist[ART_NONARTIFACT])
984 return FALSE;
985 if (dtyp == AD_PHYS)
986 return FALSE; /* nothing is immune to phys dmg */
987 return (boolean) (weap->attk.adtyp == dtyp
988 || weap->defn.adtyp == dtyp
989 || weap->cary.adtyp == dtyp);
990}
991
992staticfn boolean
993bane_applies(const struct artifact *oart, struct monst *mon)

Callers

nothing calls this directly

Calls 1

get_artifactFunction · 0.85

Tested by

no test coverage detected