compromise: much faster nex charge, charge from a charge pool instead of using cells...
authorFruitieX <fruitiex@gmail.com>
Tue, 16 Nov 2010 17:45:52 +0000 (19:45 +0200)
committerFruitieX <fruitiex@gmail.com>
Tue, 16 Nov 2010 17:45:52 +0000 (19:45 +0200)
13 files changed:
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceTest.cfg
balanceXonotic.cfg
balancetZork.cfg
qcsrc/client/View.qc
qcsrc/common/constants.qh
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/w_nex.qc

index 001572f..9ca2492 100644 (file)
@@ -461,6 +461,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
index 6284782..97fd210 100644 (file)
@@ -472,6 +472,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 9999999
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 80
 set g_balance_nex_secondary_force -500
 set g_balance_nex_secondary_refire 1.25
index e4c4a69..5108942 100644 (file)
@@ -460,6 +460,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 1500
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 90
 set g_balance_nex_secondary_force 200
 set g_balance_nex_secondary_refire 1.5
index b82fa66..76b46fd 100644 (file)
@@ -461,6 +461,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 1500
 set g_balance_nex_secondary 0
 set g_balance_nex_secondary_charge 0
 set g_balance_nex_secondary_charge_rate 0.1
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
index e9b797e..91cfe1f 100644 (file)
@@ -461,11 +461,15 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
 set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
 set g_balance_nex_secondary_animtime 0.3
-set g_balance_nex_secondary_ammo 5
+set g_balance_nex_secondary_ammo 0
 set g_balance_nex_secondary_damagefalloff_mindist 0
 set g_balance_nex_secondary_damagefalloff_maxdist 0
 set g_balance_nex_secondary_damagefalloff_halflife 0
index 0f3ea8a..1c265c6 100644 (file)
@@ -451,36 +451,40 @@ set g_balance_crylink_secondary_line_fadetime 2
 set g_balance_nex_primary_damage 100
 set g_balance_nex_primary_force 500
 set g_balance_nex_primary_refire 1
-set g_balance_nex_primary_animtime 0.75
+set g_balance_nex_primary_animtime 0.4
 set g_balance_nex_primary_ammo 5
-set g_balance_nex_primary_damagefalloff_mindist 1000
-set g_balance_nex_primary_damagefalloff_maxdist 3000
-set g_balance_nex_primary_damagefalloff_halflife 1000
-set g_balance_nex_primary_damagefalloff_forcehalflife 2000
+set g_balance_nex_primary_damagefalloff_mindist 0
+set g_balance_nex_primary_damagefalloff_maxdist 0
+set g_balance_nex_primary_damagefalloff_halflife 0
+set g_balance_nex_primary_damagefalloff_forcehalflife 0
 
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 0.125
+set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 1
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
 set g_balance_nex_secondary_animtime 0
-set g_balance_nex_secondary_ammo 2
+set g_balance_nex_secondary_ammo 0.25
 set g_balance_nex_secondary_damagefalloff_mindist 0
 set g_balance_nex_secondary_damagefalloff_maxdist 0
 set g_balance_nex_secondary_damagefalloff_halflife 0
 set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 
 set g_balance_nex_charge 1
-set g_balance_nex_charge_mindmg 40
+set g_balance_nex_charge_mindmg 30
 set g_balance_nex_charge_start 0.5
-set g_balance_nex_charge_rate 0.05
+set g_balance_nex_charge_rate 0.6
 set g_balance_nex_charge_limit 0.5
-set g_balance_nex_charge_rot_rate 0.01
-set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
-set g_balance_nex_charge_shot_multiplier 0.675
-set g_balance_nex_charge_velocity_rate 0.2
-set g_balance_nex_charge_minspeed 400
+set g_balance_nex_charge_rot_rate 0.1
+set g_balance_nex_charge_rot_pause 1 // Dont rot down until this long after release of charge button
+set g_balance_nex_charge_shot_multiplier 0
+set g_balance_nex_charge_velocity_rate 0
+set g_balance_nex_charge_minspeed 600
 set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
index e1183bc..c4a766a 100644 (file)
@@ -482,6 +482,10 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 0
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
 set g_balance_nex_secondary_charge_rate 0.55
+set g_balance_nex_secondary_charge_pool 0
+set g_balance_nex_secondary_charge_pool_regen 0.15
+set g_balance_nex_secondary_charge_pool_pause_regen 1
+set g_balance_nex_secondary_charge_pool_pause_health_regen 1
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
index 119941a..ffe03d8 100644 (file)
@@ -350,6 +350,7 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
+float use_nex_charge_pool;
 
 void CSQC_UpdateView(float w, float h)
 {
@@ -853,8 +854,9 @@ void CSQC_UpdateView(float w, float h)
 
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
-                       float nex_charge;
+                       float nex_charge, nex_charge_pool;
                        nex_charge = getstatf(STAT_NEX_CHARGE);
+                       nex_charge_pool = getstatf(STAT_NEX_CHARGEPOOL);
 
                        if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
                                nex_charge_movingavg = nex_charge;
@@ -871,12 +873,23 @@ void CSQC_UpdateView(float w, float h)
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
                                vector rgb;
-                               // indicate how much we're charging right now with an inner circle
-                               a = cvar("crosshair_nexvelocity_currentcharge_alpha");
-                               nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
+                               if(nex_charge_pool || use_nex_charge_pool)
+                               {
+                                       use_nex_charge_pool = 1;
+
+                                       a = cvar("crosshair_nexvelocity_alpha");
+                                       rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_charge_pool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                               }
+                               else
+                               {
+                                       // indicate how much we're charging right now with an inner circle
+                                       a = cvar("crosshair_nexvelocity_currentcharge_alpha");
+                                       nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
 
-                               rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
-                               DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                                       rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                               }
 
                                // draw the charge
                                a = cvar("crosshair_nexvelocity_alpha");
index 4acf797..b1ccf1e 100644 (file)
@@ -310,8 +310,9 @@ const float STAT_SHOTORG = 46; // compressShotOrigin
 const float STAT_LEADLIMIT = 47;
 const float STAT_BULLETS_LOADED = 48;
 const float STAT_NEX_CHARGE = 49;
-const float    STAT_LAST_PICKUP = 50;
+const float STAT_LAST_PICKUP = 50;
 const float STAT_HUD = 51;
+const float STAT_NEX_CHARGEPOOL = 52;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
index e3507d6..8ef5faa 100644 (file)
@@ -890,7 +890,11 @@ void PutClientInServer (void)
                self.air_finished = time + 12;
                self.dmg = 2;
                if(cvar("g_balance_nex_charge"))
+               {
+                       if(cvar("g_balance_nex_secondary_charge_pool"))
+                               self.nex_charge_pool_ammo = 1;
                        self.nex_charge = cvar("g_balance_nex_charge_start");
+               }
 
                if(inWarmupStage)
                {
index d369298..bec782f 100644 (file)
@@ -655,6 +655,7 @@ string deathmessage;
 
 .float nex_charge;
 .float nex_charge_rottime;
+.float nex_charge_pool_ammo;
 
 float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
 
index f381612..9e9907e 100644 (file)
@@ -808,6 +808,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
+       addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_charge_pool_ammo);
 
        if(g_ca)
        {
index d152a6e..2d0cc7a 100644 (file)
@@ -75,6 +75,7 @@ void W_Nex_Attack (float issecondary)
 
 void spawnfunc_weapon_nex (void); // defined in t_items.qc
 
+.float nex_charge_pool_pauseregen_finished;
 float w_nex(float req)
 {
        float dt;
@@ -88,6 +89,14 @@ float w_nex(float req)
                if(cvar("g_balance_nex_charge") && self.nex_charge < cvar("g_balance_nex_charge_limit"))
                        self.nex_charge = min(1, self.nex_charge + cvar("g_balance_nex_charge_rate") * frametime / W_TICSPERFRAME);
 
+               if(cvar("g_balance_nex_secondary_charge_pool"))
+               if(self.nex_charge_pool_ammo < 1)
+               {
+                       if(self.nex_charge_pool_pauseregen_finished < time)
+                               self.nex_charge_pool_ammo = min(1, self.nex_charge_pool_ammo + cvar("g_balance_nex_secondary_charge_pool_regen") * frametime / W_TICSPERFRAME);
+                       self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_nex_secondary_charge_pool_pause_health_regen"));
+               }
+
                if (self.BUTTON_ATCK)
                {
                        if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
@@ -102,12 +111,29 @@ float w_nex(float req)
                        {
                                self.nex_charge_rottime = time + cvar("g_balance_nex_charge_rot_pause");
                                dt = frametime / W_TICSPERFRAME;
-                               if(self.nex_charge < 1)
+
+                               if(cvar("g_balance_nex_secondary_charge_pool"))
+                               {
+                                       if(cvar("g_balance_nex_secondary_ammo"))
+                                       {
+                                               // always deplete if secondary is held
+                                               self.nex_charge_pool_ammo = max(0, self.nex_charge_pool_ammo - cvar("g_balance_nex_secondary_ammo") * dt);
+
+                                               dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+                                               self.nex_charge_pool_pauseregen_finished = time + cvar("g_balance_nex_secondary_charge_pool_pause_regen");
+                                               dt = min(dt, self.nex_charge_pool_ammo);
+                                               dt = max(0, dt);
+
+                                               self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
+                                       }
+                               }
+
+                               else if(cvar("g_balance_nex_secondary_ammo"))
                                {
-                                       dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
-                                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+                                       if(self.nex_charge < 1)
                                        {
-                                               if(cvar("g_balance_nex_secondary_ammo"))
+                                               dt = min(dt, (1 - self.nex_charge) / cvar("g_balance_nex_secondary_charge_rate"));
+                                               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                                                {
                                                        dt = min(dt, (self.ammo_cells - cvar("g_balance_nex_primary_ammo")) / cvar("g_balance_nex_secondary_ammo"));
                                                        dt = max(0, dt);
@@ -116,8 +142,8 @@ float w_nex(float req)
                                                                self.ammo_cells = max(cvar("g_balance_nex_secondary_ammo"), self.ammo_cells - cvar("g_balance_nex_secondary_ammo") * dt);
                                                        }
                                                }
+                                               self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
                                        }
-                                       self.nex_charge += dt * cvar("g_balance_nex_secondary_charge_rate");
                                }
                        }
                        else if(cvar("g_balance_nex_secondary"))
@@ -147,7 +173,9 @@ float w_nex(float req)
                return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
        else if (req == WR_CHECKAMMO2)
        {
-               if(cvar("g_balance_nex_secondary_charge"))
+               if(cvar("g_balance_nex_secondary_charge_pool"))
+                       return TRUE;
+               if(cvar("g_balance_nex_secondary_charge") && cvar("g_balance_nex_secondary_ammo")) // if charge consumes ammo, don't allow consuming so much that we cant fire a primary anymore
                        return self.ammo_cells >= cvar("g_balance_nex_primary_ammo");
                return self.ammo_cells >= cvar("g_balance_nex_secondary_ammo");
        }