]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Play the normal footstep sounds based on micro status. A fully shrinked player will...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 13:51:06 +0000 (15:51 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 13:51:06 +0000 (15:51 +0200)
data/qcsrc/server/cl_player.qc
data/qcsrc/server/sv_main.qc

index 7f22f580ae3aaa658407344b79db71994deaaf36..5fccaf30c6958eb11c042eb95a2f4ad47db8fd69 100644 (file)
@@ -1255,12 +1255,12 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
                                                {\r
-                                                       vol_apply = VOL_BASEVOICE;\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
                                                }\r
                                                else\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
                                        }\r
                                }\r
                        break;\r
@@ -1273,12 +1273,12 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                                        {\r
                                                if(msg_entity.cvar_cl_voice_directional == 1)\r
                                                {\r
-                                                       vol_apply = VOL_BASEVOICE;\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
                                                }\r
                                                else\r
-                                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
+                                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
                                        }\r
                                        msg_entity = self;\r
                                        if(clienttype(msg_entity) == CLIENTTYPE_REAL)\r
@@ -1291,12 +1291,12 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                                {\r
                                        if(msg_entity.cvar_cl_voice_directional == 1)\r
                                        {\r
-                                               vol_apply = VOL_BASEVOICE;\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
                                        }\r
                                        else\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
+                                               soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
                                }\r
                        break;\r
                case VOICETYPE_AUTOTAUNT:\r
@@ -1312,12 +1312,12 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                                {\r
                                        if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                        {\r
-                                               vol_apply = VOL_BASEVOICE;\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
                                        }\r
                                        else\r
-                                               soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
+                                               soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
                                }\r
                        break;\r
                case VOICETYPE_TAUNT:\r
@@ -1332,17 +1332,17 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                        {\r
                                if (msg_entity.cvar_cl_voice_directional >= 1)\r
                                {\r
-                                       vol_apply = VOL_BASEVOICE;\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
                                }\r
                                else\r
-                                       soundto(MSG_ONE, self, chan, sample, VOL_BASEVOICE, ATTN_NONE);\r
+                                       soundto(MSG_ONE, self, chan, sample, vol, ATTN_NONE);\r
                        }\r
                case VOICETYPE_PLAYERSOUND:\r
                        FOR_EACH_REALCLIENT(msg_entity)\r
                        {\r
-                               vol_apply = VOL_BASEVOICE;\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
                        }\r
index 310fd44693522303010589d3da90275f31a27b48..b8baf2965a7716334b5a8ec3b353e074f6220c88 100644 (file)
@@ -106,12 +106,16 @@ void CreatureFrame (void)
                                        */\r
                                        if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)\r
                                        {\r
+                                               float micro_to_normal, normal_to_macro;\r
+                                               micro_to_normal = 1 - bound(0, (self.health / cvar("g_healthsize_center") - 1) / (cvar("g_healthsize_min") / cvar("g_healthsize_center") - 1), 1);\r
+                                               normal_to_macro = 1 - bound(0, (self.health / cvar("g_healthsize_max") - 1) / (cvar("g_healthsize_center") / cvar("g_healthsize_max") - 1), 1);\r
+\r
                                                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
-                                                       GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);\r
+                                                       GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * micro_to_normal, 1));\r
                                                else\r
-                                                       GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);\r
+                                                       GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * micro_to_normal, 1));\r
 \r
-                                               sound(self, CHAN_AUTO, "misc/macro_footstep.wav", VOL_BASE, ATTN_NORM);\r
+                                               //sound(self, CHAN_AUTO, "misc/macro_footstep.wav", VOL_BASE, ATTN_NORM);\r
                                        }\r
                                }\r
                        }\r