| 27 | |
| 28 | |
| 29 | staticfn boolean |
| 30 | throne_mon_sound(struct monst *mtmp) |
| 31 | { |
| 32 | if ((mtmp->msleeping || is_lord(mtmp->data) |
| 33 | || is_prince(mtmp->data)) && !is_animal(mtmp->data) |
| 34 | && mon_in_room(mtmp, COURT)) { |
| 35 | static const char *const throne_msg[4] = { |
| 36 | "the tones of courtly conversation.", |
| 37 | "a sceptre pounded in judgment.", |
| 38 | "Someone shouts \"Off with %s head!\"", |
| 39 | "Queen Beruthiel's cats!", |
| 40 | }; |
| 41 | int which = rn2(3) + (Hallucination ? 1 : 0); |
| 42 | |
| 43 | if (which != 2) { |
| 44 | if (which == 0) { |
| 45 | Soundeffect(se_courtly_conversation, 30); |
| 46 | } else if (which == 1) { |
| 47 | Soundeffect(se_sceptor_pounding, 100); |
| 48 | } |
| 49 | You_hear1(throne_msg[which]); |
| 50 | } else { |
| 51 | DISABLE_WARNING_FORMAT_NONLITERAL |
| 52 | pline(throne_msg[2], uhis()); |
| 53 | RESTORE_WARNING_FORMAT_NONLITERAL |
| 54 | } |
| 55 | return TRUE; |
| 56 | } |
| 57 | return FALSE; |
| 58 | } |
| 59 | |
| 60 | |
| 61 | staticfn boolean |
nothing calls this directly
no test coverage detected