]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Trying to fix the damn effect... I hate makevectors()
authorSamual Lenks <samual@xonotic.org>
Mon, 23 Jul 2012 00:44:34 +0000 (20:44 -0400)
committerSamual Lenks <samual@xonotic.org>
Mon, 23 Jul 2012 00:44:34 +0000 (20:44 -0400)
qcsrc/client/particles.qc
qcsrc/server/w_laser.qc

index 7815fc26f2b435a535c48b48979a6c01115720ca..6fbe398baa17966ddab733eb24ea0181964fac4a 100644 (file)
@@ -304,33 +304,30 @@ void Net_ReadNexgunBeamParticle()
 
 void Net_ReadShockwaveParticle()
 {
-       vector shotorg, endpos, deviation;
+       vector shotorg, shotdir, deviation;
        shotorg_x = ReadCoord(); shotorg_y = ReadCoord(); shotorg_z = ReadCoord();
-       endpos_x = ReadCoord(); endpos_y = ReadCoord(); endpos_z = ReadCoord();
-       float spread = ReadByte() / 255.0;
-       
-       float counter, shots;
+       shotdir_x = ReadCoord(); shotdir_y = ReadCoord(); shotdir_z = ReadCoord();
 
-       float ang;
-
-       shots = 10;
+       float spread = ReadByte() / 255.0;
+       float counter, shots = 10;
        
-       vector shotdir = normalize(endpos - shotorg);
        makevectors(shotdir);
        vector right = v_right;
        vector up = v_up;
+
+       print("v_right = ", vtos(v_right), ", shotdir = ", vtos(shotdir), ".\n");
        
        for(counter = 0; counter < shots; ++counter)
        {
-               ang = M_PI * 2.0 * (0.75 + (counter - 0.5) / shots);
-               deviation = ((shotdir + (right * cos(ang) * 0.075) + (up * sin(ang) * 0.075)) * 1000);
-               //deviation = '0 0 0';
-               //makevectors('0 360 0' * (0.75 + (counter - 0.5) / shots));
-               //deviation_y = v_forward_x;
-               //deviation_z = v_forward_y;
-               //deviation = deviation * spread;
+               //ang = M_PI * 2.0 * (0.75 + (counter - 0.5) / shots);
+               //deviation = ((shotdir + (right * cos(ang) * 0.075) + (up * sin(ang) * 0.075)) * 1000);
+               deviation = '0 0 0';
+               makevectors('0 360 0' * (0.75 + (counter - 0.5) / shots));
+               deviation_y = v_forward_x;
+               deviation_z = v_forward_y;
+               deviation = deviation * spread;
                //print("v_forward = ", vtos(deviation), ".\n");
-               //deviation = ((shotdir + (right * deviation_y) + (up * deviation_z)) * 1000);
+               deviation = ((shotdir + (right * deviation_y) + (up * deviation_z)) * 1000);
                
                //deviation = W_CalculateSpread(shotdir, spread, 1, cvar("g_projectiles_spread_style"));
                //print("deviation = ", vtos(deviation), ".\n");
@@ -351,7 +348,7 @@ void Net_ReadShockwaveParticle()
                deviation = W_CalculateSpread(shotdir, spread, 1, cvar("g_projectiles_spread_style"));
                //print("deviation = ", vtos(deviation), ".\n");
                
-               pointparticles(particleeffectnum("laser_shockwave_attack"), shotorg, deviation * 1000, 1);
+               //pointparticles(particleeffectnum("laser_shockwave_attack"), shotorg, deviation * 1000, 1);
        }
        
        //print("definitely doing the effect.\n");
index 18d9d92358257ac5b7e8feb0137c44e00d1f18cd..c121fa36afe46a550894974e3f0c1a662900054a 100644 (file)
@@ -5,7 +5,7 @@ REGISTER_WEAPON(LASER, w_laser, 0, 1, WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WE
 void(float imp) W_SwitchWeapon;
 void() W_LastWeapon;
 
-void SendCSQCShockwaveParticle(float spread, vector endpos
+void SendCSQCShockwaveParticle(float spread) 
 {
        //WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos);
        WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
@@ -13,9 +13,9 @@ void SendCSQCShockwaveParticle(float spread, vector endpos)
        WriteCoord(MSG_BROADCAST, w_shotorg_x);
        WriteCoord(MSG_BROADCAST, w_shotorg_y);
        WriteCoord(MSG_BROADCAST, w_shotorg_z);
-       WriteCoord(MSG_BROADCAST, endpos_x);
-       WriteCoord(MSG_BROADCAST, endpos_y);
-       WriteCoord(MSG_BROADCAST, endpos_z);
+       WriteCoord(MSG_BROADCAST, w_shotdir_x);
+       WriteCoord(MSG_BROADCAST, w_shotdir_y);
+       WriteCoord(MSG_BROADCAST, w_shotdir_z);
        WriteByte(MSG_BROADCAST, bound(0, 255 * spread, 255));
 }
 
@@ -121,7 +121,7 @@ void W_Laser_Shockwave (void)
        RadiusDamageForSource(self, trace_endpos, '0 0 0', self, autocvar_g_balance_laser_primary_damage, autocvar_g_balance_laser_primary_edgedamage, autocvar_g_balance_laser_primary_jumpradius, world, self, TRUE, autocvar_g_balance_laser_primary_force, WEP_LASER, world);
        
        // also do the firing effect now
-       SendCSQCShockwaveParticle(autocvar_g_balance_laser_primary_spread, attack_hitpos);
+       SendCSQCShockwaveParticle(autocvar_g_balance_laser_primary_spread);
        
        // did we hit a player directly?
        if(aim_ent.takedamage)