* Make a sound for message \a mesgNum if appropriate. * @param mesgNum Message number displayed. * @param x Horizontal coordinate in the city of the sound. * @param y Vertical coordinate in the city of the sound. */
| 395 | * @param y Vertical coordinate in the city of the sound. |
| 396 | */ |
| 397 | void Micropolis::doMakeSound(int mesgNum, int x, int y) |
| 398 | { |
| 399 | assert(mesgNum >= 0); |
| 400 | |
| 401 | switch (mesgNum) { |
| 402 | |
| 403 | case MESSAGE_TRAFFIC_JAMS: |
| 404 | if (getRandom(5) == 1) { |
| 405 | makeSound("city", "HonkHonkMed", x, y); |
| 406 | } else if (getRandom(5) == 1) { |
| 407 | makeSound("city", "HonkHonkLow", x, y); |
| 408 | } else if (getRandom(5) == 1) { |
| 409 | makeSound("city", "HonkHonkHigh", x, y); |
| 410 | } |
| 411 | break; |
| 412 | |
| 413 | case MESSAGE_HIGH_CRIME: |
| 414 | case MESSAGE_FIRE_REPORTED: |
| 415 | case MESSAGE_TORNADO_SIGHTED: |
| 416 | case MESSAGE_EARTHQUAKE: |
| 417 | case MESSAGE_PLANE_CRASHED: |
| 418 | case MESSAGE_SHIP_CRASHED: |
| 419 | case MESSAGE_TRAIN_CRASHED: |
| 420 | case MESSAGE_HELICOPTER_CRASHED: |
| 421 | makeSound("city", "Siren", x, y); |
| 422 | break; |
| 423 | |
| 424 | case MESSAGE_MONSTER_SIGHTED: |
| 425 | makeSound("city", "Monster", x, y); |
| 426 | break; |
| 427 | |
| 428 | case MESSAGE_FIREBOMBING: |
| 429 | makeSound("city", "ExplosionLow", x, y); |
| 430 | makeSound("city", "Siren", x, y); |
| 431 | break; |
| 432 | |
| 433 | case MESSAGE_NUCLEAR_MELTDOWN: |
| 434 | makeSound("city", "ExplosionHigh", x, y); |
| 435 | makeSound("city", "ExplosionLow", x, y); |
| 436 | makeSound("city", "Siren", x, y); |
| 437 | break; |
| 438 | |
| 439 | case MESSAGE_RIOTS_REPORTED: |
| 440 | makeSound("city", "Siren", x, y); |
| 441 | break; |
| 442 | |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | /** |
| 447 | * Tell the front-end that it should perform an auto-goto |
nothing calls this directly
no outgoing calls
no test coverage detected