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

Function peffect_see_invisible

src/potion.c:840–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

838}
839
840staticfn void
841peffect_see_invisible(struct obj *otmp)
842{
843 int msg = Invisible && !Blind;
844 int permchance = 10 - (HInvis ? 3 : 0) - (HSee_invisible ? 6 : 0);
845
846 gp.potion_unkn++;
847 if (otmp->cursed)
848 pline("Yecch! This tastes %s.",
849 Hallucination ? "overripe" : "rotten");
850 else
851 pline(
852 Hallucination
853 ? "This tastes like 10%% real %s%s all-natural beverage."
854 : "This tastes like %s%s.",
855 otmp->odiluted ? "reconstituted " : "", fruitname(TRUE));
856 if (otmp->otyp == POT_FRUIT_JUICE) {
857 u.uhunger += (otmp->odiluted ? 5 : 10) * (2 + bcsign(otmp));
858 newuhs(FALSE);
859 return;
860 }
861 if (!otmp->cursed) {
862 /* Tell them they can see again immediately, which
863 * will help them identify the potion...
864 */
865 make_blinded(0L, TRUE);
866 }
867 if (otmp->blessed && !rn2(permchance))
868 HSee_invisible |= FROMOUTSIDE;
869 else
870 incr_itimeout(&HSee_invisible, rn1(100, 750));
871 set_mimic_blocking(); /* do special mimic handling */
872 see_monsters(); /* see invisible monsters */
873 newsym(u.ux, u.uy); /* see yourself! */
874 if (msg && !Blind) { /* Blind possible if polymorphed */
875 You("can see through yourself, but you are visible!");
876 gp.potion_unkn--;
877 }
878}
879
880staticfn void
881peffect_paralysis(struct obj *otmp)

Callers 1

peffectsFunction · 0.85

Calls 11

fruitnameFunction · 0.85
bcsignFunction · 0.85
newuhsFunction · 0.85
make_blindedFunction · 0.85
rn2Function · 0.85
incr_itimeoutFunction · 0.85
set_mimic_blockingFunction · 0.85
see_monstersFunction · 0.85
newsymFunction · 0.85
YouFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected