Base stomach kick sounds on player scale difference, and tweak the system a bit
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index e47b065..736e7bd 100644 (file)
@@ -537,20 +537,23 @@ void Vore_StomachKick()
 \r
        if(time > self.stomachkick_delay && !self.kick_pressed)\r
        {\r
-               float damage;\r
+               float damage, vol;\r
                vector force;\r
                damage = ceil(random() * (cvar("g_balance_vore_kick_damage_max") - cvar("g_balance_vore_kick_damage_min")) + cvar("g_balance_vore_kick_damage_min"));\r
                force = v_forward * cvar("g_balance_vore_kick_force");\r
+               vol = VOL_BASE;\r
 \r
                // apply player scale to the damage / force of the kick\r
-               if(cvar("g_balance_vore_kick_scalediff"))\r
+               if(cvar("g_healthsize") && cvar("g_balance_vore_kick_scalediff"))\r
                {\r
                        damage *= (self.scale / self.predator.scale);\r
                        force *= (self.scale / self.predator.scale);\r
+                       vol *= (self.scale / self.predator.scale); // kick sound volume based on the same scale\r
                }\r
+               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_BASE, ATTN_NORM);\r
+               sound(self.predator, CHAN_PROJECTILE, strcat("weapons/hit", ftos(floor(random() * 8)), ".wav"), vol, ATTN_NORM);\r
                self.predator.punchangle_x -= cvar("g_balance_vore_kick_predator_punchangle");\r
                self.punchangle_x += cvar("g_balance_vore_kick_prey_punchangle");\r
 \r