Use pow() for all scale differences, which should make them much more correct, and...
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 736e7bda8aa089196f2db4506b6442c72591c93a..506d227ec4d8cf3ceb32408d4a3691625475ff3e 100644 (file)
@@ -16,7 +16,7 @@ entity Swallow_player_check()
        vector vore_w_shotorg, vore_w_shotdir;\r
 \r
        swallow_range = cvar("g_balance_vore_swallow_range");\r
-       if(self.scale) // we can swallow from further or closer based on our size\r
+       if(cvar("g_healthsize")) // we can swallow from further or closer based on our size\r
                swallow_range *= self.scale;\r
        vore_w_shotorg = self.origin;\r
        vore_w_shotdir = v_forward;\r
@@ -321,8 +321,8 @@ void Vore_SwallowStep(entity e)
        {\r
                float fill;\r
                fill = cvar("g_balance_vore_swallow_speed_fill") * frametime;\r
-               if(cvar("g_balance_vore_swallow_speed_fill_scalediff")) // fill rate depends on predator size compared to prey size\r
-                       fill *= (self.scale / e.scale);\r
+               if(cvar("g_healthsize") && cvar("g_balance_vore_swallow_speed_fill_scalediff")) // fill rate depends on predator size compared to prey size\r
+                       fill *= pow(self.scale / e.scale, cvar("g_balance_vore_swallow_speed_fill_scalediff"));\r
                if(cvar("g_balance_vore_swallow_speed_fill_stomachload") && e.stomach_load) // fill rate is influenced by the prey's stomach load\r
                        fill /= e.stomach_load;\r
 \r
@@ -490,8 +490,8 @@ void Vore_Digest()
                damage = cvar("g_balance_vore_digestion_damage") / reduce;\r
 \r
                // apply player scale to digestion damage\r
-               if(cvar("g_balance_vore_digestion_scalediff"))\r
-                       damage *= (self.predator.scale / self.scale);\r
+               if(cvar("g_healthsize") && cvar("g_balance_vore_digestion_scalediff"))\r
+                       damage *= pow(self.predator.scale / self.scale, cvar("g_balance_vore_digestion_scalediff"));\r
 \r
                Damage(self, self.predator, self.predator, damage, DEATH_DIGESTION, self.origin, '0 0 0');\r
                if(cvar("g_balance_vore_digestion_vampire") && self.predator.health < cvar("g_balance_vore_digestion_vampire_stable"))\r
@@ -546,9 +546,9 @@ void Vore_StomachKick()
                // apply player scale to the damage / force of the kick\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
+                       damage *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff"));\r
+                       force *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff"));\r
+                       vol *= pow(self.scale / self.predator.scale, cvar("g_balance_vore_kick_scalediff")); // kick sound volume based on the same scale\r
                }\r
                vol = bound(0, vol, 1);\r
 \r