X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_physics.qc;h=e595c69abec6f924c39d6dedb37d66256c342f0a;hb=021daa8f4356262c2bb2e8563f192dce53691c7f;hp=2c28409161ef0dfca59dab7309326cc4c0bfd996;hpb=d55b0d4835ab889437fcba8adcde9eb5423770a3;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index 2c284091..e595c69a 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -55,6 +55,13 @@ void PlayerJump (void) } mjumpheight = cvar("sv_jumpvelocity"); + if(cvar("g_healthsize")) // if we are smaller or larger, we jump lower or higher + mjumpheight *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; + if(self.swallow_progress_prey) // cut jumping based on swallow progress for prey + mjumpheight *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey")); + if(self.swallow_progress_pred) // cut jumping based on swallow progress for preds + mjumpheight *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred")); + if (self.waterlevel >= WATERLEVEL_SWIMMING) { if (self.watertype == CONTENT_WATER) @@ -500,6 +507,20 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce if(speedclamp) accelqw = -accelqw; + if(self.classname == "player") + { + if(cvar("g_balance_vore_load_pred_weight") > 0) // apply stomach weight + wishspeed /= 1 + (self.stomach_load / self.stomach_maxload) * cvar("g_balance_vore_load_pred_speed"); + if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster + wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale; + if(self.swallow_progress_prey) // cut speed based on swallow progress for prey + wishspeed *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey")); + if(self.swallow_progress_pred) // cut speed based on swallow progress for preds + wishspeed *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred")); + if(self.grabber_stunned > time && random() <= cvar("g_balance_grabber_secondary_stun_rate")) // randomly cut speed while the player is stunned + return; + } + if(cvar("sv_gameplayfix_q2airaccelerate")) wishspeed0 = wishspeed; @@ -769,7 +790,7 @@ void SV_PlayerPhysics() } } - if(self.predator.classname == "player" || self.fakepredator.classname == "player") + if(self.stat_eaten) return; if (self.movetype == MOVETYPE_NONE) @@ -817,8 +838,6 @@ void SV_PlayerPhysics() } maxspd_mod *= swampspd_mod; // only one common speed modder please! - if(cvar("g_balance_vore_weight_gravity") > 0) - maxspd_mod *= 1 - bound(0, self.stomach_load * cvar("g_balance_vore_weight_speed"), 1); // apply stomach weight swampspd_mod = 1; // if dead, behave differently @@ -837,6 +856,7 @@ void SV_PlayerPhysics() { self.wasFlying = 0; + if(self.classname == "player") if(self.waterlevel < WATERLEVEL_SWIMMING) if(time >= self.ladder_time) if not(self.grabber) @@ -847,9 +867,15 @@ void SV_PlayerPhysics() if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS) { if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) + { GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', 1); + } else + { GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', 1); + } } } } @@ -891,7 +917,7 @@ void SV_PlayerPhysics() { RaceCarPhysics(); } - else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY) + else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY) { // noclipping or flying self.flags &~= FL_ONGROUND; @@ -975,7 +1001,7 @@ void SV_PlayerPhysics() PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0); } } - else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && self.predator.classname != "player") + else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.stat_eaten) { //makevectors(self.v_angle_y * '0 1 0'); makevectors(self.v_angle); @@ -1077,7 +1103,7 @@ void SV_PlayerPhysics() else if (self.flags & FL_ONGROUND) { // we get here if we ran out of ammo - if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player") + if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten) sprint(self, "You don't have any fuel for the ^2Jetpack\n"); // walking @@ -1130,7 +1156,7 @@ void SV_PlayerPhysics() if (wishspeed > sv_maxspeed*maxspd_mod) wishspeed = sv_maxspeed*maxspd_mod; if (self.crouch) - wishspeed = wishspeed * 0.5; + wishspeed = wishspeed * cvar("sv_crouchvelocity"); if (time >= self.teleport_time) PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0); } @@ -1138,7 +1164,7 @@ void SV_PlayerPhysics() { float wishspeed0; // we get here if we ran out of ammo - if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && self.predator.classname != "player") + if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten) sprint(self, "You don't have any fuel for the ^2Jetpack\n"); if(maxspd_mod < 1) @@ -1162,7 +1188,7 @@ void SV_PlayerPhysics() if (wishspeed > maxairspd) wishspeed = maxairspd; if (self.crouch) - wishspeed = wishspeed * 0.5; + wishspeed = wishspeed * cvar("sv_crouchvelocity"); if (time >= self.teleport_time) { float accelerating;