From: Sahil Singhal Date: Thu, 27 May 2010 22:45:28 +0000 (-0400) Subject: Merge commit 'origin/master' into diabolik/gakplayermodel X-Git-Tag: xonotic-v0.1.0preview~570 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=025ab6614545df21ad7392f7806ad375b9c40af3;hp=5256a6299d9fd96b1828a08093eb01c270b623fe;p=xonotic%2Fxonotic-data.pk3dir.git Merge commit 'origin/master' into diabolik/gakplayermodel --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index a30856168..43d6e0c8a 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -240,7 +240,28 @@ cl_bobcycle 0 // how long the cycle of up/down view movement takes (only works i cl_bob 0.01 // how much view moves up/down when moving (does not move if cl_bobcycle is 0, but still enables cl_bobmodel), default is 0.02 cl_bobmodel 1 // whether to have gun model move around on screen when moving (only works if cl_bob is not 0), default is 1 cl_leanmodel 1 // enables weapon leaning effect when looking around +cl_leanmodel_side_speed 1 "gun leaning sideways speed" +cl_leanmodel_side_limit 35 "gun leaning sideways limit" +cl_leanmodel_side_highpass1 30 "gun leaning sideways pre-highpass in 1/s" +cl_leanmodel_side_highpass 3 "gun leaning sideways highpass in 1/s" +cl_leanmodel_side_lowpass 20 "gun leaning sideways lowpass in 1/s" +cl_leanmodel_up_speed 1 "gun leaning upward speed" +cl_leanmodel_up_limit 50 "gun leaning upward limit" +cl_leanmodel_up_highpass1 5 "gun leaning upward pre-highpass in 1/s" +cl_leanmodel_up_highpass 15 "gun leaning upward highpass in 1/s" +cl_leanmodel_up_lowpass 20 "gun leaning upward lowpass in 1/s" cl_followmodel 1 // enables weapon pushing / pulling effect when walking +cl_followmodel_side_speed 0.5 "gun following sideways speed" +cl_followmodel_side_limit 6 "gun following sideways limit" +cl_followmodel_side_highpass1 30 "gun following sideways pre-highpass in 1/s" +cl_followmodel_side_highpass 5 "gun following sideways highpass in 1/s" +cl_followmodel_side_lowpass 10 "gun following sideways lowpass in 1/s" +cl_followmodel_up_speed 1 "gun following upward speed" +cl_followmodel_up_limit 5 "gun following upward limit" +cl_followmodel_up_highpass1 60 "gun following upward pre-highpass in 1/s" +cl_followmodel_up_highpass 2 "gun following upward highpass in 1/s" +cl_followmodel_up_lowpass 10 "gun following upward lowpass in 1/s" + cl_rollangle 0 // amount of view tilt when strafing, default is 2.0 v_kicktime 0 // how long damage kicks of the view last, default is 0 seconds gl_polyblend 0.5 // whether to use screen tints, default is 1 @@ -330,9 +351,9 @@ set sv_player_crouch_maxs "16 16 25" "maxs of a crouched playermodel" set sv_pogostick 1 "don't require releasing the space bar for jumping again" set sv_doublejump 0 "allow Quake 2-style double jumps" -set sv_jumpspeedcap_min "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this" -set sv_jumpspeedcap_max "" "wont perform a doublejump if z-axis speed is higher than sv_jumpvelocity * this" -set sv_jumpspeedcap_max_disable_on_ramps 0 "disable max jumpspeedcap on ramps to preserve the old rampjump style" +set sv_jumpspeedcap_min "" "lower bound on the baseline velocity of a jump; final velocity will be >= (jumpheight * min + jumpheight)" +set sv_jumpspeedcap_max "" "upper bound on the baseline velocity of a jump; final velocity will be <= (jumpheight * max + jumpheight)" +set sv_jumpspeedcap_max_disable_on_ramps 0 "disable upper baseline velocity bound on ramps to preserve the old rampjump style" seta sv_precacheplayermodels 1 seta sv_precacheweapons 0 diff --git a/physicsNoQWBunny.cfg b/physicsNoQWBunny.cfg index d20a12a3b..6920d764a 100644 --- a/physicsNoQWBunny.cfg +++ b/physicsNoQWBunny.cfg @@ -14,8 +14,8 @@ sv_waterfriction -1 sv_airaccel_sideways_friction -0.2 sv_airaccel_qw -0.9475 sv_airstopaccelerate 2.5 -sv_airstrafeaccelerate 21 -sv_maxairstrafespeed 200 +sv_airstrafeaccelerate 42 +sv_maxairstrafespeed 100 sv_airstrafeaccel_qw -0.99 sv_aircontrol 125 sv_aircontrol_power 2.5 diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index d3425451c..0051d8759 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -41,6 +41,15 @@ When you press the jump key void PlayerJump (void) { float mjumpheight; + float doublejump; + + doublejump = FALSE; + if (sv_doublejump) + { + tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); + if (trace_fraction < 1 && trace_plane_normal_z > 0.7) + doublejump = TRUE; + } mjumpheight = cvar("sv_jumpvelocity"); if (self.waterlevel >= WATERLEVEL_SWIMMING) @@ -55,6 +64,7 @@ void PlayerJump (void) return; } + if (!doublejump) if (!(self.flags & FL_ONGROUND)) return; @@ -85,16 +95,34 @@ void PlayerJump (void) mjumpheight = mjumpheight * cvar("g_minstagib_speed_jumpheight"); } + // sv_jumpspeedcap_min/sv_jumpspeedcap_max act as baseline + // velocity bounds. Final velocity is bound between (jumpheight * + // min + jumpheight) and (jumpheight * max + jumpheight); + if(cvar_string("sv_jumpspeedcap_min") != "") - self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z); - if(cvar_string("sv_jumpspeedcap_max") != "") { + { + float minjumpspeed; + + minjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_min"); + + if (self.velocity_z < minjumpspeed) + mjumpheight += minjumpspeed - self.velocity_z; + } + + if(cvar_string("sv_jumpspeedcap_max") != "") + { + // don't do jump speedcaps on ramps to preserve old xonotic ramjump style tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); - if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) { - // don't do jump speedcaps on ramps to preserve old xonotic ramjump style - //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n"); + + if(!(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps"))) + { + float maxjumpspeed; + + maxjumpspeed = mjumpheight * cvar("sv_jumpspeedcap_max"); + + if (self.velocity_z > maxjumpspeed) + mjumpheight -= self.velocity_z - maxjumpspeed; } - else - self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z) + trace_ent.velocity_z; } if(!(self.lastflags & FL_ONGROUND)) @@ -605,7 +633,6 @@ void race_send_speedaward_alltimebest(float msg) string GetMapname(void); float speedaward_lastupdate; float speedaward_lastsent; -.float jumppadusetime; var float autocvar_g_movement_highspeed = 1; void SV_PlayerPhysics() { @@ -859,14 +886,6 @@ void SV_PlayerPhysics() if(self.classname == "player") { - if(sv_doublejump && time - self.jumppadusetime > 2 * sys_frametime) - { - tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self); - self.flags &~= FL_ONGROUND; - if(trace_fraction < 1 && trace_plane_normal_z > 0.7) - self.flags |= FL_ONGROUND; - } - if (self.BUTTON_JUMP) PlayerJump (); else diff --git a/qcsrc/server/gamecommand.qc b/qcsrc/server/gamecommand.qc index 39b266560..a6881b293 100644 --- a/qcsrc/server/gamecommand.qc +++ b/qcsrc/server/gamecommand.qc @@ -960,15 +960,25 @@ void GameCommand(string command) if(argv(1) == "w") setmodel(e, (nextent(world)).weaponentity.model); else + { + precache_model(argv(1)); setmodel(e, argv(1)); + } e.frame = stof(argv(2)); - i = gettagindex(e, argv(3)); + if(substring(argv(3), 0, 1) == "#") + i = stof(substring(argv(3), 1, -1)); + else + i = gettagindex(e, argv(3)); if(i) { v = gettaginfo(e, i); - print("model ", e.model, " frame ", ftos(e.frame), " tag ", argv(3)); - print(" index = ", ftos(i)); + print("model ", e.model, " frame ", ftos(e.frame), " tag ", gettaginfo_name); + print(" index ", ftos(i), " parent ", ftos(gettaginfo_parent), "\n"); print(" vector = ", ftos(v_x), " ", ftos(v_y), " ", ftos(v_z), "\n"); + print(" offset = ", ftos(gettaginfo_offset_x), " ", ftos(gettaginfo_offset_y), " ", ftos(gettaginfo_offset_z), "\n"); + print(" forward = ", ftos(gettaginfo_forward_x), " ", ftos(gettaginfo_forward_y), " ", ftos(gettaginfo_forward_z), "\n"); + print(" right = ", ftos(gettaginfo_right_x), " ", ftos(gettaginfo_right_y), " ", ftos(gettaginfo_right_z), "\n"); + print(" up = ", ftos(gettaginfo_up_x), " ", ftos(gettaginfo_up_y), " ", ftos(gettaginfo_up_z), "\n"); if(argc >= 6) { v_y = -v_y; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index c54235d2c..fa61ad871 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1227,7 +1227,6 @@ void readlevelcvars(void) sv_maxidle = cvar("sv_maxidle"); sv_maxidle_spectatorsareidle = cvar("sv_maxidle_spectatorsareidle"); sv_pogostick = cvar("sv_pogostick"); - sv_doublejump = cvar("sv_doublejump"); g_ctf_reverse = cvar("g_ctf_reverse"); sv_autotaunt = cvar("sv_autotaunt"); sv_taunt = cvar("sv_taunt"); @@ -1916,6 +1915,13 @@ void adaptor_think2use() activator = a; } +void adaptor_think2use_hittype_splash() // for timed projectile detonation +{ + if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING + self.projectiledeathtype |= HITTYPE_SPLASH; + adaptor_think2use(); +} + // deferred dropping void DropToFloor_Handler() { diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 0212fce8a..f4cc87445 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -200,6 +200,7 @@ void StartFrame (void) sv_warsowbunny_backtosideratio = cvar("sv_warsowbunny_backtosideratio"); teamplay = cvar ("teamplay"); sys_frametime = cvar("sys_ticrate") * cvar("slowmo"); + sv_doublejump = cvar("sv_doublejump"); if (timeoutStatus == 1) // just before the timeout (when timeoutStatus will be 2) orig_slowmo = cvar("slowmo"); // slowmo will be restored after the timeout diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 4faba6d71..9bb8f7c92 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -152,7 +152,6 @@ void trigger_push_touch() other.flags &~= FL_ONGROUND; other.velocity = self.movedir; - other.jumppadusetime = time; if (other.classname == "player") { diff --git a/qcsrc/server/w_common.qc b/qcsrc/server/w_common.qc index 36552e930..8f2de4e8c 100644 --- a/qcsrc/server/w_common.qc +++ b/qcsrc/server/w_common.qc @@ -1,3 +1,4 @@ + void W_GiveWeapon (entity e, float wep, string name) { entity oldself; diff --git a/qcsrc/server/w_electro.qc b/qcsrc/server/w_electro.qc index c1cb49d0e..c9e7d23c3 100644 --- a/qcsrc/server/w_electro.qc +++ b/qcsrc/server/w_electro.qc @@ -51,7 +51,6 @@ void W_Plasma_Explode (void) void W_Plasma_Explode_Combo (void) { - W_Plasma_TriggerCombo(self.origin, cvar("g_balance_electro_combo_comboradius"), self.owner); self.event_damage = SUB_Null; @@ -98,7 +97,7 @@ void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float dea else { self.use = W_Plasma_Explode; - self.think = adaptor_think2use; + self.think = adaptor_think2use; // not _hittype_splash, as this runs "immediately" } } } @@ -117,7 +116,7 @@ void W_Electro_Attack() proj.bot_dodge = TRUE; proj.bot_dodgerating = cvar("g_balance_electro_primary_damage"); proj.use = W_Plasma_Explode; - proj.think = adaptor_think2use; + proj.think = adaptor_think2use_hittype_splash; proj.nextthink = time + cvar("g_balance_electro_primary_lifetime"); PROJECTILE_MAKETRIGGER(proj); proj.projectiledeathtype = WEP_ELECTRO; @@ -151,7 +150,7 @@ void W_Electro_Attack2() proj.classname = "plasma"; proj.owner = self; proj.use = W_Plasma_Explode; - proj.think = adaptor_think2use; + proj.think = adaptor_think2use_hittype_splash; proj.bot_dodge = TRUE; proj.bot_dodgerating = cvar("g_balance_electro_secondary_damage"); proj.nextthink = time + cvar("g_balance_electro_secondary_lifetime"); diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index c1d30ba02..0462cd901 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -98,6 +98,7 @@ void W_Fireball_Think() if(time > self.pushltime) { self.cnt = 1; + self.projectiledeathtype |= HITTYPE_SPLASH; W_Fireball_Explode(); return; } diff --git a/qcsrc/server/w_grenadelauncher.qc b/qcsrc/server/w_grenadelauncher.qc index 380e849fe..251137401 100644 --- a/qcsrc/server/w_grenadelauncher.qc +++ b/qcsrc/server/w_grenadelauncher.qc @@ -99,7 +99,7 @@ void W_Grenade_Attack (void) setsize(gren, '0 0 -3', '0 0 -3'); gren.nextthink = time + cvar("g_balance_grenadelauncher_primary_lifetime"); - gren.think = adaptor_think2use; + gren.think = adaptor_think2use_hittype_splash; gren.use = W_Grenade_Explode; gren.touch = W_Grenade_Touch1; W_SETUPPROJECTILEVELOCITY_UP(gren, g_balance_grenadelauncher_primary); @@ -135,7 +135,7 @@ void W_Grenade_Attack2 (void) setorigin(gren, w_shotorg); gren.nextthink = time + cvar("g_balance_grenadelauncher_secondary_lifetime"); - gren.think = adaptor_think2use; + gren.think = adaptor_think2use_hittype_splash; gren.use = W_Grenade_Explode2; gren.touch = W_Grenade_Touch2; gren.takedamage = DAMAGE_YES; diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 06ff58857..638e18bcc 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -56,7 +56,7 @@ void W_Hagar_Attack (void) missile.bot_dodgerating = cvar("g_balance_hagar_primary_damage"); missile.touch = W_Hagar_Touch; missile.use = W_Hagar_Explode; - missile.think = adaptor_think2use; + missile.think = adaptor_think2use_hittype_splash; missile.nextthink = time + cvar("g_balance_hagar_primary_lifetime"); PROJECTILE_MAKETRIGGER(missile); missile.projectiledeathtype = WEP_HAGAR; @@ -91,7 +91,7 @@ void W_Hagar_Attack2 (void) missile.touch = W_Hagar_Touch2; missile.cnt = 0; missile.use = W_Hagar_Explode2; - missile.think = adaptor_think2use; + missile.think = adaptor_think2use_hittype_splash; missile.nextthink = time + cvar("g_balance_hagar_secondary_lifetime_min") + random() * cvar("g_balance_hagar_secondary_lifetime_rand"); PROJECTILE_MAKETRIGGER(missile); missile.projectiledeathtype = WEP_HAGAR | HITTYPE_SECONDARY; diff --git a/qcsrc/server/w_hook.qc b/qcsrc/server/w_hook.qc index 6b2270af2..7b4eba094 100644 --- a/qcsrc/server/w_hook.qc +++ b/qcsrc/server/w_hook.qc @@ -77,7 +77,7 @@ void W_Hook_Attack2() setsize(gren, '0 0 0', '0 0 0'); gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime"); - gren.think = adaptor_think2use; + gren.think = adaptor_think2use_hittype_splash; gren.use = W_Hook_Explode2; gren.touch = W_Hook_Touch2; diff --git a/qcsrc/server/w_seeker.qc b/qcsrc/server/w_seeker.qc index 691a25251..83d615884 100644 --- a/qcsrc/server/w_seeker.qc +++ b/qcsrc/server/w_seeker.qc @@ -28,7 +28,10 @@ void Seeker_Missile_Think() float dist; if (time > self.cnt) + { + self.projectiledeathtype |= HITTYPE_SPLASH; Seeker_Missile_Explode(); + } if (!self.switchweapon) self.switchweapon = cvar("g_balance_seeker_missile_speed"); @@ -404,7 +407,7 @@ void Seeker_Fire_Flac() missile.bot_dodgerating = cvar("g_balance_seeker_flac_damage"); missile.touch = Seeker_Flac_Explode; missile.use = Seeker_Flac_Explode; - missile.think = Seeker_Flac_Explode; + missile.think = adaptor_think2use_hittype_splash; missile.nextthink = time + cvar("g_balance_seeker_flac_lifetime") + cvar("g_balance_seeker_flac_lifetime_rand"); missile.solid = SOLID_BBOX; missile.scale = 0.4; // BUG: the model is too big