Merge remote branch 'origin/fruitiex/loadblackbg'
authorRudolf Polzer <divverent@alientrap.org>
Wed, 13 Oct 2010 16:49:17 +0000 (18:49 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 13 Oct 2010 16:49:17 +0000 (18:49 +0200)
12 files changed:
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
sound/weapons/campingrifle_fire2.ogg

index 56e3f878b29744fdac1f218d0dcddb02b8182ac1..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
@@ -437,7 +440,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..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
@@ -448,7 +451,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..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
@@ -436,7 +439,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..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
@@ -437,7 +440,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..08ee53140d88a60323a6fa79b6cc28acedc27c21 100644 (file)
@@ -413,7 +413,7 @@ set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 80
 set g_balance_crylink_secondary_line_fadetime 2
 // }}}
 // {{{ nex
-set g_balance_nex_primary_damage 125
+set g_balance_nex_primary_damage 120
 set g_balance_nex_primary_force 500
 set g_balance_nex_primary_refire 1
 set g_balance_nex_primary_animtime 0.75
@@ -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 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
@@ -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 40
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1.25
index 6798261eb3555f9dc1ae707973911428483f32c2..59a7074d7243578d95cd32b57918c9c3cd9a84c5 100644 (file)
@@ -261,9 +261,12 @@ vector w_org, w_backoff;
 float campingrifle_scope;
 float nex_scope;
 
+float nex_velocitydependent;
 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..79881410d8f9e0123472d6615d9df3652b604ea0 100644 (file)
@@ -1352,9 +1352,12 @@ float CSQC_Parse_TempEntity()
                        bHandled = true;
                        break;
                case TE_CSQC_NEX_VELOCITY:
+                       nex_velocitydependent = ReadByte();
                        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..5f422a03eb0a4b3db660a7ce8b6e13b66ee8acbf 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 && getstati(GetAmmoStat(3)))
+                                       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)
@@ -847,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 && nex_speed > nex_minvelocity) // ring around crosshair representing velocity-dependent damage for the nex
                                {
                                        f = bound(0, (nex_speed - nex_minvelocity) / (nex_maxvelocity - nex_minvelocity), 1);
 
index 5c980920b7228a5dcc37681bca3e7b3fa855afd1..7dc5520abfe036f2065f1acd66b526c0e9734645 100644 (file)
@@ -10,9 +10,12 @@ 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"));
-       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..e4c6347fedf430d3f505b5ce7b66e22815f83409 100644 (file)
@@ -48,6 +48,7 @@ void W_Nex_Attack (float issecondary)
        // TODO: make it more obvious (through effects, indicator on weapon) that damage increases when speed increases
        mydmg *= f;
        myforce *= f;
+       //print("^1Damage: ^7", ftos(mydmg), "\n");
 
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", mydmg);
 
@@ -89,7 +90,15 @@ float w_nex(float req)
                }
                if (self.BUTTON_ATCK2)
                {
-                       if(cvar("g_balance_nex_secondary"))
+                       if(cvar("g_balance_nex_secondary_charge"))
+                       {
+                               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"))
                        {
                                if (weapon_prepareattack(0, cvar("g_balance_nex_secondary_refire")))
                                {
index a791c6f817e866e643fa007a5c378f0e2e0cbe7e..721b37b9142aba750d11267bb1891db1e93ad924 100644 (file)
Binary files a/sound/weapons/campingrifle_fire2.ogg and b/sound/weapons/campingrifle_fire2.ogg differ