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

Function dryup

src/fountain.c:200–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void
201dryup(coordxy x, coordxy y, boolean isyou)
202{
203 if (IS_FOUNTAIN(levl[x][y].typ)
204 && (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) {
205 if (isyou && in_town(x, y) && !FOUNTAIN_IS_WARNED(x, y)) {
206 struct monst *mtmp;
207
208 SET_FOUNTAIN_WARNED(x, y);
209 /* Warn about future fountain use. */
210 mtmp = get_iter_mons(watchman_warn_fountain);
211 /* You can see or hear this effect */
212 if (!mtmp)
213 pline_The("flow reduces to a trickle.");
214 return;
215 }
216 if (isyou && wizard) {
217 if (y_n("Dry up fountain?") == 'n')
218 return;
219 }
220 /* FIXME: sight-blocking clouds should use block_point() when
221 being created and unblock_point() when going away, then this
222 glyph hackery wouldn't be necessary */
223 if (cansee(x, y)) {
224 int glyph = glyph_at(x, y);
225
226 if (!glyph_is_cmap(glyph) || glyph_to_cmap(glyph) != S_cloud)
227 pline_The("fountain dries up!");
228 }
229 /* replace the fountain with ordinary floor */
230 set_levltyp(x, y, ROOM); /* updates level.flags.nfountains */
231 levl[x][y].flags = 0;
232 levl[x][y].blessedftn = 0;
233 /* The location is seen if the hero/monster is invisible
234 or felt if the hero is blind. */
235 newsym(x, y);
236 if (isyou && in_town(x, y))
237 (void) angry_guards(FALSE);
238 }
239}
240
241/* quaff from a fountain when standing on its location */
242void

Callers 7

dositFunction · 0.85
furniture_handledFunction · 0.85
minliquid_coreFunction · 0.85
zap_over_floorFunction · 0.85
domonabilityFunction · 0.85
drinkfountainFunction · 0.85
dipfountainFunction · 0.85

Calls 9

rn2Function · 0.85
in_townFunction · 0.85
get_iter_monsFunction · 0.85
pline_TheFunction · 0.85
glyph_atFunction · 0.85
glyph_to_cmapFunction · 0.85
set_levltypFunction · 0.85
newsymFunction · 0.85
angry_guardsFunction · 0.85

Tested by

no test coverage detected