| 615 | } |
| 616 | |
| 617 | int |
| 618 | dopotion(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 */ |
no test coverage detected