Merge remote branch 'origin/master' into fruitiex/fruitbalance
authorFruitieX <rasse@rasse-lappy.localdomain>
Tue, 27 Jul 2010 11:35:03 +0000 (14:35 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Tue, 27 Jul 2010 11:35:03 +0000 (14:35 +0300)
1  2 
effectinfo.txt
qcsrc/client/hook.qc
qcsrc/server/w_electro.qc

diff --combined effectinfo.txt
@@@ -4976,73 -4976,45 +4976,83 @@@ velocityjitter 156 156 15
  // used in qcsrc/server/w_electro.qc: pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
  // used in qcsrc/server/w_electro.qc: pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
  effect electro_lightning
+ countabsolute 1
+ type decal
+ tex 59 59
+ size 16 16
+ alpha 256 256 0
+ originjitter 2 2 2
+ lightradius 50
+ lightradiusfade 200
+ lightcolor 3.125 4.375 10
+ effect electro_lightning
  count 300
  type spark
 -color 0x283880 0x283880 // 0x202020 0x404040
 +color 0x501860 0x501860 // 0x202020 0x404040
 +tex 65 65
 +size 6 6
 +alpha 100 206 1724
 +originjitter 1.5 1.5 1.5
 +velocityjitter 6 6 6
 +sizeincrease 10
 +velocitymultiplier 2000
 +effect electro_lightning
 +count 30
 +type spark
 +tex 8 15
 +color 0xDDFDFF 0xFDFDFF
 +size 2 5
 +alpha 110 170 1500
 +originjitter 1 1 1
 +velocityjitter 150 150 150
 +velocitymultiplier 0.5
 +airfriction 2
 +stretchfactor 1.5
 +effect electro_lightning
 +count 50
 +type spark
 +tex 41 41
 +color 0xFDFDFF 0xF9FDFF
 +size 2 3
 +alpha 110 170 1500
 +originjitter 1 1 1
 +velocityjitter 350 350 350
 +velocitymultiplier 2.5
 +airfriction 8
 +gravity 1.3
 +stretchfactor 0.1
 +
 +// used in qcsrc/server/w_gauntlet.qc:        pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1)
 +effect gauntlet_lightning
 +count 300
 +type spark
 +color 0x280000 0x280000 // 0x202020 0x404040
  tex 65 65
- size 5 5
+ size 3 3
  alpha 256 256 1024
  originjitter 1.5 1.5 1.5
  velocityjitter 6 6 6
- sizeincrease 20
+ sizeincrease 15
  velocitymultiplier 2000
 -effect electro_lightning
 +effect gauntlet_lightning
  count 30
  type spark
  tex 8 15
 -color 0xD9FDFF 0xD9FDFF
 -size 3 7
 -alpha 110 228 2024
 +color 0xDD0000 0xFD0000
 +size 2 5
 +alpha 110 228 1024
  originjitter 1 1 1
  velocityjitter 150 150 150
  velocitymultiplier 0.5
  airfriction 2
  stretchfactor 1.5
 -effect electro_lightning
 +effect gauntlet_lightning
  count 50
  type spark
  tex 41 41
 -color 0xD9FDFF 0xD9FDFF
 -size 3 4
 -alpha 110 228 1500
 +color 0xFD0000 0xF90000
 +size 2 3
 +alpha 110 228 600
  originjitter 1 1 1
  velocityjitter 350 350 350
  velocitymultiplier 2.5
diff --combined qcsrc/client/hook.qc
@@@ -3,6 -3,7 +3,7 @@@
  .vector velocity;
  .float HookSound;
  .float HookSilent;
+ .float HookRange;
  
  void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float alpha, float drawflag)
  {
@@@ -48,7 -49,7 +49,7 @@@ void Draw_GrapplingHook_trace_callback(
  
  void Draw_GrapplingHook()
  {
-       vector a, b;
+       vector a, b, atrans;
        string tex, snd;
        vector rgb;
        float t;
                                break;
                        case ENT_CLIENT_LGBEAM:
                        case ENT_CLIENT_GAUNTLET:
-                               b = view_origin + view_forward * vlen(self.velocity - self.origin); // honor original length of beam!
+                               if(self.HookRange)
+                                       b = view_origin + view_forward * self.HookRange;
+                               else
+                                       b = view_origin + view_forward * vlen(self.velocity - self.origin); // honor original length of beam!
                                WarpZone_TraceLine(view_origin, b, MOVE_NORMAL, world);
                                b = WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
                                a = view_origin + view_forward * vs_x + view_right * -vs_y + view_up * vs_z;
        WarpZone_TraceBox_ThroughZone(a, '0 0 0', '0 0 0', b, ((self.HookType == ENT_CLIENT_HOOK) ? MOVE_NOTHING : MOVE_NORMAL), world, world, Draw_GrapplingHook_trace_callback);
        Draw_GrapplingHook_trace_callback_tex = string_null;
  
+       atrans = WarpZone_TransformOrigin(WarpZone_trace_transform, a);
        switch(self.HookType)
        {
                default:
                case ENT_CLIENT_HOOK:
                        setorigin(self, trace_endpos); // hook endpoint!
-                       self.angles = vectoangles(trace_endpos - WarpZone_TransformOrigin(WarpZone_trace_transform, a));
+                       self.angles = vectoangles(trace_endpos - atrans);
                        break;
                case ENT_CLIENT_LGBEAM:
                case ENT_CLIENT_GAUNTLET:
                case ENT_CLIENT_HOOK:
                        break;
                case ENT_CLIENT_LGBEAM:
-                       pointparticles(particleeffectnum("electro_lightning"), b, normalize(a - b), frametime);
+                       pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime);
                        break;
                case ENT_CLIENT_GAUNTLET:
 +                      pointparticles(particleeffectnum("gauntlet_lightning"), b, normalize(a - b), frametime);
                        break;
        }
  }
@@@ -204,6 -209,17 +210,17 @@@ void Ent_ReadHook(float bIsNew, float t
        if(sf & 1)
        {
                self.owner = playerslots[ReadByte() - 1];
+               switch(self.HookType)
+               {
+                       default:
+                       case ENT_CLIENT_HOOK:
+                       case ENT_CLIENT_GAUNTLET:
+                               self.HookRange = 0;
+                               break;
+                       case ENT_CLIENT_LGBEAM:
+                               self.HookRange = ReadCoord();
+                               break;
+               }
        }
        if(sf & 2)
        {
@@@ -195,6 -195,7 +195,7 @@@ float lgbeam_send(entity to, float sf
        if(sf & 1)
        {
                WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+               WriteCoord(MSG_ENTITY, cvar("g_balance_electro_primary_range"));
        }
        if(sf & 2)
        {
@@@ -243,7 -244,6 +244,7 @@@ void lgbeam_think(
                vector force;
                force = w_shotdir * cvar("g_balance_electro_primary_force") + '0 0 1' * cvar("g_balance_electro_primary_force_up");
                Damage (trace_ent, self.owner, self.owner, cvar("g_balance_electro_primary_damage") * dt, WEP_ELECTRO, trace_endpos, force * dt);
 +              Damage_RecordDamage(self.owner, WEP_ELECTRO, cvar("g_balance_electro_primary_damage") * dt);
        }
        W_Plasma_TriggerCombo(trace_endpos, cvar("g_balance_electro_primary_comboradius"), self.owner);