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';
147 if (mv_x == 0 && mv_y == 0)
156 return a == 0 ? (_lerp < 1 ? 0 : b)
157 : b == 0 ? (_lerp > 0 ? 0 : a)
158 : a * (
fabs(b / a) ** _lerp);
166 bool have_hook =
false;
173 entity wepent = this.(weaponentity);
175 if(wepent.hook && !wasfreed(wepent.hook))
195 do_crouch =
M_ARGV(1,
bool);
198 if (
STAT(PL_CROUCH_MAX,
this).z ==
STAT(PL_MAX,
this).z)
207 setsize(
this,
STAT(PL_CROUCH_MIN,
this),
STAT(PL_CROUCH_MAX,
this));
218 setsize(
this,
STAT(PL_MIN,
this),
STAT(PL_MAX,
this));
236 float k = 2 * movity - 1;
242 const float zspeed = this.velocity_z;
247 float dot = this.
velocity * wishdir;
258 this.velocity_z = zspeed;
271void PM_Accelerate(
entity this,
float dt,
vector wishdir,
float wishspeed,
float wishspeed0,
float accel,
float accelqw,
float stretchfactor,
float sidefric,
float speedlimit)
273 float speedclamp = stretchfactor > 0 ? stretchfactor
277 accelqw =
fabs(accelqw);
280 wishspeed0 = wishspeed;
282 float vel_straight = this.
velocity * wishdir;
283 float vel_z = this.velocity_z;
285 vector vel_perpend = vel_xy - vel_straight * wishdir;
287 float step = accel * dt * wishspeed0;
289 float vel_xy_current =
vlen(vel_xy);
291 accelqw =
AdjustAirAccelQW(accelqw, (speedlimit -
bound(wishspeed, vel_xy_current, speedlimit)) /
max(1, speedlimit - wishspeed));
292 float vel_xy_forward = vel_xy_current +
bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
293 float vel_xy_backward = vel_xy_current -
bound(0, wishspeed + vel_xy_current, step) * accelqw - step * (1 - accelqw);
294 vel_xy_backward =
max(0, vel_xy_backward);
295 vel_straight = vel_straight +
bound(0, wishspeed - vel_straight, step) * accelqw + step * (1 - accelqw);
297 if (sidefric < 0 && (vel_perpend*vel_perpend))
300 float f =
max(0, 1 + dt * wishspeed * sidefric);
301 float themin = (vel_xy_backward * vel_xy_backward - vel_straight * vel_straight) / (vel_perpend * vel_perpend);
311 themin =
sqrt(themin);
312 vel_perpend *=
max(themin, f);
316 vel_perpend *=
max(0, 1 - dt * wishspeed * sidefric);
318 vel_xy = vel_straight * wishdir + vel_perpend;
322 float vel_xy_preclamp;
323 vel_xy_preclamp =
vlen(vel_xy);
324 if (vel_xy_preclamp > 0)
326 vel_xy_current += (vel_xy_forward - vel_xy_current) * speedclamp;
327 if (vel_xy_current < vel_xy_preclamp)
328 vel_xy *= (vel_xy_current / vel_xy_preclamp);
332 this.
velocity = vel_xy + vel_z *
'0 0 1';
342 float curspeed =
vlen(curvel);
344 if (wishspeed > curspeed * 1.01)
351 vector wishvel = wishdir * wishspeed;
352 vector acceldir = wishvel - curvel;
353 float addspeed =
vlen(acceldir);
361 float dot = acceldir * curdir;
366 this.
velocity += accelspeed * acceldir;
391 bool doublejump =
false;
398 mjumpheight =
M_ARGV(1,
float);
399 doublejump =
M_ARGV(2,
bool);
435 if (this.velocity_z < minjumpspeed)
436 mjumpheight += minjumpspeed - this.velocity_z;
448 if (this.velocity_z > maxjumpspeed)
449 mjumpheight -= this.velocity_z - maxjumpspeed;
463 this.velocity_x *= f;
464 this.velocity_y *= f;
473 this.velocity_z += mjumpheight;
501 traceline (start, end,
true,
this);
504 start_z = start_z + this.maxs_z - 8;
507 traceline(start, end,
true,
this);
510 this.velocity_z = 225;
520 #define JETPACK_JUMP(s) CS_CVAR(s).cvar_cl_jetpack_jump
522 float autocvar_cl_jetpack_jump;
523 #define JETPACK_JUMP(s) autocvar_cl_jetpack_jump
538 bool air_jump = !playerjump ||
M_ARGV(2,
bool);
542 if (!(
ITEMS_STAT(
this) & ITEM_Jetpack.m_itemid)) { }
579 LOG_INFO(
"A hollow voice says \"Plugh\".");
591 case 0: c =
"x";
break;
592 case BIT(0): c =
"1";
break;
593 case BIT(2): c =
" ";
break;
594 case BIT(7): c =
"s";
break;
595 case BIT(8): c =
"w";
break;
596 case BIT(9): c =
"a";
break;
597 case BIT(10): c =
"d";
break;
603 CS(
this).specialcommand_pos += 1;
606 CS(
this).specialcommand_pos = 0;
612 CS(
this).specialcommand_pos = 0;
653 PHYS_CS(
this).movement =
'0 0 0';
666 if(this.(weaponentity).
hook)
688 if ((
time > this.nextstep) || (
time < (this.nextstep - 10.0)))
718 PHYS_CS(
this).movement =
'0 0 0';
722 PHYS_CS(
this).movement =
'0 0 0';
741 wishvel_z =
sqrt(
max(0, 1 - wishvel * wishvel));
767 float a_diff = a_side * a_side - a_up * a_up;
771 f = a_add * a_up / a_diff;
774 best = (a_diff + a_add * a_add) * (a_diff + a_up * a_up) / a_diff;
779 f = (a_up + a_add) * (a_up + a_add);
786 f = (a_up - a_add) * (a_up - a_add);
805 fvel =
vlen(wishvel);
818 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)
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_airaccelerate
#define PHYS_INPUT_BUTTON_CHAT(s)
float autocvar_sv_accelerate
#define PHYS_JUMPVELOCITY(s)
#define PHYS_WARSOWBUNNY_BACKTOSIDERATIO(s)
#define PHYS_JUMPSPEEDCAP_MIN
float autocvar_sv_maxspeed
float autocvar_sv_warsowbunny_accel
#define PHYS_INPUT_BUTTON_JETPACK(s)
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)
#define PHYS_JUMPSPEEDCAP_MAX
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_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)
const float MOVE_NOMONSTERS
float Q3SURFACEFLAG_SLICK
float CVAR_TYPEFLAG_EXISTS
float Q3SURFACEFLAG_METALSTEPS
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOSTEPS
vector trace_plane_normal
float disableclientprediction
#define PlayerSound(this, def, chan, vol, voicetype)
#define GlobalSound(this, def, chan, vol, voicetype)
const int VOICETYPE_PLAYERSOUND
#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 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