From: MirceaKitsune Date: Sat, 3 Mar 2012 23:24:09 +0000 (+0200) Subject: Apply pitch properly to both stomach kicks and stomach gurgles. For kicks, the pitch... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=17ac565448fd592f9fe919b135b62afe62e8d5ac;p=voretournament%2Fvoretournament.git Apply pitch properly to both stomach kicks and stomach gurgles. For kicks, the pitch will be lower the larger the predator and higher the smaller --- diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 70ff9b24..e953ff7d 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -1355,7 +1355,7 @@ void GlobalSound(string sample, float chan, float voicetype, float vol) case VOICETYPE_GURGLE: // since players can't be prey and predators at the same time, we don't use the prey modifier for the gurgle sound volume if(self.stomach_load) - sound7(self, chan, sample, bound(0, vol_scale * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM, pitch, 0); + sound7(self, chan, sample, bound(0, vol_scale * (self.stomach_load / self.stomach_maxload), 1), ATTN_NORM, pitch * 100, 0); else stopsound(self, chan); break; diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index 2c3fff3f..17e98678 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -1198,7 +1198,7 @@ void soundtoat(float dest, entity e, vector o, float chan, string samp, float vo if (sflags & SND_ATTENUATION) WriteByte(dest, atten); if(sflags & SND_SPEEDUSHORT4000) - WriteShort(dest, 4000 * spd); + WriteShort(dest, spd * 4000); if (sflags & SND_LARGEENTITY) { WriteShort(dest, entno); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 5dca344b..b043e433 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -141,7 +141,12 @@ void Vore_GurgleSound() { GlobalSound(self.playersound_gurgle, CHAN_TRIGGER, VOICETYPE_GURGLE, VOL_BASE); - self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do? + // yes, hard coded sound length. I know it's bad but what can I do? + if(cvar("g_healthsize") && cvar("g_healthsize_pitch")) + self.gurglesound_finished = time + 11 * pow(self.scale, -cvar("g_healthsize_pitch")); // modified sound pitch, based on player scale + else + self.gurglesound_finished = time + 11; // yes, hard coded sound length. I know it's bad but what can I do? + self.gurgle_oldstomachload = self.stomach_load; } } @@ -530,12 +535,16 @@ void Vore_StomachKick() if(time > self.stomachkick_delay && !self.kick_pressed) { - float damage, vol; + float damage, vol, pitch; vector force; damage = cvar("g_balance_vore_kick_damage"); force = v_forward * cvar("g_balance_vore_kick_force"); vol = VOL_BASE; + // modified sound pitch, based on player scale + if(cvar("g_healthsize") && cvar("g_healthsize_pitch")) + pitch = pow(self.predator.scale, -cvar("g_healthsize_pitch")); + // apply player scale to the damage / force of the kick if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff")) { @@ -546,7 +555,7 @@ void Vore_StomachKick() vol = bound(0, vol, 1); Damage(self.predator, self, self, damage, DEATH_STOMACHKICK, self.predator.origin, force); - sound(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM); + sound7(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM, 100 * pitch, 0); self.predator.punchangle_x = crandom() * cvar("g_balance_vore_kick_predator_punchangle"); self.predator.punchangle_y = crandom() * cvar("g_balance_vore_kick_predator_punchangle"); self.predator.punchangle_z = crandom() * cvar("g_balance_vore_kick_predator_punchangle");