Commit 698ec86f authored by Mario's avatar Mario

Add an option to change jump height while crouching

parent 3fe48a1a
Pipeline #14135959 passed with stages
in 22 minutes and 5 seconds
......@@ -77,6 +77,7 @@ set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; fina
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"
set sv_track_canjump 0 "track if the player released the jump key between 2 jumps to decide if they are able to jump or not"
set sv_jumpvelocity_crouch 0 "jump height while crouching, set to 0 to use regular jump height"
set sv_precacheplayermodels 1
set sv_precacheweapons 0
......
......@@ -18,6 +18,7 @@ set g_physics_xonotic_airstrafeaccel_qw -0.95
set g_physics_xonotic_airspeedlimit_nonqw 900
set g_physics_xonotic_maxspeed 360
set g_physics_xonotic_jumpvelocity 260
set g_physics_xonotic_jumpvelocity_crouch 0
set g_physics_xonotic_maxairstrafespeed 100
set g_physics_xonotic_maxairspeed 360
set g_physics_xonotic_airstrafeaccelerate 18
......@@ -48,6 +49,7 @@ set g_physics_nexuiz_airstrafeaccel_qw 0
set g_physics_nexuiz_airspeedlimit_nonqw 0
set g_physics_nexuiz_maxspeed 400
set g_physics_nexuiz_jumpvelocity 300 "333 to match xonotic physics"
set g_physics_nexuiz_jumpvelocity_crouch 0 "333 to match xonotic physics"
set g_physics_nexuiz_maxairstrafespeed 0
set g_physics_nexuiz_maxairspeed 220
set g_physics_nexuiz_airstrafeaccelerate 0
......@@ -78,6 +80,7 @@ set g_physics_quake_airstrafeaccel_qw 0
set g_physics_quake_airspeedlimit_nonqw 0
set g_physics_quake_maxspeed 320
set g_physics_quake_jumpvelocity 270
set g_physics_quake_jumpvelocity_crouch 0
set g_physics_quake_maxairstrafespeed 0
set g_physics_quake_maxairspeed 30
set g_physics_quake_airstrafeaccelerate 0
......@@ -108,6 +111,7 @@ set g_physics_warsow_airstrafeaccel_qw 0
set g_physics_warsow_airspeedlimit_nonqw 0
set g_physics_warsow_maxspeed 320
set g_physics_warsow_jumpvelocity 280
set g_physics_warsow_jumpvelocity_crouch 0
set g_physics_warsow_maxairstrafespeed 30
set g_physics_warsow_maxairspeed 320
set g_physics_warsow_airstrafeaccelerate 70
......@@ -138,6 +142,7 @@ set g_physics_defrag_airstrafeaccel_qw 1
set g_physics_defrag_airspeedlimit_nonqw 0
set g_physics_defrag_maxspeed 320
set g_physics_defrag_jumpvelocity 270
set g_physics_defrag_jumpvelocity_crouch 0
set g_physics_defrag_maxairstrafespeed 30
set g_physics_defrag_maxairspeed 320
set g_physics_defrag_airstrafeaccelerate 70
......@@ -168,6 +173,7 @@ set g_physics_quake3_airstrafeaccel_qw 0
set g_physics_quake3_airspeedlimit_nonqw 0
set g_physics_quake3_maxspeed 320
set g_physics_quake3_jumpvelocity 270
set g_physics_quake3_jumpvelocity_crouch 0
set g_physics_quake3_maxairstrafespeed 0
set g_physics_quake3_maxairspeed 320
set g_physics_quake3_airstrafeaccelerate 0
......@@ -198,6 +204,7 @@ set g_physics_vecxis_airstrafeaccel_qw 0
set g_physics_vecxis_airspeedlimit_nonqw 0
set g_physics_vecxis_maxspeed 400
set g_physics_vecxis_jumpvelocity 300 "333 to match xonotic physics"
set g_physics_vecxis_jumpvelocity_crouch 0 "333 to match xonotic physics"
set g_physics_vecxis_maxairstrafespeed 0
set g_physics_vecxis_maxairspeed 220
set g_physics_vecxis_airstrafeaccelerate 0
......@@ -228,6 +235,7 @@ set g_physics_quake2_airstrafeaccel_qw 0
set g_physics_quake2_airspeedlimit_nonqw 0
set g_physics_quake2_maxspeed 300
set g_physics_quake2_jumpvelocity 270
set g_physics_quake2_jumpvelocity_crouch 0
set g_physics_quake2_maxairstrafespeed 0
set g_physics_quake2_maxairspeed 300
set g_physics_quake2_airstrafeaccelerate 0
......@@ -258,6 +266,7 @@ set g_physics_bones_airstrafeaccel_qw 1
set g_physics_bones_airspeedlimit_nonqw 0
set g_physics_bones_maxspeed 320
set g_physics_bones_jumpvelocity 270
set g_physics_bones_jumpvelocity_crouch 0
set g_physics_bones_maxairstrafespeed 30
set g_physics_bones_maxairspeed 320
set g_physics_bones_airstrafeaccelerate 70
......@@ -288,6 +297,7 @@ set g_physics_overkill_airstrafeaccel_qw -0.95
set g_physics_overkill_airspeedlimit_nonqw 900
set g_physics_overkill_maxspeed 400
set g_physics_overkill_jumpvelocity 260
set g_physics_overkill_jumpvelocity_crouch 0
set g_physics_overkill_maxairstrafespeed 100
set g_physics_overkill_maxairspeed 360
set g_physics_overkill_airstrafeaccelerate 24
......
......@@ -11,6 +11,7 @@ sv_friction 8
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate 4
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 8
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0 // breaks strafing?
......
......@@ -11,6 +11,7 @@ sv_friction 7
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.65
......
......@@ -18,6 +18,7 @@ sv_stepheight 26
// actually, what we want is 266.6666 for 180bpm
// but 260 takes same amount of frames and is nicer to mappers
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0 // breaks strafing?
......
......@@ -18,6 +18,7 @@ sv_stepheight 26
// actually, what we want is 266.6666 for 180bpm
// but 260 takes same amount of frames and is nicer to mappers
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -13,6 +13,7 @@ sv_friction 9.6 // higher values make you slide less
edgefriction 1 // div0 says no! lol
sv_stepheight 26
sv_jumpvelocity 304
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0 // pain in the ass to tweak without screwing up the strafing
......
......@@ -12,6 +12,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 310
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.35
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.3
......
......@@ -11,6 +11,7 @@ sv_friction 7
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.35
......
......@@ -11,6 +11,7 @@ sv_friction 7
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.35
......
......@@ -19,6 +19,7 @@ sv_stepheight 26
// actually, what we want is 266.6666 for 180bpm
// but 260 takes same amount of frames and is nicer to mappers
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -24,6 +24,7 @@ sv_stepheight 31
// this is smaller than 112 qu, so a 112 qu high corridor (7 of 8 grid units in
// the 16 grid, and the 8th unit used for wall/floor) just lets a player jump!
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -12,6 +12,7 @@ sv_friction 4
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 6
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -12,6 +12,7 @@ sv_friction 6
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 6
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate 4
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.8
......
......@@ -11,6 +11,7 @@ sv_friction 5
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.5
......
......@@ -11,6 +11,7 @@ sv_friction 4
edgefriction 1
sv_stepheight 34
sv_jumpvelocity 300
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0.3
......
......@@ -11,6 +11,7 @@ sv_friction 8
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 280
sv_jumpvelocity_crouch 0
sv_wateraccelerate 10
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 8
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 280
sv_jumpvelocity_crouch 0
sv_wateraccelerate 10
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -11,6 +11,7 @@ sv_friction 8
edgefriction 1
sv_stepheight 18
sv_jumpvelocity 280
sv_jumpvelocity_crouch 0
sv_wateraccelerate 10
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -25,6 +25,7 @@ sv_stepheight 31
// this is smaller than 112 qu, so a 112 qu high corridor (7 of 8 grid units in
// the 16 grid, and the 8th unit used for wall/floor) just lets a player jump!
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -18,6 +18,7 @@ sv_stepheight 26
// actually, what we want is 266.6666 for 180bpm
// but 260 takes same amount of frames and is nicer to mappers
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -24,6 +24,7 @@ sv_stepheight 26
// this is smaller than 112 qu, so a 112 qu high corridor (7 of 8 grid units in
// the 16 grid, and the 8th unit used for wall/floor) just lets a player jump!
sv_jumpvelocity 260
sv_jumpvelocity_crouch 0
sv_wateraccelerate -1
sv_waterfriction -1
sv_airaccel_sideways_friction 0
......
......@@ -16,6 +16,7 @@ edgefriction 1
sv_stepheight 26
// CPMA: 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate 4
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -16,6 +16,7 @@ edgefriction 1
sv_stepheight 26
// CPMA: 18
sv_jumpvelocity 270
sv_jumpvelocity_crouch 0
sv_wateraccelerate 4
sv_waterfriction 1
sv_airaccel_sideways_friction 0
......
......@@ -75,6 +75,7 @@ void Physics_UpdateStats(entity this)
STAT(MOVEVARS_AIRACCELERATE, this) = Physics_ClientOption(this, "airaccelerate", autocvar_sv_airaccelerate);
STAT(MOVEVARS_AIRSTOPACCELERATE, this) = Physics_ClientOption(this, "airstopaccelerate", autocvar_sv_airstopaccelerate);
STAT(MOVEVARS_JUMPVELOCITY, this) = Physics_ClientOption(this, "jumpvelocity", autocvar_sv_jumpvelocity);
STAT(MOVEVARS_JUMPVELOCITY_CROUCH, this) = Physics_ClientOption(this, "jumpvelocity_crouch", autocvar_sv_jumpvelocity_crouch);
STAT(MOVEVARS_TRACK_CANJUMP, this) = Physics_ClientOption(this, "track_canjump", autocvar_sv_track_canjump);
}
#endif
......@@ -303,7 +304,7 @@ bool PlayerJump(entity this)
#endif
bool doublejump = false;
float mjumpheight = PHYS_JUMPVELOCITY(this);
float mjumpheight = ((PHYS_JUMPVELOCITY_CROUCH(this) && IS_DUCKED(this)) ? PHYS_JUMPVELOCITY_CROUCH(this) : PHYS_JUMPVELOCITY(this));
bool track_jump = PHYS_CL_TRACK_CANJUMP(this);
if (MUTATOR_CALLHOOK(PlayerJump, this, mjumpheight, doublejump))
......
......@@ -82,6 +82,7 @@ bool IsFlying(entity a);
#define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS(s) STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS)
#define PHYS_JUMPVELOCITY(s) STAT(MOVEVARS_JUMPVELOCITY, s)
#define PHYS_JUMPVELOCITY_CROUCH(s) STAT(MOVEVARS_JUMPVELOCITY_CROUCH, s)
#define PHYS_MAXAIRSPEED(s) STAT(MOVEVARS_MAXAIRSPEED, s)
#define PHYS_MAXAIRSTRAFESPEED(s) STAT(MOVEVARS_MAXAIRSTRAFESPEED, s)
......
......@@ -338,6 +338,7 @@ REGISTER_STAT(MOVEVARS_AIRACCELERATE, float)
// FIXME: Was 0 on server, 1 on client. Still want that?
REGISTER_STAT(MOVEVARS_ENTGRAVITY, float, (this.gravity) ? this.gravity : 1)
REGISTER_STAT(MOVEVARS_JUMPVELOCITY, float)
REGISTER_STAT(MOVEVARS_JUMPVELOCITY_CROUCH, float)
REGISTER_STAT(MOVEVARS_MAXAIRSPEED, float)
REGISTER_STAT(MOVEVARS_STEPHEIGHT, float, autocvar_sv_stepheight)
REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
......
......@@ -311,6 +311,7 @@ string autocvar_sv_jumpspeedcap_max;
float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
string autocvar_sv_jumpspeedcap_min;
float autocvar_sv_jumpvelocity;
float autocvar_sv_jumpvelocity_crouch;
bool autocvar_sv_logscores_bots;
bool autocvar_sv_logscores_console;
bool autocvar_sv_logscores_file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment