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

Function mongrantswish

src/potion.c:2795–2812  ·  view source on GitHub ↗

monp grants a wish and then leaves the game */

Source from the content-addressed store, hash-verified

2793
2794/* *monp grants a wish and then leaves the game */
2795void
2796mongrantswish(struct monst **monp)
2797{
2798 struct monst *mon = *monp;
2799 int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
2800
2801 /* remove the monster first in case wish proves to be fatal
2802 (blasted by artifact), to keep it out of resulting bones file */
2803 mongone(mon);
2804 *monp = 0; /* inform caller that monster is gone */
2805 /* hide that removal from player--map is visible during wish prompt */
2806 tmp_at(DISP_ALWAYS, glyph);
2807 tmp_at(mx, my);
2808 /* grant the wish */
2809 makewish();
2810 /* clean up */
2811 tmp_at(DISP_END, 0);
2812}
2813
2814void
2815djinni_from_bottle(struct obj *obj)

Callers 2

djinni_from_bottleFunction · 0.85
dowaterdemonFunction · 0.85

Calls 4

glyph_atFunction · 0.85
mongoneFunction · 0.85
tmp_atFunction · 0.85
makewishFunction · 0.85

Tested by

no test coverage detected