]> icculus.org git repositories - divverent/nexuiz.git/commit
jonaskoelker's handicap patch: client side cvar cl_handicap multiplies damage
authordiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Tue, 19 Jun 2007 18:55:13 +0000 (18:55 +0000)
committerdiv0 <div0@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Tue, 19 Jun 2007 18:55:13 +0000 (18:55 +0000)
commita5a12eb49574f85513cb4511a77a2befb9c744ca
tree25ca2cb0b0ecd2655558f68c6a01fb3a31ead12e
parentd5bf0ac47b72082dbcedfedf1cae9c2761839a2e
jonaskoelker's handicap patch: client side cvar cl_handicap multiplies damage
you receive, it's in the range from 1 to 100. Please check for abuse potential,
but there shouldn't be any. Please test vampire, empathy and mirror damage!
Even though this is done in PlayerDamage() _after_ all the other stuff kicks
in, test anyway.
Index: server/defs.qh
===================================================================
--- server/defs.qh (revision 2761)
+++ server/defs.qh (working copy)
@@ -259,6 +259,7 @@
 .float has_zoomed;

 .float() customizeentityforclient;
+.float cvar_cl_handicap;
 .float cvar_cl_zoomfactor;
 .float cvar_cl_zoomspeed;
 .float cvar_cl_playerdetailreduction;
Index: server/miscfunctions.qc
===================================================================
--- server/miscfunctions.qc (revision 2761)
+++ server/miscfunctions.qc (working copy)
@@ -493,6 +493,7 @@
  GetCvars_handleFloat(f, cvar_scr_centertime, "scr_centertime");
  GetCvars_handleFloat(f, cvar_cl_shownames, "cl_shownames");
  GetCvars_handleString(f, cvar_g_nexuizversion, "g_nexuizversion");
+ GetCvars_handleFloat(f, cvar_cl_handicap, "cl_handicap");
 }

 float fexists(string f)
Index: server/cl_player.qc
===================================================================
--- server/cl_player.qc (revision 2761)
+++ server/cl_player.qc (working copy)
@@ -218,6 +218,8 @@
 {
  local float take, save, waves, sdelay;

+ damage = damage * bound(1.0, self.cvar_cl_handicap, 100.0);
+
  te_blood (hitloc, force, damage);
  if (self.pain_finished < time) //Don't switch pain sequences like crazy
  {

git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2762 f962a42d-fe04-0410-a3ab-8c8b0445ebaa
data/qcsrc/server/cl_player.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/miscfunctions.qc