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

Function recalc_telepat_range

src/worn.c:49–69  ·  view source on GitHub ↗

calc the range of hero's unblind telepathy */

Source from the content-addressed store, hash-verified

47
48/* calc the range of hero's unblind telepathy */
49void
50recalc_telepat_range(void)
51{
52 const struct worn *wp;
53 int nobjs = 0;
54
55 for (wp = worn; wp->w_mask; wp++) {
56 struct obj *oobj = *(wp->w_obj);
57
58 if (oobj && objects[oobj->otyp].oc_oprop == TELEPAT)
59 nobjs++;
60 }
61 /* count all artifacts with SPFX_ESP as one */
62 if (ETelepat & W_ART)
63 nobjs++;
64
65 if (nobjs)
66 u.unblind_telepat_range = (BOLT_LIM * BOLT_LIM) * nobjs;
67 else
68 u.unblind_telepat_range = -1;
69}
70
71/* Updated to use the extrinsic and blocked fields. */
72void

Callers 3

set_artifact_intrinsicFunction · 0.85
setwornFunction · 0.85
setnotwornFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected