From be87dbbd9272d2c90b16e6bf5ea49c2433412fa7 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sun, 5 Sep 2010 18:38:34 +0300 Subject: [PATCH] Belly sound occlusion effect. Stuff like pain sounds will be heard at lower volume for someone who's in the belly. --- data/defaultVoretournament.cfg | 1 + data/qcsrc/server/cl_player.qc | 40 +++++++++++++++++++++++++++++----- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/data/defaultVoretournament.cfg b/data/defaultVoretournament.cfg index dedc8e93..1a98e09b 100644 --- a/data/defaultVoretournament.cfg +++ b/data/defaultVoretournament.cfg @@ -1503,6 +1503,7 @@ set g_vore_gurglesound 1 "allow the ambient gurgle sound to play when there's so set g_vore_biggergut 1 "when enabled, a player can't swallow someone with more players in their stomach than them" set g_vore_dropweapon 0.75 "probability of dropping your weapon when being swallowed. 0 = never and 1 = always, does not apply to team mates" set g_vore_showpreyhealth 1 "when enabled, a predator can see their prey's health on the stomach board" +set g_vore_soundocclusion 0.25 "directional player sounds are played at this amount of their normal volume for eaten players (simulates hearing harder from the stomach)" set sv_weaponstats_damagefile "" "when set to a file name, per-weapon damage stats get written to that file" set sv_weaponstats_killfile "" "when set to a file name, per-weapon kill stats get written to that file" diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index b12a1074..64230edc 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1224,7 +1224,12 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + { + if(self.eater.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1238,7 +1243,12 @@ void GlobalSound(string sample, float chan, float voicetype) if(clienttype(msg_entity) == CLIENTTYPE_REAL) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + { + if(self.eater.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1252,7 +1262,12 @@ void GlobalSound(string sample, float chan, float voicetype) if(!teams_matter || msg_entity.team == self.team) { if(msg_entity.cvar_cl_voice_directional == 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + { + if(self.eater.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_MIN); + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_MIN); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1269,7 +1284,12 @@ void GlobalSound(string sample, float chan, float voicetype) if (tauntrand < msg_entity.cvar_cl_autotaunt) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + { + if(self.eater.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } @@ -1285,12 +1305,20 @@ void GlobalSound(string sample, float chan, float voicetype) FOR_EACH_REALCLIENT(msg_entity) { if (msg_entity.cvar_cl_voice_directional >= 1) - soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + { + if(self.eater.classname == "player") + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE * bound(0, cvar("g_vore_soundocclusion"), 1), bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + else + soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, bound(ATTN_MIN, msg_entity.cvar_cl_voice_directional_taunt_attenuation, ATTN_MAX)); + } else soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE); } case VOICETYPE_PLAYERSOUND: - sound(self, chan, sample, VOL_BASE, ATTN_NORM); + if(self.eater.classname == "player") + sound(self, chan, sample, VOL_BASE * bound(0, cvar("g_vore_soundocclusion"), 1), ATTN_NORM); + else + sound(self, chan, sample, VOL_BASE, ATTN_NORM); break; case VOICETYPE_GURGLE: if(self.stomach_load) -- 2.39.2