7REPLICATE(cvar_cl_physics,
string,
"cl_physics");
8REPLICATE(cvar_cl_jetpack_jump,
bool,
"cl_jetpack_jump");
9REPLICATE(cvar_cl_movement_track_canjump,
bool,
"cl_movement_track_canjump");
30 string s =
strcat(
"g_physics_",
CS_CVAR(
this).cvar_cl_physics,
"_", option);
101 STAT(PL_MIN,
this) =
'-16 -16 -20';
102 STAT(PL_MAX,
this) =
'16 16 36';
103 STAT(PL_VIEW_OFS,
this) =
'0 0 30';
104 STAT(PL_CROUCH_MIN,
this) =
'-16 -16 -20';
156 if (mv_x == 0 && mv_y == 0)
165 return a == 0 ? (_lerp < 1 ? 0 : b)
166 : b == 0 ? (_lerp > 0 ? 0 : a)
167 : a * (
fabs(b / a) ** _lerp);
175 bool have_hook =
false;
182 entity wepent = this.(weaponentity);
184 if(wepent.hook && !wasfreed(wepent.hook))
204 do_crouch =
M_ARGV(1,
bool);
207 if (
STAT(PL_CROUCH_MAX,
this).z ==
STAT(PL_MAX,
this).z)
216 setsize(
this,
STAT(PL_CROUCH_MIN,
this),
STAT(PL_CROUCH_MAX,
this));
227 setsize(
this,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
245 float k = 2 * movity - 1;
251 const float zspeed = this.velocity_z;
256 float dot = this.
velocity * wishdir;
267 this.velocity_z = zspeed;
280void PM_Accelerate(
entity this,
float dt,
vector wishdir,
float wishspeed,
float wishspeed0,
float accel,
float accelqw,
float stretchfactor,
float sidefric,
float speedlimit)
282 float speedclamp = stretchfactor > 0 ? stretchfactor
286 accelqw =
fabs(accelqw);
289 wishspeed0 = wishspeed;
291 float vel_straight = this.
velocity * wishdir;
292 float vel_z = this.velocity_z;
294 vector vel_perpend = vel_xy - vel_straight * wishdir;
296 float step = accel * dt * wishspeed0;
298 float vel_xy_current =
vlen(vel_xy);
300 accelqw =
AdjustAirAccelQW(accelqw, (speedlimit -
bound(wishspeed, vel_xy_current, speedlimit)) /
max(1, speedlimit - wishspeed));
301 float vel_xy_forward = vel_xy_current +
bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
302 float vel_xy_backward = vel_xy_current -
bound(0, wishspeed + vel_xy_current, step) * accelqw - step * (1 - accelqw);
303 vel_xy_backward =
max(0, vel_xy_backward);
304 vel_straight = vel_straight +
bound(0, wishspeed - vel_straight, step) * accelqw + step * (1 - accelqw);
306 if (sidefric < 0 && (vel_perpend*vel_perpend))
309 float f =
max(0, 1 + dt * wishspeed * sidefric);
310 float themin = (vel_xy_backward * vel_xy_backward - vel_straight * vel_straight) / (vel_perpend * vel_perpend);
320 themin =
sqrt(themin);
321 vel_perpend *=
max(themin, f);
325 vel_perpend *=
max(0, 1 - dt * wishspeed * sidefric);
327 vel_xy = vel_straight * wishdir + vel_perpend;
331 float vel_xy_preclamp;
332 vel_xy_preclamp =
vlen(vel_xy);
333 if (vel_xy_preclamp > 0)
335 vel_xy_current += (vel_xy_forward - vel_xy_current) * speedclamp;
336 if (vel_xy_current < vel_xy_preclamp)
337 vel_xy *= (vel_xy_current / vel_xy_preclamp);
341 this.
velocity = vel_xy + vel_z *
'0 0 1';
351 float curspeed =
vlen(curvel);
353 if (wishspeed > curspeed * 1.01)
360 vector wishvel = wishdir * wishspeed;
361 vector acceldir = wishvel - curvel;
362 float addspeed =
vlen(acceldir);
370 float dot = acceldir * curdir;
375 this.
velocity += accelspeed * acceldir;
400 bool doublejump =
false;
407 mjumpheight =
M_ARGV(1,
float);
408 doublejump =
M_ARGV(2,
bool);
444 if (this.velocity_z < minjumpspeed)
445 mjumpheight += minjumpspeed - this.velocity_z;
457 if (this.velocity_z > maxjumpspeed)
458 mjumpheight -= this.velocity_z - maxjumpspeed;
472 this.velocity_x *= f;
473 this.velocity_y *= f;
482 this.velocity_z += mjumpheight;
510 traceline (start, end,
true,
this);
513 start_z = start_z + this.maxs_z - 8;
516 traceline(start, end,
true,
this);
519 this.velocity_z = 225;
529 #define JETPACK_JUMP(s) CS_CVAR(s).cvar_cl_jetpack_jump
531 float autocvar_cl_jetpack_jump;
532 #define JETPACK_JUMP(s) autocvar_cl_jetpack_jump
547 bool air_jump = !playerjump ||
M_ARGV(2,
bool);
551 if (!(
ITEMS_STAT(
this) & ITEM_Jetpack.m_itemid)) { }
588 LOG_INFO(
"A hollow voice says \"Plugh\".");
600 case 0: c =
"x";
break;
601 case BIT(0): c =
"1";
break;
602 case BIT(2): c =
" ";
break;
603 case BIT(7): c =
"s";
break;
604 case BIT(8): c =
"w";
break;
605 case BIT(9): c =
"a";
break;
606 case BIT(10): c =
"d";
break;
612 CS(
this).specialcommand_pos += 1;
615 CS(
this).specialcommand_pos = 0;
621 CS(
this).specialcommand_pos = 0;
662 PHYS_CS(
this).movement =
'0 0 0';
675 if(this.(weaponentity).
hook)
697 if ((
time > this.nextstep) || (
time < (this.nextstep - 10.0)))
727 PHYS_CS(
this).movement =
'0 0 0';
731 PHYS_CS(
this).movement =
'0 0 0';
750 wishvel_z =
sqrt(
max(0, 1 - wishvel * wishvel));
776 float a_diff = a_side * a_side - a_up * a_up;
780 f = a_add * a_up / a_diff;
783 best = (a_diff + a_add * a_add) * (a_diff + a_up * a_up) / a_diff;
788 f = (a_up + a_add) * (a_up + a_add);
795 f = (a_up - a_add) * (a_up - a_add);
814 fvel =
vlen(wishvel);
827 if (f > 0 && wishvel !=
'0 0 0')
void animdecide_setaction(entity e, float action, float restart)
const int ANIMACTION_JUMP
#define MUTATOR_CALLHOOK(id,...)
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
float CheatImpulse(entity this, int imp)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void CSQC_ClientMovement_PlayerMove_Frame(entity this)
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
const int IT_USING_JETPACK
const int IT_UNLIMITED_AMMO
void PM_check_hitground(entity this)
void PM_jetpack(entity this, float maxspd_mod, float dt)
void PM_check_blocked(entity this)
float Physics_ClientOption(entity this, string option, float defaultval)
void PM_check_frozen(entity this)
void CPM_PM_Aircontrol(entity this, float dt, vector wishdir, float wishspeed)
void CheckPlayerJump(entity this)
void sys_phys_update(entity this, float dt)
void PM_ClientMovement_UpdateStatus(entity this)
bool Physics_Valid(string thecvar)
float GeomLerp(float a, float _lerp, float b)
void PM_check_punch(entity this, float dt)
void Physics_UpdateStats(entity this)
bool PM_check_specialcommand(entity this, int buttons)
void PM_check_slick(entity this)
bool PlayerJump(entity this)
float AdjustAirAccelQW(float accelqw, float factor)
void SpecialCommand(entity this)
void CheckWaterJump(entity this)
float IsMoveInDirection(vector mv, float ang)
bool IsFlying(entity this)
void PM_Accelerate(entity this, float dt, vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit)
void PM_AirAccelerate(entity this, float dt, vector wishdir, float wishspeed)
void PM_Footsteps(entity this)
#define PHYS_CL_TRACK_CANJUMP(s)
vector autocvar_sv_player_crouch_viewoffset
float autocvar_sv_airstrafeaccel_qw
float autocvar_sv_warsowbunny_airforwardaccel
#define PHYS_INPUT_BUTTON_CROUCH(s)
bool autocvar_g_footsteps
#define PHYS_JETPACK_FUEL(s)
vector autocvar_sv_player_viewoffset
#define PHYS_WARSOWBUNNY_ACCEL(s)
bool autocvar_g_jump_grunt
float autocvar_sv_jumpvelocity
#define PHYS_INPUT_TIMELENGTH
vector autocvar_sv_player_crouch_mins
vector autocvar_sv_player_maxs
#define PHYS_JETPACK_MAXSPEED_UP(s)
#define PHYS_JUMPSPEEDCAP_MAX(s)
float autocvar_sv_warsowbunny_turnaccel
float autocvar_sv_friction
string autocvar_g_physics_clientselect_options
#define PHYS_JETPACK_REVERSE_THRUST(s)
#define PHYS_WARSOWBUNNY_TOPSPEED(s)
#define PHYS_INPUT_BUTTON_JUMP(s)
#define PHYS_WARSOWBUNNY_AIRFORWARDACCEL(s)
#define PHYS_AIRCONTROL_PENALTY(s)
float autocvar_sv_jumpspeedcap_min
float autocvar_sv_airaccelerate
#define PHYS_INPUT_BUTTON_CHAT(s)
float autocvar_sv_accelerate
#define PHYS_JUMPVELOCITY(s)
#define PHYS_WARSOWBUNNY_BACKTOSIDERATIO(s)
float autocvar_sv_maxspeed
float autocvar_sv_warsowbunny_accel
#define PHYS_INPUT_BUTTON_JETPACK(s)
bool autocvar_sv_jumpspeedcap_max_disable_on_ramps
float autocvar_sv_airaccel_qw_stretchfactor
#define PHYS_JETPACK_ACCEL_SIDE(s)
#define PHYS_INVEHICLE(s)
float autocvar_sv_airstopaccelerate
#define PHYS_TRACK_CANJUMP(s)
#define PHYS_MAXAIRSPEED(s)
float autocvar_sv_aircontrol_penalty
float autocvar_sv_warsowbunny_topspeed
bool autocvar_g_physics_clientselect
float autocvar_sv_airspeedlimit_nonqw
#define PHYS_JUMPVELOCITY_CROUCH(s)
vector autocvar_sv_player_crouch_maxs
#define PHYS_JETPACK_ACCEL_UP(s)
float autocvar_sv_maxairstrafespeed
bool autocvar_sv_airstopaccelerate_full
int autocvar_sv_aircontrol_flags
float autocvar_sv_aircontrol_power
#define PHYS_INPUT_BUTTON_MINIGAME(s)
float autocvar_sv_slickaccelerate
float autocvar_sv_warsowbunny_backtosideratio
#define PHYS_JETPACK_ANTIGRAVITY(s)
float autocvar_sv_airstrafeaccelerate
#define UNSET_JUMP_HELD(s)
vector autocvar_sv_player_mins
#define PHYS_AMMO_FUEL(s)
#define PHYS_HIGHSPEED(s)
string autocvar_g_physics_clientselect_default
float autocvar_sv_track_canjump
float autocvar_sv_airaccel_qw
#define PHYS_AIRCONTROL_FLAGS(s)
float autocvar_sv_maxairspeed
float autocvar_sv_jumpspeedcap_max
float autocvar_g_movement_highspeed
#define PHYS_DODGING_FROZEN(s)
float autocvar_sv_airaccel_sideways_friction
#define PHYS_WARSOWBUNNY_TURNACCEL(s)
float autocvar_sv_jumpvelocity_crouch
#define PHYS_FRICTION_ONLAND(s)
bool autocvar_g_movement_highspeed_q3_compat
#define PHYS_AIRCONTROL_POWER(s)
float autocvar_sv_aircontrol
float autocvar_sv_stopspeed
#define PHYS_AIRCONTROL(s)
#define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS(s)
#define PHYS_JETPACK_MAXSPEED_SIDE(s)
#define PHYS_JUMPSPEEDCAP_MIN(s)
#define autocvar_sv_gravity
int autocvar_sv_gameplayfix_stepdown
var float autocvar_sv_friction_slick
float autocvar_sv_stepheight
const float MOVE_NOMONSTERS
float Q3SURFACEFLAG_SLICK
float CVAR_TYPEFLAG_EXISTS
float Q3SURFACEFLAG_METALSTEPS
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOSTEPS
vector trace_plane_normal
bool autocvar_sv_doublejump
float disableclientprediction
#define GlobalSound(this, def, chan, vol, voicetype)
const int VOICETYPE_PLAYERSOUND
#define PlayerSound(this, def, chan, vol, voicetype, pitchscale)
#define REPLICATE(...)
Replicates a client cvar into a server field.
bool WarpZoneLib_ExactTrigger_Touch(entity this, entity toucher, bool touchfunc)
const int VIEWLOC_FREEMOVE
float remainder(float e, float f)
float copysign(float e, float f)
bool _Movetype_CheckWater(entity this)
const int WATERLEVEL_SWIMMING
#define GAMEPLAYFIX_STEPDOWN(s)
#define UNSET_ONGROUND(s)
#define GAMEPLAYFIX_Q2AIRACCELERATE
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
bool autocvar_sv_q3compat_changehitbox
void PM_UpdateButtons(entity this, entity store)
float pauseregen_finished
ClientState CS(Client this)
float autocvar_g_balance_pause_fuel_regen
#define IS_REAL_CLIENT(v)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity viewmodels[MAX_WEAPONSLOTS]
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
bool autocvar_sv_mapformat_is_quake3
bool autocvar_sv_mapformat_is_quake2