]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_physics.qc
Merge branch 'master' into Mario/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index b5b6ad793570cd4a980d7e68048da9918c733e5d..6f05c456804e73a8ba4371067dd21ff3ad3e3967 100644 (file)
@@ -19,16 +19,19 @@ When you press the jump key
 */
 void PlayerJump (void)
 {
+       if(self.player_blocked)
+               return; // no jumping while blocked
+
        float doublejump = FALSE;
 
        player_multijump = doublejump;
        if(MUTATOR_CALLHOOK(PlayerJump))
                return;
-               
+
        doublejump = player_multijump;
 
        float mjumpheight;
-       
+
        if (autocvar_sv_doublejump)
        {
                tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
@@ -110,7 +113,7 @@ void PlayerJump (void)
        self.flags &= ~FL_JUMPRELEASED;
 
        animdecide_setaction(self, ANIMACTION_JUMP, TRUE);
-       
+
        if(autocvar_g_jump_grunt)
                PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
 
@@ -517,9 +520,9 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        }
        else
                vel_perpend = vel_perpend * max(0, 1 - frametime * wishspeed * sidefric);
-       
+
        vel_xy = vel_straight * wishdir + vel_perpend;
-       
+
        if(speedclamp >= 0)
        {
                float vel_xy_preclamp;
@@ -633,12 +636,10 @@ void SV_PlayerPhysics()
        string c;
 
        WarpZone_PlayerPhysics_FixVAngle();
-       
+
        maxspd_mod = 1;
        if(self.ballcarried)
-               if(g_nexball)
-                       maxspd_mod *= autocvar_g_nexball_basketball_carrier_highspeed;
-               else if(g_keepaway)
+               if(g_keepaway)
                        maxspd_mod *= autocvar_g_keepaway_ballcarrier_highspeed;
 
        maxspd_mod *= autocvar_g_movement_highspeed;
@@ -747,7 +748,7 @@ void SV_PlayerPhysics()
                        return;
                bot_think();
        }
-       
+
        self.items &= ~IT_USING_JETPACK;
 
        if(IS_PLAYER(self))
@@ -785,6 +786,12 @@ void SV_PlayerPhysics()
        if(time < self.ladder_time)
                self.disableclientprediction = 1;
 
+       if(time < self.spider_slowness)
+       {
+               self.stat_sv_maxspeed *= 0.5; // half speed while slow from spider
+               self.stat_sv_airspeedlimit_nonqw *= 0.5;
+       }
+
        MUTATOR_CALLHOOK(PlayerPhysics);
 
        if(self.player_blocked)
@@ -804,7 +811,7 @@ void SV_PlayerPhysics()
        if(self.conveyor.state)
                self.velocity -= self.conveyor.movedir;
 
-       if not(IS_PLAYER(self))
+       if (!IS_PLAYER(self))
        {
                maxspd_mod = autocvar_sv_spectator_speed_multiplier;
                if(!self.spectatorspeed)
@@ -860,12 +867,12 @@ void SV_PlayerPhysics()
 
                if(self.waterlevel < WATERLEVEL_SWIMMING)
                if(time >= self.ladder_time)
-               if not(self.hook)
+               if (!self.hook)
                {
                        self.nextstep = time + 0.3 + random() * 0.1;
                        trace_dphitq3surfaceflags = 0;
                        tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
-                       if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
+                       if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS))
                        {
                                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
                                        GlobalSound(globalsound_metalfall, CH_PLAYER, VOICETYPE_PLAYERSOUND);
@@ -1076,7 +1083,7 @@ void SV_PlayerPhysics()
                if (f > 0 && wishvel != '0 0 0')
                {
                        self.velocity = self.velocity + wishvel * f * frametime;
-                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+                       if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
                                self.ammo_fuel -= autocvar_g_jetpack_fuel * frametime * fvel * f;
                        self.flags &= ~FL_ONGROUND;
                        self.items |= IT_USING_JETPACK;
@@ -1269,15 +1276,16 @@ void SV_PlayerPhysics()
                }
        }
 
+       // WEAPONTODO
        float xyspeed;
        xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
-       if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge && autocvar_g_balance_nex_charge_velocity_rate && xyspeed > autocvar_g_balance_nex_charge_minspeed)
+       if(self.weapon == WEP_VORTEX && WEP_CVAR(vortex, charge) && WEP_CVAR(vortex, charge_velocity_rate) && xyspeed > WEP_CVAR(vortex, charge_minspeed))
        {
                // add a maximum of charge_velocity_rate when going fast (f = 1), gradually increasing from minspeed (f = 0) to maxspeed
-               xyspeed = min(xyspeed, autocvar_g_balance_nex_charge_maxspeed);
-               f = (xyspeed - autocvar_g_balance_nex_charge_minspeed) / (autocvar_g_balance_nex_charge_maxspeed - autocvar_g_balance_nex_charge_minspeed);
+               xyspeed = min(xyspeed, WEP_CVAR(vortex, charge_maxspeed));
+               f = (xyspeed - WEP_CVAR(vortex, charge_minspeed)) / (WEP_CVAR(vortex, charge_maxspeed) - WEP_CVAR(vortex, charge_minspeed));
                // add the extra charge
-               self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_velocity_rate * f * frametime);
+               self.vortex_charge = min(1, self.vortex_charge + WEP_CVAR(vortex, charge_velocity_rate) * f * frametime);
        }
 :end
        if(self.flags & FL_ONGROUND)