]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Base stomach kick sounds on player scale difference, and tweak the system a bit
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 19:22:43 +0000 (22:22 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 19:22:43 +0000 (22:22 +0300)
data/qcsrc/server/cl_player.qc
data/qcsrc/server/vore.qc

index 7a5d7b1cf7aa2572255c1e692aafb8497f793947..92c77a391654ffbf3aee65eec3715bef6bfe73b3 100644 (file)
@@ -1236,10 +1236,7 @@ void GlobalSound(string sample, float chan, float voicetype)
        if(self.stat_eaten && cvar("g_vore_soundocclusion")) // reduce sound volume for prey, to simulate stomach culling\r
                vol *= cvar("g_vore_soundocclusion");\r
        if(cvar("g_healthsize") && cvar("g_healthsize_soundfactor")) // amplify or reduce sound volume based on the size of the player\r
-       {\r
-               vol /= 2; // volume being greater than 1 causes stuff to brake, so it must be 0.5 at normal scale\r
                vol *= (self.scale * cvar("g_healthsize_soundfactor"));\r
-       }\r
        vol = bound(0, vol, 1);\r
 \r
        switch(voicetype)\r
index e47b06553a0be0af23502af82b28181c5ef4861d..736e7bda8aa089196f2db4506b6442c72591c93a 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