Also cut the veolcity of predators, the closer they are to swallowing. Do it more...
[voretournament/voretournament.git] / data / qcsrc / server / cl_physics.qc
index 9c2a82d..b0b0425 100644 (file)
@@ -56,7 +56,12 @@ void PlayerJump (void)
 \r
        mjumpheight = cvar("sv_jumpvelocity");\r
        if(self.scale) // we are smaller or larger, so we jump lower or higher\r
-               mjumpheight *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; \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
+       if(self.swallow_progress_pred) // cut jumping based on swallow progress for preds\r
+               mjumpheight *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred"));\r
+\r
        if (self.waterlevel >= WATERLEVEL_SWIMMING)\r
        {\r
                if (self.watertype == CONTENT_WATER)\r
@@ -502,8 +507,14 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        if(speedclamp)\r
                accelqw = -accelqw;\r
 \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
                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
+       if(self.swallow_progress_pred) // cut speed based on swallow progress for preds\r
+               wishspeed *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred"));\r
 \r
        if(cvar("sv_gameplayfix_q2airaccelerate"))\r
                wishspeed0 = wishspeed;\r
@@ -774,7 +785,7 @@ void SV_PlayerPhysics()
                }\r
        }\r
 \r
-       if(self.predator.classname == "player" || self.fakepredator.classname == "player")\r
+       if(self.stat_eaten)\r
                return;\r
 \r
        if (self.movetype == MOVETYPE_NONE)\r
@@ -822,8 +833,6 @@ void SV_PlayerPhysics()
        }\r
 \r
        maxspd_mod *= swampspd_mod; // only one common speed modder please!\r
-       if(cvar("g_balance_vore_weight_gravity") > 0)\r
-               maxspd_mod *= 1 - bound(0, self.stomach_load * cvar("g_balance_vore_weight_speed"), 1); // apply stomach weight\r
        swampspd_mod = 1;\r
 \r
        // if dead, behave differently\r
@@ -980,7 +989,7 @@ void SV_PlayerPhysics()
                        PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);\r
                }\r
        }\r
-       else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && self.predator.classname != "player")\r
+       else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.stat_eaten)\r
        {\r
                //makevectors(self.v_angle_y * '0 1 0');\r
                makevectors(self.v_angle);\r
@@ -1082,7 +1091,7 @@ void SV_PlayerPhysics()
        else if (self.flags & FL_ONGROUND)\r
        {\r
                // we get here if we ran out of ammo\r
-               if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player")\r
+               if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)\r
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");\r
 \r
                // walking\r
@@ -1143,7 +1152,7 @@ void SV_PlayerPhysics()
        {\r
                float wishspeed0;\r
                // we get here if we ran out of ammo\r
-               if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player")\r
+               if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)\r
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");\r
 \r
                if(maxspd_mod < 1)\r