X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=data%2Fqcsrc%2Fserver%2Fcl_physics.qc;h=9e000474b19d2c722196a1782ec299f26cb34b32;hb=6b10c719f579c06812b794c182e46ecf24b2e7a2;hp=6b41a2cfdc87f2e7522b9d30d47cda20642da244;hpb=a03563158ff2b6b903230fc29461fe98699402ab;p=voretournament%2Fvoretournament.git diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index 6b41a2cf..9e000474 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -55,10 +55,12 @@ void PlayerJump (void) } mjumpheight = cvar("sv_jumpvelocity"); - if(self.scale) // we are smaller or larger, so we jump lower or higher + 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 - mjumpheight *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd")); + 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) { @@ -505,10 +507,19 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce if(speedclamp) accelqw = -accelqw; - if(self.scale) // we are smaller or larger, so 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 - wishspeed *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd")); + 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; @@ -727,7 +738,7 @@ void SV_PlayerPhysics() if (self.punchangle != '0 0 0') { - f = vlen(self.punchangle) - 15 * frametime; + f = vlen(self.punchangle) - cvar("sv_punchangle_speed") * frametime; if (f > 0) self.punchangle = normalize(self.punchangle) * f; else @@ -736,7 +747,7 @@ void SV_PlayerPhysics() if (self.punchvector != '0 0 0') { - f = vlen(self.punchvector) - 30 * frametime; + f = vlen(self.punchvector) - cvar("sv_punchvector_speed") * frametime; if (f > 0) self.punchvector = normalize(self.punchvector) * f; else @@ -827,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 @@ -847,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) @@ -856,10 +866,60 @@ void SV_PlayerPhysics() tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self); if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS) { - if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) - GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + if(cvar("g_healthsize")) + { + if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) + { + GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1)); + pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', floor(self.scale * PARTICLE_MULTIPLIER)); + } + else + { + GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1)); + pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', floor(self.scale * PARTICLE_MULTIPLIER)); + } + sound(self, CHAN_AUTO, "misc/macro_hitground.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM); + + // earthquake effect for nearby players when a macro falls + if(cvar("g_healthsize_quake_fall")) + { + entity head; + for(head = findradius(self.origin, cvar("g_healthsize_quake_fall_radius")); head; head = head.chain) + { + if not(head.classname == "player" || head.classname == "spectator") + continue; + if(head == self || head.spectatee_status == num_for_edict(self)) + continue; // not for self + if not(head.flags & FL_ONGROUND) + continue; // we only feel the ground shaking if we are sitting on it + if(head.stat_eaten) + continue; // not for prey + + float shake; + shake = vlen(head.origin - self.origin); + if(shake) + shake = 1 - bound(0, shake / cvar("g_healthsize_quake_fall_radius"), 1); + shake *= playersize_macro(self) * cvar("g_healthsize_quake_fall"); + + head.punchvector_x += crandom() * shake; + head.punchvector_y += crandom() * shake; + head.punchvector_z += crandom() * shake; + } + } + } else - GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND); + { + if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS) + { + GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); + pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', 1); + } + else + { + GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE); + pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', 1); + } + } } } } @@ -901,7 +961,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; @@ -1140,7 +1200,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); } @@ -1172,7 +1232,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;