set sv_dodging_air_dodging 0
set sv_dodging_wall_dodging 0 "allow dodging off walls"
-set sv_dodging_delay 0.7 "determines how long a player has to wait to be able to dodge again after dodging"
+set sv_dodging_delay 0.5 "determines how long a player has to wait to be able to dodge again after dodging"
set sv_dodging_up_speed 200 "the jump velocity of the dodge"
set sv_dodging_horiz_speed 400 "the horizontal velocity of the dodge"
set sv_dodging_horiz_speed_frozen 200 "the horizontal velocity of the dodge while frozen"
set sv_dodging_sound 1 "if 1 dodging makes a sound. if 0 dodging is silent"
set sv_dodging_frozen 0 "allow dodging while frozen"
set sv_dodging_frozen_doubletap 0
+set sv_dodging_maxspeed 450 "maximum speed a player can be moving at before they dodge again"
// ===========
#define PHYS_DODGING_UP_SPEED STAT(DODGING_UP_SPEED, this)
#define PHYS_DODGING_WALL STAT(DODGING_WALL, this)
#define PHYS_DODGING_AIR STAT(DODGING_AIR, this)
+#define PHYS_DODGING_MAXSPEED STAT(DODGING_MAXSPEED, this)
#define PHYS_DODGING_PRESSED_KEYS(s) (s).pressedkeys
#ifdef CSQC
makevectors(this.angles);
+ bool wall_dodge = false;
+
if(!PHYS_DODGING_AIR)
- if (check_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD) != 1
- && check_close_to_wall(this, PHYS_DODGING_DISTANCE_THRESHOLD) != 1)
- return true;
+ if(!check_close_to_ground(this, PHYS_DODGING_HEIGHT_THRESHOLD))
+ {
+ wall_dodge = check_close_to_wall(this, PHYS_DODGING_DISTANCE_THRESHOLD);
+ if(!wall_dodge) // we're not on the ground, and wall dodging isn't allowed, end it!
+ return true;
+ }
+
+ if(!wall_dodge && PHYS_DODGING_MAXSPEED && vdist(this.velocity, >, PHYS_DODGING_MAXSPEED))
+ return false;
float tap_direction_x = 0;
float tap_direction_y = 0;
float autocvar_sv_dodging_up_speed;
bool autocvar_sv_dodging_wall_dodging;
bool autocvar_sv_dodging_air_dodging;
+float autocvar_sv_dodging_maxspeed = 450;
#endif
REGISTER_STAT(DODGING, int, g_dodging)
REGISTER_STAT(DODGING_UP_SPEED, float, autocvar_sv_dodging_up_speed)
REGISTER_STAT(DODGING_WALL, bool, autocvar_sv_dodging_wall_dodging)
REGISTER_STAT(DODGING_AIR, bool, autocvar_sv_dodging_air_dodging)
+REGISTER_STAT(DODGING_MAXSPEED, float, autocvar_sv_dodging_maxspeed)
REGISTER_STAT(JETPACK_ACCEL_SIDE, float, autocvar_g_jetpack_acceleration_side)
REGISTER_STAT(JETPACK_ACCEL_UP, float, autocvar_g_jetpack_acceleration_up)