]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Use pow() for all scale differences, which should make them much more correct, and...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 20:01:12 +0000 (23:01 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 13 Jul 2011 20:01:12 +0000 (23:01 +0300)
data/qcsrc/server/cl_physics.qc
data/qcsrc/server/cl_player.qc
data/qcsrc/server/sv_main.qc
data/qcsrc/server/vore.qc

index b0b04255c6f126e8c0e7a68135e4b76758627ce4..4394bdba850ac7c34a431509b44069c102c25036 100644 (file)
@@ -55,7 +55,7 @@ void PlayerJump (void)
        }\r
 \r
        mjumpheight = cvar("sv_jumpvelocity");\r
-       if(self.scale) // we are smaller or larger, so we jump lower or higher\r
+       if(cvar("g_healthsize")) // if we are smaller or larger, we jump lower or higher\r
                mjumpheight *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale;\r
        if(self.swallow_progress_prey) // cut jumping based on swallow progress for prey\r
                mjumpheight *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey"));\r
@@ -509,7 +509,7 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
 \r
        if(cvar("g_balance_vore_weight_gravity") > 0) // apply stomach weight\r
                wishspeed *= 1 - bound(0, self.stomach_load * cvar("g_balance_vore_weight_speed"), 1);\r
-       if(self.scale) // we are smaller or larger, so we run slower or faster\r
+       if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster\r
                wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; \r
        if(self.swallow_progress_prey) // cut speed based on swallow progress for prey\r
                wishspeed *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey"));\r
index 92c77a391654ffbf3aee65eec3715bef6bfe73b3..7e4f410553821cc8308b53d4403e353f42a73e00 100644 (file)
@@ -1236,7 +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
-               vol *= (self.scale * cvar("g_healthsize_soundfactor"));\r
+               vol *= pow(self.scale, cvar("g_healthsize_soundfactor"));\r
        vol = bound(0, vol, 1);\r
 \r
        switch(voicetype)\r
index bfdbd9c255e3e344c61c71a2b1e3cae3088accb3..2b86df7e56e9d66d403d47cc7beb3d32150d306d 100644 (file)
@@ -74,7 +74,7 @@ void CreatureFrame (void)
                                        dm = (dm - cvar("g_balance_falldamage_deadminspeed")) * cvar("g_balance_falldamage_factor");\r
                                else\r
                                        dm = min((dm - cvar("g_balance_falldamage_minspeed")) * cvar("g_balance_falldamage_factor"), cvar("g_balance_falldamage_maxdamage"));\r
-                               if(self.scale) // we are smaller or larger, so we take more or less falling damage\r
+                               if(cvar("g_healthsize")) // if we are smaller or larger, we take more or less falling damage\r
                                        dm *= (1 + cvar("g_healthsize_movementfactor")) - cvar("g_healthsize_movementfactor") * self.scale; \r
                                if (dm > 0)\r
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');\r
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