.float stat_sv_maxspeed;
.float stat_movement_highspeed;
+.float stat_sv_friction_on_land;
+.float stat_sv_friction_slick;
+
.float stat_doublejump;
.float stat_jumpspeedcap_min;
addstat(STAT_MOVEVARS_JUMPSPEEDCAP_MIN, AS_FLOAT, stat_jumpspeedcap_min);
addstat(STAT_MOVEVARS_JUMPSPEEDCAP_MIN, AS_FLOAT, stat_jumpspeedcap_min);
addstat(STAT_MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, AS_INT, stat_jumpspeedcap_disable_onramps);
+
+ // hacks
+ addstat(STAT_MOVEVARS_FRICTION_ONLAND, AS_FLOAT, stat_sv_friction_on_land);
+ addstat(STAT_MOVEVARS_FRICTION_SLICK, AS_FLOAT, stat_sv_friction_slick);
}
void Physics_UpdateStats(float maxspd_mod)
self.stat_jumpspeedcap_min = PHYS_JUMPSPEEDCAP_MIN;
self.stat_jumpspeedcap_max = PHYS_JUMPSPEEDCAP_MAX;
self.stat_jumpspeedcap_disable_onramps = PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS;
+
+ self.stat_sv_friction_on_land = PHYS_FRICTION_ONLAND;
+ self.stat_sv_friction_slick = PHYS_FRICTION_SLICK;
}
#endif
float f = vlen(vec2(self.velocity));
if (f > 0)
{
+ float realfriction;
+ trace_dphitq3surfaceflags = 0;
+ tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
// TODO: apply edge friction
// apply ground friction
- f = 1 - PHYS_INPUT_TIMELENGTH * PHYS_FRICTION * ((f < PHYS_STOPSPEED) ? (PHYS_STOPSPEED / f) : 1);
+ if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK)
+ realfriction = PHYS_FRICTION_SLICK;
+ else
+ realfriction = PHYS_FRICTION;
+
+ f = 1 - PHYS_INPUT_TIMELENGTH * realfriction * ((f < PHYS_STOPSPEED) ? (PHYS_STOPSPEED / f) : 1);
f = max(0, f);
self.velocity *= f;
/*
#define PHYS_AIRSTRAFEACCELERATE getstatf(STAT_MOVEVARS_AIRSTRAFEACCELERATE)
#define PHYS_ENTGRAVITY(s) getstatf(STAT_MOVEVARS_ENTGRAVITY)
#define PHYS_FRICTION getstatf(STAT_MOVEVARS_FRICTION)
+ #define PHYS_FRICTION_SLICK getstatf(STAT_MOVEVARS_FRICTION_SLICK)
#define PHYS_FRICTION_ONLAND getstatf(STAT_MOVEVARS_FRICTION_ONLAND)
#define PHYS_GRAVITY getstatf(STAT_MOVEVARS_GRAVITY)
#define PHYS_HIGHSPEED getstatf(STAT_MOVEVARS_HIGHSPEED)
#define PHYS_AIRSTRAFEACCELERATE autocvar_sv_airstrafeaccelerate
#define PHYS_ENTGRAVITY(s) s.gravity
#define PHYS_FRICTION autocvar_sv_friction
+ #define PHYS_FRICTION_SLICK autocvar_sv_friction_slick
#define PHYS_FRICTION_ONLAND autocvar_sv_friction_on_land
#define PHYS_GRAVITY autocvar_sv_gravity
#define PHYS_HIGHSPEED autocvar_g_movement_highspeed
float autocvar_sv_eventlog_files_timestamps;
float autocvar_sv_friction;
float autocvar_sv_friction_on_land;
+var float autocvar_sv_friction_slick = 1;
float autocvar_sv_gameplayfix_q2airaccelerate;
float autocvar_sv_gentle;
#define autocvar_sv_gravity cvar("sv_gravity")