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

Function set_voice

src/sounds.c:2160–2182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2158#endif
2159
2160void
2161set_voice(
2162 struct monst *mtmp SPEECHONLY,
2163 int32_t tone SPEECHONLY,
2164 int32_t volume SPEECHONLY,
2165 int32_t moreinfo SPEECHONLY)
2166{
2167#ifdef SND_SPEECH
2168 int32_t gender = (mtmp && mtmp->female) ? FEMALE : MALE;
2169
2170 if (gv.voice.nameid)
2171 free((genericptr_t) gv.voice.nameid);
2172 gv.voice.gender = gender;
2173 gv.voice.serialno = mtmp ? mtmp->m_id
2174 : ((moreinfo & voice_talking_artifact) != 0) ? 3
2175 : ((moreinfo & voice_deity) != 0) ? 4 : 2;
2176 gv.voice.tone = tone;
2177 gv.voice.volume = volume;
2178 gv.voice.moreinfo = moreinfo;
2179 gv.voice.nameid = (const char *) 0;
2180 gp.pline_flags |= PLINE_SPEECH;
2181#endif
2182}
2183
2184void
2185sound_speak(const char *text SPEECHONLY)

Callers 2

u_entered_shopFunction · 0.85
addtobillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected