set some sane cvars, let the client know if the balance uses the velocity dependent...
authorFruitieX <rasse@rasse-laptop.(none)>
Wed, 13 Oct 2010 10:25:35 +0000 (13:25 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Wed, 13 Oct 2010 10:25:35 +0000 (13:25 +0300)
balance25.cfg
balanceLeeStricklin.cfg
balanceNexSVN.cfg
balanceSamual.cfg
balanceXonotic.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/server/cl_client.qc
qcsrc/server/w_nex.qc

index b4b9494f09d92478bbcafdf1baef335a5f042732..90751d279d6d0d18744618855fd2aa187adfe49e 100644 (file)
@@ -424,6 +424,9 @@ set g_balance_nex_primary_damagefalloff_halflife 0
 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 200
+set g_balance_nex_secondary_charge_ammo 10
 set g_balance_nex_secondary_damage 100
 set g_balance_nex_secondary_force 600
 set g_balance_nex_secondary_refire 1.5
index ef0994dfc43ac3cf0afccda3a1016b7d35b7e59a..36d5435e1b9cf4d8055bb9a5a15084c3c1574b56 100644 (file)
@@ -435,6 +435,9 @@ set g_balance_nex_primary_damagefalloff_halflife 9999999
 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 200
+set g_balance_nex_secondary_charge_ammo 10
 set g_balance_nex_secondary_damage 80
 set g_balance_nex_secondary_force -500
 set g_balance_nex_secondary_refire 1.25
index 9b3a2e720f925c21f32195e18bc0f2ded6706c90..966d58cbffaf6842582cf9877c9f0f008811f5ef 100644 (file)
@@ -423,6 +423,9 @@ set g_balance_nex_primary_damagefalloff_halflife 1500
 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 200
+set g_balance_nex_secondary_charge_ammo 10
 set g_balance_nex_secondary_damage 90
 set g_balance_nex_secondary_force 200
 set g_balance_nex_secondary_refire 1.5
index 0561151bbf65fee85b62123d566c6bfa7fa7b2d1..966f0b2dd0ee3f165c264f706d9d558cce72a66a 100644 (file)
@@ -424,6 +424,9 @@ set g_balance_nex_primary_damagefalloff_halflife 1500
 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 200
+set g_balance_nex_secondary_charge_ammo 10
 set g_balance_nex_secondary_damage 90
 set g_balance_nex_secondary_force 300
 set g_balance_nex_secondary_refire 1.5
index 02a748d434292a24656020be643fd5756d0802bf..225b0db8d907145a39c5ac6eac231d8abfd0d9e1 100644 (file)
@@ -425,8 +425,8 @@ set g_balance_nex_primary_damagefalloff_forcehalflife 2000
 
 set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
-set g_balance_nex_secondary_charge_rate 20
-set g_balance_nex_secondary_charge_ammo 20
+set g_balance_nex_secondary_charge_rate 200
+set g_balance_nex_secondary_charge_ammo 10
 set g_balance_nex_secondary_damage 125
 set g_balance_nex_secondary_force -700
 set g_balance_nex_secondary_refire 1
@@ -440,7 +440,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 4000
 set g_balance_nex_velocitydependent_halflife -500
 set g_balance_nex_velocitydependent_minspeed 400
 set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_rate 20
+set g_balance_nex_velocitydependent_falloff_rate 40
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
index a34e558c75e2fe124680edfec1f872da28e33d77..59a7074d7243578d95cd32b57918c9c3cd9a84c5 100644 (file)
@@ -261,6 +261,7 @@ vector w_org, w_backoff;
 float campingrifle_scope;
 float nex_scope;
 
+float nex_velocitydependent;
 float nex_minvelocity;
 float nex_maxvelocity;
 float nex_speed_falloff_rate;
index c9b344dac3f8ea85d58fc19de7edf2db281fae0d..79881410d8f9e0123472d6615d9df3652b604ea0 100644 (file)
@@ -1352,6 +1352,7 @@ float CSQC_Parse_TempEntity()
                        bHandled = true;
                        break;
                case TE_CSQC_NEX_VELOCITY:
+                       nex_velocitydependent = ReadByte();
                        nex_minvelocity = ReadShort();
                        nex_maxvelocity = ReadShort();
                        nex_speed_falloff_rate = ReadByte();
index c6d86520d4a86912e2bddac4a6653a8c5e353c6f..b4da5c81589dee6e0e762a7d0fd8282230d4ac73 100644 (file)
@@ -850,7 +850,7 @@ void CSQC_UpdateView(float w, float h)
                                        a = cvar("crosshair_campingrifle_bulletcounter_alpha");
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                                }
-                               else if (activeweapon == WEP_NEX) // ring around crosshair representing velocity-dependent damage for the nex
+                               else if (activeweapon == WEP_NEX && nex_velocitydependent) // ring around crosshair representing velocity-dependent damage for the nex
                                {
                                        f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
 
index b87dc27e5db9a3bc617ddbab0e44425bf39f639f..7dc5520abfe036f2065f1acd66b526c0e9734645 100644 (file)
@@ -10,6 +10,7 @@ void send_CSQC_nexvelocity(entity e) {
        msg_entity = e;
        WriteByte(MSG_ONE, SVC_TEMPENTITY);
        WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
+       WriteByte(MSG_ONE, bound(0, fabs(cvar("g_balance_nex_velocitydependent_halflife")), 1));
        WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
        WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
        WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
index 1da490842df6dd99e0edc43cd9e97b5613218b5b..6b8ffb5328993d6070b9ef20ae9ac37630cba36a 100644 (file)
@@ -79,7 +79,6 @@ float w_nex(float req)
        }
        else if (req == WR_THINK)
        {
-               print(ftos(self.nexspeed), "\n");
                if (self.BUTTON_ATCK)
                {
                        if (weapon_prepareattack(0, cvar("g_balance_nex_primary_refire")))
@@ -92,8 +91,11 @@ float w_nex(float req)
                {
                        if(cvar("g_balance_nex_secondary_charge"))
                        {
-                               self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
-                               self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME);
+                               if(self.ammo_cells)
+                               {
+                                       self.nexspeed = min(cvar("g_balance_nex_velocitydependent_maxspeed"), self.nexspeed + cvar("g_balance_nex_secondary_charge_rate") * frametime / W_TICSPERFRAME);
+                                       self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_nex_secondary_charge_ammo") * frametime / W_TICSPERFRAME);
+                               }
                        }
                        else if(cvar("g_balance_nex_secondary"))
                        {