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

Function dopotion

src/potion.c:617–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617int
618dopotion(struct obj *otmp)
619{
620 int retval;
621
622 otmp->in_use = TRUE;
623 gp.potion_nothing = gp.potion_unkn = 0;
624 if ((retval = peffects(otmp)) >= 0)
625 return retval ? ECMD_TIME : ECMD_OK;
626
627 if (gp.potion_nothing) {
628 gp.potion_unkn++;
629 You("have a %s feeling for a moment, then it passes.",
630 Hallucination ? "normal" : "peculiar");
631 }
632 if (otmp->dknown && !objects[otmp->otyp].oc_name_known) {
633 if (!gp.potion_unkn) {
634 makeknown(otmp->otyp);
635 more_experienced(0, 10);
636 } else
637 trycall(otmp);
638 }
639 useup(otmp);
640 return ECMD_TIME;
641}
642
643/* potion or spell of restore ability; for spell, otmp is a temporary
644 spellbook object that will be blessed if hero is skilled in healing */

Callers 3

dodrinkFunction · 0.85
eatspecialFunction · 0.85
drinksinkFunction · 0.85

Calls 5

peffectsFunction · 0.85
YouFunction · 0.85
more_experiencedFunction · 0.85
trycallFunction · 0.85
useupFunction · 0.85

Tested by

no test coverage detected