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);
48 vector o = from.origin + 0.5 * (from.mins + from.maxs);
49 WriteVector(channel, o);
63 string s = from.(ps.m_playersoundfld);
67 soundto(channel, from, chan, sample, _vol, _atten, _pitch);
71 sound7(from, chan, sample, _vol, _atten, _pitch, 0);
85 vector o = from.origin + 0.5 * (from.mins + from.maxs);
86 WriteVector(channel, o);
105 else if (e) e.origin = o;
108 sound7(e, chan, sample, vol,
atten, 0, 0);
113 LOG_WARNF(
"Missing entcs data for player %d", who);
126 string s = e.(ps.m_playersoundfld);
133 else if (e) e.origin = o;
137 sound7(e, chan, sample, vol,
atten, 0, 0);
142 LOG_WARNF(
"Missing entcs data for player %d", who);
154 string s =
cdr(pair);
158 string sample =
car(pair);
159 if (n > 0) sample = sprintf(
"%s%d.wav", sample,
floor(r * n + 1));
160 else sample = sprintf(
"%s.wav", sample);
171 float pitch_shift = (b*d*(a-1) + a*c*(1-b)) / (d*(a-1) + c*(1-b));
173 return pitch_shift * 100;
180 string s =
cdr(sample);
184 sample =
car(sample);
187 for (
int i = 1; i <= n; ++i)
198 FOREACH(PlayerSounds, it.m_playersoundstr == type && it.instanceOfVoiceMessage ==
true,
return it);
204 FOREACH(PlayerSounds, it.m_playersoundstr == type && it.instanceOfVoiceMessage ==
false,
return it);
212 if (e)
return e.m_playersoundfld;
214 return playersound_taunt.m_playersoundfld;
227 LOG_WARNF(
"Player sound file not found: %s", f);
230 for (
string s; (s =
fgets(fh)); )
235 if (n != 0)
LOG_WARNF(
"Invalid sound info line: %s", s);
238 string file =
argv(1);
239 string variants =
argv(2);
255 .string fld = it.m_playersoundfld;
268 if (strict)
LOG_WARNF(
"Player sound file not found: %s", f);
271 for (
string s; (s =
fgets(fh)); )
276 if (n != 0)
LOG_WARNF(
"Invalid sound info line: %s", s);
279 string key =
argv(0);
284 LOG_TRACEF(
"Invalid sound info field in player sound file '%s': %s", f, key);
287 string file =
argv(1);
288 string variants =
argv(2);
307 if (this.
model ==
"null"
323 if (gs ==
NULL && ps ==
NULL && sample ==
"")
return;
326 float myscale = ((this.
scale) ? this.
scale : 1);
360 float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \
361 if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
362 else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch); \
363 else soundto(MSG_ONE, this, chan, sample, vol, atten, thepitch); \
388 if (autocvar_sv_gentle)
break;
394 if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS_CVAR(msg_entity).cvar_cl_autotaunt) \
396 float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional >= 1) \
397 ? bound(ATTEN_MIN, CS_CVAR(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \
400 if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
401 else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch); \
402 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(...)
void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, float vol, int voicetype, bool fake)
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 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."))
#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)