11 REPLICATE(cvar_cl_autotaunt,
float,
"cl_autotaunt");
12 REPLICATE(cvar_cl_voice_directional,
int,
"cl_voice_directional");
13 REPLICATE(cvar_cl_voice_directional_taunt_attenuation,
float,
"cl_voice_directional_taunt_attenuation");
30 soundto(channel, from, chan, sample, _vol, _atten, _pitch);
34 sound7(from, chan, sample, _vol, _atten, _pitch, 0);
54 vector o = from.origin + 0.5 * (from.mins + from.maxs);
55 WriteVector(channel, o);
69 string s = from.(ps.m_playersoundfld);
73 soundto(channel, from, chan, sample, _vol, _atten, _pitch);
77 sound7(from, chan, sample, _vol, _atten, _pitch, 0);
97 vector o = from.origin + 0.5 * (from.mins + from.maxs);
98 WriteVector(channel, o);
114 float pitch = ReadShort();
121 else if (e) e.origin = o;
124 sound7(e, chan, sample, vol,
atten,
pitch, 0);
142 string s = e.(ps.m_playersoundfld);
147 float pitch = ReadShort();
153 else if (e) e.origin = o;
157 sound7(e, chan, sample, vol,
atten,
pitch, 0);
174 string s =
cdr(pair);
178 string sample =
car(pair);
179 if (n > 0) sample = sprintf(
"%s%d.wav", sample,
floor(r * n + 1));
180 else sample = sprintf(
"%s.wav", sample);
191 float pitch_shift = (b*d*(a-1) + a*c*(1-b)) / (d*(a-1) + c*(1-b));
193 return pitch_shift * 100;
200 string s =
cdr(sample);
204 sample =
car(sample);
207 for (
int i = 1; i <= n; ++i)
218 FOREACH(PlayerSounds, it.m_playersoundstr == type && it.instanceOfVoiceMessage ==
true,
return it);
224 FOREACH(PlayerSounds, it.m_playersoundstr == type && it.instanceOfVoiceMessage ==
false,
return it);
232 if (e)
return e.m_playersoundfld;
234 return playersound_taunt.m_playersoundfld;
247 LOG_WARNF(
"Player sound file not found: %s", f);
250 for (
string s; (s =
fgets(fh)); )
255 if (n != 0)
LOG_WARNF(
"Invalid sound info line: %s", s);
258 string file =
argv(1);
259 string variants =
argv(2);
275 .string fld = it.m_playersoundfld;
288 if (strict)
LOG_WARNF(
"Player sound file not found: %s", f);
291 for (
string s; (s =
fgets(fh)); )
296 if (n != 0)
LOG_WARNF(
"Invalid sound info line: %s", s);
299 string key =
argv(0);
304 LOG_TRACEF(
"Invalid sound info field in player sound file '%s': %s", f, key);
307 string file =
argv(1);
308 string variants =
argv(2);
327 if (this.
model ==
"null"
343 if (gs ==
NULL && ps ==
NULL && sample ==
"")
return;
348 pitchscale *= this.
scale;
382 float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \
383 if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
384 else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch); \
385 else soundto(MSG_ONE, this, chan, sample, vol, atten, thepitch); \
410 if (autocvar_sv_gentle)
break;
416 if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS_CVAR(msg_entity).cvar_cl_autotaunt) \
418 float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional >= 1) \
419 ? bound(ATTEN_MIN, CS_CVAR(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \
422 if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
423 else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch); \
424 else soundto(MSG_ONE, this, chan, sample, vol, atten, thepitch); \
void animdecide_setaction(entity e, float action, float restart)
const int ANIMACTION_TAUNT
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define player_currententnum
string get_model_datafilename(string m, float sk, string fil)
void entcs_force_origin(entity player)
#define entcs_receiver(...)
entity GetVoiceMessage(string type)
void PrecacheGlobalSound(string sample)
void UpdatePlayerSounds(entity this)
bool LoadPlayerSounds(entity this, string f, bool strict)
string _GetPlayerSoundSampleField(string type, bool voice)
entity GetPlayerSound(string type)
string GetVoiceMessageSampleField(string type)
string GetPlayerSoundSampleField(string type)
void globalsound(int channel, entity from, entity gs, float r, int chan, float _vol, float _atten, float _pitch)
void playersound(int channel, entity from, entity ps, float r, int chan, float _vol, float _atten, float _pitch)
bool autocvar_g_debug_defaultsounds
float GlobalSound_pitch(float _pitch)
void ClearPlayerSounds(entity this)
string GlobalSound_sample(string pair, float r)
string model_for_playersound
void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, float vol, int voicetype, bool fake, float pitchscale)
void PrecachePlayerSounds(string f)
const int VOICETYPE_LASTATTACKER
bool GetPlayerSoundSampleField_notFound
const int VOICETYPE_LASTATTACKER_ONLY
bool autocvar_g_debug_globalsounds
Use new sound handling.
const int VOICETYPE_TAUNT
const int VOICETYPE_PLAYERSOUND
const int VOICETYPE_AUTOTAUNT
bool autocvar_sv_autotaunt
const int VOICETYPE_TEAMRADIO
#define FOREACH(list, cond, body)
#define NET_HANDLE(id, param)
#define WriteHeader(to, id)
#define REGISTER_NET_TEMP(id)
#define REPLICATE(...)
Replicates a client cvar into a server field.
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
bool autocvar_sv_q3compat_changehitbox
#define REGISTRY_GET(id, i)
#define sound8(e, o, chan, samp, vol, atten, speed, sf)
because sound7 didn't have origin
void soundto(int _dest, entity e, int chan, string samp, float vol, float _atten, float _pitch)
bool sound_allowed(int to, entity e)
ERASEABLE string car(string s)
returns first word
ERASEABLE string cdr(string s)
returns all but first word
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)