X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fphysics%2Fplayer.qh;h=9e7b799d027257e72d1201f6f013fcbffe57eb99;hb=9185b58da6fe5f2b095d7066577e1e024b4d2798;hp=ea318c5b013f540801aa5fa2d196c5e5a8e9ea0a;hpb=1b178ce6d0a16f1df280bc596237e877061d7455;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index ea318c5b0..9e7b799d0 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -1,8 +1,9 @@ -#ifndef COMMON_PHYSICS_H -#define COMMON_PHYSICS_H +#pragma once // Client/server mappings +.float pm_frametime; + .entity conveyor; .float race_penalty; @@ -23,7 +24,7 @@ .vector v_angle_old; .string lastclassname; -.float() PlayerPhysplug; +.float(entity,float) PlayerPhysplug; float AdjustAirAccelQW(float accelqw, float factor); bool IsFlying(entity a); @@ -35,6 +36,7 @@ bool IsFlying(entity a); #define GAMEPLAYFIX_STEPDOWN(s) STAT(GAMEPLAYFIX_STEPDOWN, s) #define GAMEPLAYFIX_STEPMULTIPLETIMES(s) STAT(GAMEPLAYFIX_STEPMULTIPLETIMES, s) #define GAMEPLAYFIX_UNSTICKPLAYERS(s) STAT(GAMEPLAYFIX_UNSTICKPLAYERS, s) +#define GAMEPLAYFIX_WATERTRANSITION(s) STAT(GAMEPLAYFIX_WATERTRANSITION, s) #define PHYS_ACCELERATE(s) STAT(MOVEVARS_ACCELERATE, s) #define PHYS_AIRACCELERATE(s) STAT(MOVEVARS_AIRACCELERATE, s) @@ -67,6 +69,7 @@ bool IsFlying(entity a); #define PHYS_JETPACK_FUEL(s) STAT(JETPACK_FUEL, s) #define PHYS_JETPACK_MAXSPEED_SIDE(s) STAT(JETPACK_MAXSPEED_SIDE, s) #define PHYS_JETPACK_MAXSPEED_UP(s) STAT(JETPACK_MAXSPEED_UP, s) +#define PHYS_JETPACK_REVERSE_THRUST(s) STAT(JETPACK_REVERSE_THRUST, s) #define PHYS_JUMPSPEEDCAP_DISABLE_ONRAMPS(s) STAT(MOVEVARS_JUMPSPEEDCAP_DISABLE_ONRAMPS, s) #define PHYS_JUMPSTEP(s) STAT(MOVEVARS_JUMPSTEP, s) @@ -99,6 +102,15 @@ bool IsFlying(entity a); #define PHYS_INPUT_BUTTON_ZOOM(s) PHYS_INPUT_BUTTON_BUTTON4(s) #define PHYS_INPUT_BUTTON_CROUCH(s) PHYS_INPUT_BUTTON_BUTTON5(s) #define PHYS_INPUT_BUTTON_HOOK(s) PHYS_INPUT_BUTTON_BUTTON6(s) + +#ifdef CSQC +STATIC_INIT(PHYS_INPUT_BUTTON_HOOK) +{ + localcmd("alias +hook +button6\n"); + localcmd("alias -hook -button6\n"); +} +#endif + #define PHYS_INPUT_BUTTON_INFO(s) PHYS_INPUT_BUTTON_BUTTON7(s) #define PHYS_INPUT_BUTTON_DRAG(s) PHYS_INPUT_BUTTON_BUTTON8(s) #define PHYS_INPUT_BUTTON_USE(s) PHYS_INPUT_BUTTON_BUTTON_USE(s) @@ -107,6 +119,14 @@ bool IsFlying(entity a); #define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s) PHYS_INPUT_BUTTON_BUTTON9(s) #define PHYS_INPUT_BUTTON_JETPACK(s) PHYS_INPUT_BUTTON_BUTTON10(s) +#ifdef CSQC +STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK) +{ + localcmd("alias +jetpack +button10\n"); + localcmd("alias -jetpack -button10\n"); +} +#endif + // if more buttons are needed, start using impulse bits as buttons #define PHYS_INPUT_BUTTON_BACKWARD(s) (PHYS_INPUT_MOVEVALUES(s).x < 0) @@ -138,13 +158,19 @@ bool IsFlying(entity a); #define ITEMS_STAT(s) ((s).items) +.float teleport_time; +#define PHYS_TELEPORT_TIME(s) ((s).teleport_time) + +.float waterjump_time; +#define PHYS_WATERJUMP_TIME(s) ((s).waterjump_time) + #ifdef CSQC + #define PHYS_FIXANGLE(s) ('0 0 0') + string autocvar_cl_jumpspeedcap_min; string autocvar_cl_jumpspeedcap_max; - noref float pmove_waterjumptime; - const int FL_WATERJUMP = 2048; // player jumping out of water const int FL_JUMPRELEASED = 4096; // for jump debouncing @@ -155,6 +181,8 @@ bool IsFlying(entity a); .vector movement; .vector v_angle; + .entity hook; + // TODO #define IS_CLIENT(s) ((s).isplayermodel) #define IS_PLAYER(s) ((s).isplayermodel) @@ -166,8 +194,6 @@ bool IsFlying(entity a); #define PHYS_GRAVITY(s) STAT(MOVEVARS_GRAVITY, s) - #define PHYS_TELEPORT_TIME(s) ((s).teleport_time) - #define TICRATE ticrate #define PHYS_INPUT_ANGLES(s) input_angles @@ -216,6 +242,8 @@ bool IsFlying(entity a); #elif defined(SVQC) + #define PHYS_FIXANGLE(s) ((s).fixangle) + bool Physics_Valid(string thecvar); .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW); @@ -225,8 +253,6 @@ bool IsFlying(entity a); .string jumpspeedcap_min; .string jumpspeedcap_max; - #define PHYS_TELEPORT_TIME(s) ((s).teleport_time) - #define PHYS_GRAVITY(s) autocvar_sv_gravity #define TICRATE sys_frametime @@ -298,5 +324,3 @@ NET_HANDLE(setpause, bool) return true; } #endif - -#endif