cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02
cl_bobmodel 1 // whether to have gun model move around on screen when moving (only works if cl_bob is not 0), default is 1
cl_leanmodel 1 // enables weapon leaning effect when looking around
+cl_leanmodel_side_speed 1 "gun leaning sideways speed"
+cl_leanmodel_side_limit 35 "gun leaning sideways limit"
+cl_leanmodel_side_highpass1 30 "gun leaning sideways pre-highpass in 1/s"
+cl_leanmodel_side_highpass 3 "gun leaning sideways highpass in 1/s"
+cl_leanmodel_side_lowpass 20 "gun leaning sideways lowpass in 1/s"
+cl_leanmodel_up_speed 1 "gun leaning upward speed"
+cl_leanmodel_up_limit 50 "gun leaning upward limit"
+cl_leanmodel_up_highpass1 5 "gun leaning upward pre-highpass in 1/s"
+cl_leanmodel_up_highpass 15 "gun leaning upward highpass in 1/s"
+cl_leanmodel_up_lowpass 20 "gun leaning upward lowpass in 1/s"
cl_followmodel 1 // enables weapon pushing / pulling effect when walking
+cl_followmodel_side_speed 0.5 "gun following sideways speed"
+cl_followmodel_side_limit 6 "gun following sideways limit"
+cl_followmodel_side_highpass1 30 "gun following sideways pre-highpass in 1/s"
+cl_followmodel_side_highpass 5 "gun following sideways highpass in 1/s"
+cl_followmodel_side_lowpass 10 "gun following sideways lowpass in 1/s"
+cl_followmodel_up_speed 1 "gun following upward speed"
+cl_followmodel_up_limit 5 "gun following upward limit"
+cl_followmodel_up_highpass1 60 "gun following upward pre-highpass in 1/s"
+cl_followmodel_up_highpass 2 "gun following upward highpass in 1/s"
+cl_followmodel_up_lowpass 10 "gun following upward lowpass in 1/s"
+
cl_rollangle 0 // amount of view tilt when strafing, default is 2.0
v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds
gl_polyblend 0.5 // whether to use screen tints, default is 1
set sv_pogostick 1 "don't require releasing the space bar for jumping again"
set sv_doublejump 0 "allow Quake 2-style double jumps"
-set sv_jumpspeedcap_min "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this"
-set sv_jumpspeedcap_max_disable_on_ramps 0 "disable max jumpspeedcap on ramps to preserve the old rampjump style"
+set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)"
+set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)"
+set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style"
seta sv_precacheplayermodels 1
seta sv_precacheweapons 0
void PlayerJump (void)
{
float mjumpheight;
+ float doublejump;
+
+ doublejump = FALSE;
+ if (sv_doublejump)
+ {
+ tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
+ if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
+ doublejump = TRUE;
+ }
mjumpheight = cvar("sv_jumpvelocity");
if (self.waterlevel >= WATERLEVEL_SWIMMING)
return;
}
+ if (!doublejump)
if (!(self.flags & FL_ONGROUND))
return;
mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight");
}
+ // sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline
+ // velocity bounds. Final velocity is bound between (jumpheight *
+ // min + jumpheight) and (jumpheight * max + jumpheight);
+
if(cvar_string("sv_jumpspeedcap_min") != "")
- self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z);
- if(cvar_string("sv_jumpspeedcap_max") != "") {
+ {
+ float minjumpspeed;
+
+ minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min");
+
+ if (self.velocity_z < minjumpspeed)
+ mjumpheight += minjumpspeed - self.velocity_z;
+ }
+
+ if(cvar_string("sv_jumpspeedcap_max") != "")
+ {
+ // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
- if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) {
- // don't do jump speedcaps on ramps to preserve old xonotic ramjump style
- //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n");
+
+ if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")))
+ {
+ float maxjumpspeed;
+
+ maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max");
+
+ if (self.velocity_z > maxjumpspeed)
+ mjumpheight -= self.velocity_z - maxjumpspeed;
}
- else
- self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z) + trace_ent.velocity_z;
}
if(!(self.lastflags & FL_ONGROUND))
string GetMapname(void);
float speedaward_lastupdate;
float speedaward_lastsent;
-.float jumppadusetime;
var float autocvar_g_movement_highspeed = 1;
void SV_PlayerPhysics()
{
if(self.classname == "player")
{
- if(sv_doublejump && time - self.jumppadusetime > 2 * sys_frametime)
- {
- tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
- self.flags &~= FL_ONGROUND;
- if(trace_fraction < 1 && trace_plane_normal_z > 0.7)
- self.flags |= FL_ONGROUND;
- }
-
if (self.BUTTON_JUMP)
PlayerJump ();
else
sv_maxidle = cvar("sv_maxidle");
sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle");
sv_pogostick = cvar("sv_pogostick");
- sv_doublejump = cvar("sv_doublejump");
g_ctf_reverse = cvar("g_ctf_reverse");
sv_autotaunt = cvar("sv_autotaunt");
sv_taunt = cvar("sv_taunt");
sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio");
teamplay = cvar ("teamplay");
sys_frametime = cvar("sys_ticrate") * cvar("slowmo");
+ sv_doublejump = cvar("sv_doublejump");
if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2)
orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout
other.flags &~= FL_ONGROUND;
other.velocity = self.movedir;
- other.jumppadusetime = time;
if (other.classname == "player")
{