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

Function throne_mon_sound

src/sounds.c:29–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29staticfn boolean
30throne_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
61staticfn boolean

Callers

nothing calls this directly

Calls 2

mon_in_roomFunction · 0.85
rn2Function · 0.85

Tested by

no test coverage detected