| 198 | } |
| 199 | |
| 200 | void |
| 201 | dryup(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 */ |
| 242 | void |
no test coverage detected