MCPcopy Index your code
hub / github.com/NetHack/NetHack / peffect_invisibility

Function peffect_invisibility

src/potion.c:810–838  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808}
809
810staticfn void
811peffect_invisibility(struct obj *otmp)
812{
813 boolean is_spell = (otmp->oclass == SPBOOK_CLASS);
814
815 /* spell cannot penetrate mummy wrapping */
816 if (is_spell && BInvis && uarmc->otyp == MUMMY_WRAPPING) {
817 You_feel("rather itchy under %s.", yname(uarmc));
818 return;
819 }
820 if (Invis || Blind || BInvis) {
821 gp.potion_nothing++;
822 } else {
823 self_invis_message();
824 }
825 if (otmp->blessed && !rn2(HInvis ? 15 : 30))
826 HInvis |= FROMOUTSIDE;
827 else
828 incr_itimeout(&HInvis, d(6 - 3 * bcsign(otmp), 100) + 100);
829 newsym(u.ux, u.uy); /* update position */
830 if (otmp->cursed) {
831 pline("For some reason, you feel your presence is known.");
832 aggravate();
833
834 /* doing this gives temporary invisibility, but removes permanent
835 invisibility */
836 HInvis &= ~FROMOUTSIDE;
837 }
838}
839
840staticfn void
841peffect_see_invisible(struct obj *otmp)

Callers 1

peffectsFunction · 0.85

Calls 10

You_feelFunction · 0.85
ynameFunction · 0.85
self_invis_messageFunction · 0.85
rn2Function · 0.85
incr_itimeoutFunction · 0.85
dFunction · 0.85
bcsignFunction · 0.85
newsymFunction · 0.85
aggravateFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected