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

Function dowaterdemon

src/fountain.c:63–90  ·  view source on GitHub ↗

Water demon */

Source from the content-addressed store, hash-verified

61
62/* Water demon */
63staticfn void
64dowaterdemon(void)
65{
66 struct monst *mtmp;
67
68 if (!(svm.mvitals[PM_WATER_DEMON].mvflags & G_GONE)) {
69 if ((mtmp = makemon(&mons[PM_WATER_DEMON], u.ux, u.uy,
70 MM_NOMSG)) != 0) {
71 if (!Blind)
72 You("unleash %s!", a_monnam(mtmp));
73 else
74 You_feel("the presence of evil.");
75
76 /* Give those on low levels a (slightly) better chance of survival
77 */
78 if (rnd(100) > (80 + level_difficulty())) {
79 pline("Grateful for %s release, %s grants you a wish!",
80 mhis(mtmp), mhe(mtmp));
81 /* give a wish and discard the monster (mtmp set to null) */
82 mongrantswish(&mtmp);
83 } else if (t_at(mtmp->mx, mtmp->my))
84 (void) mintrap(mtmp, NO_TRAP_FLAGS);
85 }
86 } else {
87 Soundeffect(se_furious_bubbling, 20);
88 pline_The("fountain bubbles furiously for a moment, then calms.");
89 }
90}
91
92/* Water Nymph */
93staticfn void

Callers 2

drinkfountainFunction · 0.85
dipfountainFunction · 0.85

Calls 11

makemonFunction · 0.85
YouFunction · 0.85
a_monnamFunction · 0.85
You_feelFunction · 0.85
rndFunction · 0.85
level_difficultyFunction · 0.85
mongrantswishFunction · 0.85
t_atFunction · 0.85
mintrapFunction · 0.85
pline_TheFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected