\r
void crash (void) = #6;\r
float random (void) = #7;\r
-//void(entity e, float chan, string samp, float vol, float atten) sound = #8;\r
+void (entity e, float chan, string samp, float vol, float atten, float pitchshift, float flags) sound7 = #8;\r
vector normalize (vector v) = #9;\r
void error (string e) = #10;\r
void objerror_builtin (string e) = #11; // do not call, use objerror wrapper\r
{\r
msg_entity = self;\r
if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
- soundto(MSG_ONE, self, CHAN_AUTO, regensound, VOL_BASE, ATTN_NONE);\r
+ soundto(MSG_ONE, self, CHAN_AUTO, regensound, VOL_BASE, ATTN_NONE, 0);\r
}\r
self.regen_soundtime = time + 1; // only replay the sound if regen was paused for one second\r
}\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN, 0);\r
}\r
else\r
- soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE, 0);\r
}\r
}\r
break;\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN, 0);\r
}\r
else\r
- soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE, 0);\r
}\r
msg_entity = self;\r
if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
- soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, VOL_BASE, ATTN_NONE, 0);\r
}\r
break;\r
case VOICETYPE_TEAMRADIO:\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN);\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_MIN, 0);\r
}\r
else\r
- soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE, 0);\r
}\r
break;\r
case VOICETYPE_AUTOTAUNT:\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX), 0);\r
}\r
else\r
- soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE, 0);\r
}\r
break;\r
case VOICETYPE_TAUNT:\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX));\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX), 0);\r
}\r
else\r
- soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
+ soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE, 0);\r
}\r
case VOICETYPE_PLAYERSOUND:\r
FOR_EACH_REALCLIENT(msg_entity)\r
{\r
vol_apply = vol;\r
vol_apply *= (self.predator != msg_entity.predator && self != msg_entity) ? vol_scale * vol_prey : vol_scale;\r
- soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_NORM);\r
+ soundto(MSG_ONE, self, chan, sample, vol_apply, ATTN_NORM, 0);\r
}\r
break;\r
case VOICETYPE_GURGLE:\r
#define SND_ATTENUATION 2\r
#define SND_LARGEENTITY 8\r
#define SND_LARGESOUND 16\r
+#define SND_SPEEDUSHORT4000 32\r
\r
float sound_allowed(float dest, entity e)\r
{\r
return;\r
sound_builtin(e, chan, samp, vol, atten);\r
}\r
-void soundtoat(float dest, entity e, vector o, float chan, string samp, float vol, float atten)\r
+void soundtoat(float dest, entity e, vector o, float chan, string samp, float vol, float atten, float spd)\r
{\r
float entno, idx;\r
\r
sflags |= SND_VOLUME;\r
if (atten != 64)\r
sflags |= SND_ATTENUATION;\r
+ if (spd)\r
+ sflags |= SND_SPEEDUSHORT4000;\r
if (entno >= 8192)\r
sflags |= SND_LARGEENTITY;\r
if (idx >= 256)\r
WriteByte(dest, vol);\r
if (sflags & SND_ATTENUATION)\r
WriteByte(dest, atten);\r
+ if(sflags & SND_SPEEDUSHORT4000)\r
+ WriteShort(dest, 4000 * spd);\r
if (sflags & SND_LARGEENTITY)\r
{\r
WriteShort(dest, entno);\r
WriteCoord(dest, o_y);\r
WriteCoord(dest, o_z);\r
}\r
-void soundto(float dest, entity e, float chan, string samp, float vol, float atten)\r
+void soundto(float dest, entity e, float chan, string samp, float vol, float atten, float spd)\r
{\r
vector o;\r
\r
return;\r
\r
o = e.origin + 0.5 * (e.mins + e.maxs);\r
- soundtoat(dest, e, o, chan, samp, vol, atten);\r
+ soundtoat(dest, e, o, chan, samp, vol, atten, spd);\r
}\r
-void soundat(entity e, vector o, float chan, string samp, float vol, float atten)\r
+void soundat(entity e, vector o, float chan, string samp, float vol, float atten, float spd)\r
{\r
- soundtoat(MSG_BROADCAST, e, o, chan, samp, vol, atten);\r
+ soundtoat(MSG_BROADCAST, e, o, chan, samp, vol, atten, spd);\r
}\r
void stopsoundto(float dest, entity e, float chan)\r
{\r
if (clienttype(e) == CLIENTTYPE_REAL)\r
{\r
msg_entity = e;\r
- soundtoat(MSG_ONE, world, '0 0 0', CHAN_AUTO, filename, VOL_BASE, ATTN_NONE);\r
+ soundtoat(MSG_ONE, world, '0 0 0', CHAN_AUTO, filename, VOL_BASE, ATTN_NONE, 0);\r
}\r
}\r
\r
p = pow(2, chan);\r
if (pl.soundentity.cnt & p)\r
return;\r
- soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn);\r
+ soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn, 0);\r
pl.soundentity.cnt |= p;\r
}\r
\r
if (self.noise != "")\r
{\r
precache_sound(self.noise);\r
- soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE);\r
+ soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE, 0);\r
}\r
if (!self.speed)\r
self.speed = 4;\r
if (self.noise != "")\r
{\r
precache_sound(self.noise);\r
- soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE);\r
+ soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE, 0);\r
}\r
\r
if (!self.speed)\r
if (self.noise != "")\r
{\r
precache_sound(self.noise);\r
- soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE);\r
+ soundto(MSG_INIT, self, CHAN_TRIGGER, self.noise, VOL_BASE, ATTN_IDLE, 0);\r
}\r
\r
if(!self.targetfactor)\r
\r
setattachment(beam,self.tur_head,"tag_fire");\r
\r
- soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);\r
+ soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM, 0);\r
\r
if (self.tur_head.frame == 0)\r
self.tur_head.frame = 1;\r
\r
- 0.7 BUG: Disabling g_healthsize gives a different field of view, even at 100 heatlh\r
\r
-- 0.7: Make sure all effects work for spectators too (such as the macro earthquake effect)
\ No newline at end of file
+- 0.7: Make sure all effects work for spectators too (such as the macro earthquake effect)\r
+\r
+- 0.7 | 0.8: Make display digits red when ammo or load are too low\r
+\r
+- 0.7: Precache macro hitground sound (make sure footstep one is precached too)
\ No newline at end of file