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

Function ghost_from_bottle

src/potion.c:480–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480staticfn void
481ghost_from_bottle(void)
482{
483 struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, MM_NOMSG);
484
485 if (!mtmp) {
486 pline("This bottle turns out to be empty.");
487 return;
488 }
489 if (Blind) {
490 pline("As you open the bottle, %s emerges.", something);
491 return;
492 }
493 pline("As you open the bottle, an enormous %s emerges!",
494 Hallucination ? rndmonnam(NULL) : (const char *) "ghost");
495 if (flags.verbose)
496 You("are frightened to death, and unable to move.");
497 nomul(-3);
498 gm.multi_reason = "being frightened to death";
499 gn.nomovemsg = "You regain your composure.";
500}
501
502/* getobj callback for object to drink from, which also does double duty as
503 the callback for dipping into (both just allow potions). */

Callers 1

dodrinkFunction · 0.85

Calls 5

makemonFunction · 0.85
rndmonnamFunction · 0.85
YouFunction · 0.85
nomulFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected