| 199 | } |
| 200 | |
| 201 | void |
| 202 | dosounds(void) |
| 203 | { |
| 204 | struct mkroom *sroom; |
| 205 | int hallu, vx, vy; |
| 206 | struct monst *mtmp; |
| 207 | |
| 208 | if (Deaf || !flags.acoustics || u.uswallow || Underwater) |
| 209 | return; |
| 210 | |
| 211 | hallu = Hallucination ? 1 : 0; |
| 212 | |
| 213 | if (svl.level.flags.nfountains && !rn2(400)) { |
| 214 | static const char *const fountain_msg[4] = { |
| 215 | "bubbling water.", "water falling on coins.", |
| 216 | "the splashing of a naiad.", "a soda fountain!", |
| 217 | }; |
| 218 | You_hear1(fountain_msg[rn2(3) + hallu]); |
| 219 | } |
| 220 | if (svl.level.flags.nsinks && !rn2(300)) { |
| 221 | static const char *const sink_msg[3] = { |
| 222 | "a slow drip.", "a gurgling noise.", "dishes being washed!", |
| 223 | }; |
| 224 | You_hear1(sink_msg[rn2(2) + hallu]); |
| 225 | } |
| 226 | if (svl.level.flags.has_court && !rn2(200)) { |
| 227 | if (get_iter_mons(throne_mon_sound)) |
| 228 | return; |
| 229 | } |
| 230 | if (svl.level.flags.has_swamp && !rn2(200)) { |
| 231 | static const char *const swamp_msg[3] = { |
| 232 | "hear mosquitoes!", "smell marsh gas!", /* so it's a smell...*/ |
| 233 | "hear Donald Duck!", |
| 234 | }; |
| 235 | You1(swamp_msg[rn2(2) + hallu]); |
| 236 | return; |
| 237 | } |
| 238 | if (svl.level.flags.has_vault && !rn2(200)) { |
| 239 | if (!(sroom = search_special(VAULT))) { |
| 240 | /* strange ... */ |
| 241 | svl.level.flags.has_vault = 0; |
| 242 | return; |
| 243 | } |
| 244 | if (gd_sound()) |
| 245 | switch (rn2(2) + hallu) { |
| 246 | case 1: { |
| 247 | boolean gold_in_vault = FALSE; |
| 248 | |
| 249 | for (vx = sroom->lx; vx <= sroom->hx; vx++) |
| 250 | for (vy = sroom->ly; vy <= sroom->hy; vy++) |
| 251 | if (g_at(vx, vy)) |
| 252 | gold_in_vault = TRUE; |
| 253 | if (vault_occupied(u.urooms) |
| 254 | != (ROOM_INDEX(sroom) + ROOMOFFSET)) { |
| 255 | if (gold_in_vault) { |
| 256 | You_hear(!hallu |
| 257 | ? "someone counting gold coins." |
| 258 | : "the quarterback calling the play."); |
no test coverage detected