]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Apply pitch properly to both stomach kicks and stomach gurgles. For kicks, the pitch...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 23:24:09 +0000 (01:24 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 23:24:09 +0000 (01:24 +0200)
data/qcsrc/server/cl_player.qc
data/qcsrc/server/miscfunctions.qc
data/qcsrc/server/vore.qc

index 70ff9b24347965547619ca22a32fda562db2b348..e953ff7d4b41ecebbd10724d7ab70dc218112e67 100644 (file)
@@ -1355,7 +1355,7 @@ void GlobalSound(string sample, float chan, float voicetype, float vol)
                case VOICETYPE_GURGLE:\r
                        // since players can't be prey and predators at the same time, we don't use the prey modifier for the gurgle sound volume\r
                        if(self.stomach_load)\r
-                               sound7(self, chan, sample, bound(0, vol_scale * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM, pitch, 0);\r
+                               sound7(self, chan, sample, bound(0, vol_scale * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM, pitch * 100, 0);\r
                        else\r
                                stopsound(self, chan);\r
                        break;\r
index 2c3fff3f9c80c8deda4e8239b546054f53093a17..17e98678653b8b4672e2dd27b0943747c1848689 100644 (file)
@@ -1198,7 +1198,7 @@ void soundtoat(float dest, entity e, vector o, float chan, string samp, float vo
     if (sflags & SND_ATTENUATION)\r
         WriteByte(dest, atten);\r
        if(sflags & SND_SPEEDUSHORT4000)\r
-               WriteShort(dest, 4000 * spd);\r
+               WriteShort(dest, spd * 4000);\r
     if (sflags & SND_LARGEENTITY)\r
     {\r
         WriteShort(dest, entno);\r
index 5dca344b35b7b8646a75e3dd2f865f91328733e9..b043e43323b89e92224f8733f29f10e6becc94e5 100644 (file)
@@ -141,7 +141,12 @@ void Vore_GurgleSound()
        {\r
                GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE, VOL_BASE);\r
 \r
-               self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do?\r
+               // yes, hard coded sound length. I know it's bad but what can I do?\r
+               if(cvar("g_healthsize") && cvar("g_healthsize_pitch"))\r
+                       self.gurglesound_finished = time + 11 * pow(self.scale, -cvar("g_healthsize_pitch")); // modified sound pitch, based on player scale\r
+               else\r
+                       self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do?\r
+\r
                self.gurgle_oldstomachload = self.stomach_load;\r
        }\r
 }\r
@@ -530,12 +535,16 @@ void Vore_StomachKick()
 \r
        if(time > self.stomachkick_delay && !self.kick_pressed)\r
        {\r
-               float damage, vol;\r
+               float damage, vol, pitch;\r
                vector force;\r
                damage = cvar("g_balance_vore_kick_damage");\r
                force = v_forward * cvar("g_balance_vore_kick_force");\r
                vol = VOL_BASE;\r
 \r
+               // modified sound pitch, based on player scale\r
+               if(cvar("g_healthsize") && cvar("g_healthsize_pitch"))\r
+                       pitch = pow(self.predator.scale, -cvar("g_healthsize_pitch"));\r
+\r
                // apply player scale to the damage / force of the kick\r
                if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff"))\r
                {\r
@@ -546,7 +555,7 @@ void Vore_StomachKick()
                vol = bound(0, vol, 1);\r
 \r
                Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, force);\r
-               sound(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM);\r
+               sound7(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM, 100 * pitch, 0);\r
                self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r
                self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r
                self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle");\r