diff --git a/include/extern.h b/include/extern.h index d2d020ffe..1ff918be4 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3757,6 +3757,7 @@ extern void flip_worm_segs_horizontal(struct monst *, int, int) NONNULLARG1; /* ### worn.c ### */ +extern void recalc_telepat_range(void); extern void setworn(struct obj *, long) NO_NNARGS; /* has tests for obj */ extern void setnotworn(struct obj *) NO_NNARGS; /* has tests for obj */ extern void allunworn(void); diff --git a/src/artifact.c b/src/artifact.c index 54c3e8066..40b46a44d 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -711,6 +711,7 @@ set_artifact_intrinsic(struct obj *otmp, boolean on, long wp_mask) ETelepat |= wp_mask; else ETelepat &= ~wp_mask; + recalc_telepat_range(); see_monsters(); } if (spfx & SPFX_STLTH) { diff --git a/src/worn.c b/src/worn.c index 3ab06ac2b..87ed95ffd 100644 --- a/src/worn.c +++ b/src/worn.c @@ -5,7 +5,6 @@ #include "hack.h" -staticfn void recalc_telepat_range(void); staticfn void m_lose_armor(struct monst *, struct obj *, boolean) NONNULLPTRS; staticfn void clear_bypass(struct obj *) NO_NNARGS; staticfn void m_dowear_type(struct monst *, long, boolean, boolean) NONNULLARG1; @@ -46,7 +45,7 @@ static const struct worn { has no significant effect on their use of w_blocks() */ /* calc the range of hero's unblind telepathy */ -staticfn void +void recalc_telepat_range(void) { const struct worn *wp; @@ -58,6 +57,10 @@ recalc_telepat_range(void) if (oobj && objects[oobj->otyp].oc_oprop == TELEPAT) nobjs++; } + /* count all artifacts with SPFX_ESP as one */ + if (ETelepat & W_ART) + nobjs++; + if (nobjs) u.unblind_telepat_range = (BOLT_LIM * BOLT_LIM) * nobjs; else