nex secondary now charges the "speed circle" :)
authorFruitieX <rasse@rasse-laptop.(none)>
Wed, 13 Oct 2010 10:05:37 +0000 (13:05 +0300)
committerFruitieX <rasse@rasse-laptop.(none)>
Wed, 13 Oct 2010 10:05:37 +0000 (13:05 +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/cl_physics.qc
qcsrc/server/w_nex.qc

index 56e3f878b29744fdac1f218d0dcddb02b8182ac1..b4b9494f09d92478bbcafdf1baef335a5f042732 100644 (file)
@@ -437,7 +437,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 set g_balance_nex_velocitydependent_halflife 0
 set g_balance_nex_velocitydependent_minspeed 400
 set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 88e0f8708790f3df2ea1325fa6d3c1f8fef8f962..ef0994dfc43ac3cf0afccda3a1016b7d35b7e59a 100644 (file)
@@ -448,7 +448,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 9999999
 set g_balance_nex_velocitydependent_halflife 0
 set g_balance_nex_velocitydependent_minspeed 400
 set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 9cfc751dc7e89d911b74811731e4a7ce2dbed4b8..9b3a2e720f925c21f32195e18bc0f2ded6706c90 100644 (file)
@@ -436,7 +436,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 set g_balance_nex_velocitydependent_halflife 0
 set g_balance_nex_velocitydependent_minspeed 400
 set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index d43d82c28d40da6c5a8d4fdfdf1c18940e536490..0561151bbf65fee85b62123d566c6bfa7fa7b2d1 100644 (file)
@@ -437,7 +437,7 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 1500
 set g_balance_nex_velocitydependent_halflife 0
 set g_balance_nex_velocitydependent_minspeed 400
 set g_balance_nex_velocitydependent_maxspeed 1000
-set g_balance_nex_velocitydependent_falloff_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 0.001
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
index 0dfe80d5502b4ff9c29b04280185aab95beb74f1..02a748d434292a24656020be643fd5756d0802bf 100644 (file)
@@ -424,6 +424,9 @@ set g_balance_nex_primary_damagefalloff_halflife 2000
 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_damage 125
 set g_balance_nex_secondary_force -700
 set g_balance_nex_secondary_refire 1
@@ -437,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_factor 0.001
+set g_balance_nex_velocitydependent_falloff_rate 20
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
index 6798261eb3555f9dc1ae707973911428483f32c2..a34e558c75e2fe124680edfec1f872da28e33d77 100644 (file)
@@ -263,7 +263,9 @@ float nex_scope;
 
 float nex_minvelocity;
 float nex_maxvelocity;
-float nex_speed_falloff_factor;
+float nex_speed_falloff_rate;
 float nex_speed;
+float nex_charge;
+float nex_charge_rate;
 
 float cr_maxbullets;
index 28db128b06d52f379c76bf71d989fb58680926a0..c9b344dac3f8ea85d58fc19de7edf2db281fae0d 100644 (file)
@@ -1354,7 +1354,9 @@ float CSQC_Parse_TempEntity()
                case TE_CSQC_NEX_VELOCITY:
                        nex_minvelocity = ReadShort();
                        nex_maxvelocity = ReadShort();
-                       nex_speed_falloff_factor = ReadShort()/10000;
+                       nex_speed_falloff_rate = ReadByte();
+                       nex_charge = ReadByte();
+                       nex_charge_rate = ReadByte();
                        bHandled = true;
                        break;
                case TE_CSQC_CR_MAXBULLETS:
index 5ee028d46b629b8608eb0778a5c3143d370136a9..c6d86520d4a86912e2bddac4a6653a8c5e353c6f 100644 (file)
@@ -836,7 +836,10 @@ void CSQC_UpdateView(float w, float h)
                                if(xyspeed > nex_speed)
                                        nex_speed = min(xyspeed, nex_maxvelocity);
                                else
-                                       nex_speed = (1 - nex_speed_falloff_factor) * nex_speed;
+                                       nex_speed = max(nex_minvelocity, nex_speed - nex_speed_falloff_rate * frametime);
+
+                               if (activeweapon == WEP_NEX && button_attack2 && nex_charge)
+                                       nex_speed = min(nex_maxvelocity, nex_speed + nex_charge_rate * frametime);
 
                                // ring around crosshair representing bullets left in camping rifle clip
                                if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
index 5c980920b7228a5dcc37681bca3e7b3fa855afd1..b87dc27e5db9a3bc617ddbab0e44425bf39f639f 100644 (file)
@@ -12,7 +12,9 @@ void send_CSQC_nexvelocity(entity e) {
        WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
        WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
        WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
-       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_factor") * 10000);
+       WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
+       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge"));
+       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge_rate"));
 }
 
 void send_CSQC_cr_maxbullets(entity e) {
index c9531bbc630d45f2cca4bfc2aeb97e5b248e2072..d9394deaf26a968573d2331a5c78d87d227a5ccd 100644 (file)
@@ -1328,12 +1328,12 @@ void SV_PlayerPhysics()
 
        float f;
        float xyspeed;
-       f = cvar("g_balance_nex_velocitydependent_falloff_factor");
+       f = cvar("g_balance_nex_velocitydependent_falloff_rate");
        xyspeed = vlen('1 0 0' * self.velocity_x + '0 1 0' * self.velocity_y);
        if(xyspeed > self.nexspeed)
                self.nexspeed = min(xyspeed, cvar("g_balance_nex_velocitydependent_maxspeed"));
        else
-               self.nexspeed = (1 - f) * self.nexspeed;
+               self.nexspeed = max(cvar("g_balance_nex_velocitydependent_minspeed"), self.nexspeed - f * frametime);
 :end
        if(self.flags & FL_ONGROUND)
                self.lastground = time;
index 87d0c88ab53fae69c7e3a9151c9ed31c2eccbccf..1da490842df6dd99e0edc43cd9e97b5613218b5b 100644 (file)
@@ -79,6 +79,7 @@ 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")))
@@ -89,7 +90,12 @@ float w_nex(float req)
                }
                if (self.BUTTON_ATCK2)
                {
-                       if(cvar("g_balance_nex_secondary"))
+                       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);
+                       }
+                       else if(cvar("g_balance_nex_secondary"))
                        {
                                if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
                                {