]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 001572fe589b5ee33f24286d85038b7df27df4e8..9ca249253593162976f5a0badcba4ecfaacd8783 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 62847823ff8d9849e6ab543b1ce45299992c1197..97fd210cc8f94bad17a41c777bab56fcc0f4a033 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 e4c4a69d182c2c80305399538503410e2eeb7736..5108942388101cc2da3e673419226778649e6c99 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 b82fa6632e83386fd6359c473631ddcc4236f7c4..76b46fd652ceee6060fea45bccd191c284d985c7 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 e9b797ef59b5a44a1a988404bb451ea377a8fff3..91cfe1f3c19f49348e61af9224d0ae1ed3a255a9 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 0f3ea8a35b9c03a193b36af10c2c7a4deda1e7e3..1c265c629290dfee700b9e462b06d6937728b64d 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 e1183bc8e51abf2253599c7d717dae196bff4e67..c4a766a3590491feb8a47b08c245245165dfae03 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 119941ad2c017ace633f6089070b4bca09ffa093..ffe03d85280ffcf1c96caa917fa2fb49e0faab1b 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 4acf797b7dddfc7974315f23c4f5e506d2a7e500..b1ccf1e31b4a18304a38555b238014de857e9204 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 e3507d6413a8e54b4e57a4fd4fba36104916fa47..8ef5faa9d304400b5f901397ce508b95d4c7e753 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 d369298a56cd5b679a7113934831a7878d2476ba..bec782f009327b9af0cbb663eac5ea1861b21b51 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 f381612c3f7843a427fa43724cc16e7919b0edec..9e9907e13a35acd7d6b5798256c4aed9e39659a0 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 d152a6e083949b56586aa4179f46556090841b84..2d0cc7a603728cc54693d7354562b144008a202e 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");
        }