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

Function dowatersnakes

src/fountain.c:37–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36/* Fountain of snakes! */
37staticfn void
38dowatersnakes(void)
39{
40 int num = rn1(5, 2);
41 struct monst *mtmp;
42
43 if (!(svm.mvitals[PM_WATER_MOCCASIN].mvflags & G_GONE)) {
44 if (!Blind) {
45 pline("An endless stream of %s pours forth!",
46 Hallucination ? makeplural(rndmonnam(NULL)) : "snakes");
47 } else {
48 Soundeffect(se_snakes_hissing, 75);
49 You_hear("%s hissing!", something);
50 }
51 while (num-- > 0)
52 if ((mtmp = makemon(&mons[PM_WATER_MOCCASIN], u.ux, u.uy,
53 MM_NOMSG)) != 0
54 && t_at(mtmp->mx, mtmp->my))
55 (void) mintrap(mtmp, NO_TRAP_FLAGS);
56 } else {
57 Soundeffect(se_furious_bubbling, 20);
58 pline_The("fountain bubbles furiously for a moment, then calms.");
59 }
60}
61
62/* Water demon */
63staticfn void

Callers 2

drinkfountainFunction · 0.85
dipfountainFunction · 0.85

Calls 8

makepluralFunction · 0.85
rndmonnamFunction · 0.85
You_hearFunction · 0.85
makemonFunction · 0.85
t_atFunction · 0.85
mintrapFunction · 0.85
pline_TheFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected