]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Begin adding special effects for each beam type
authorSamual Lenks <samual@xonotic.org>
Tue, 18 Feb 2014 23:08:42 +0000 (18:08 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 18 Feb 2014 23:08:42 +0000 (18:08 -0500)
qcsrc/client/particles.qc
qcsrc/common/weapons/w_arc.qc

index 7259b808cf141d039f82bce2c0ca0e936e78f3dd..6c7face62ec78816a31679cb4e6b1a00c9a0ecd7 100644 (file)
@@ -465,6 +465,37 @@ void Draw_ArcBeam()
        float segments = 20; // todo: calculate this in a similar way to server does
        float maxthickness = 8;
 
+       vector beamrgb;
+       float beamalpha;
+       float thickness;
+
+       /*
+       #define ARC_BT_MISS        0
+       #define ARC_BT_WALL        1
+       #define ARC_BT_HEAL        2
+       #define ARC_BT_HIT         3
+       #define ARC_BT_BURST_MISS  10
+       #define ARC_BT_BURST_WALL  11
+       #define ARC_BT_BURST_HEAL  12
+       #define ARC_BT_BURST_HIT   13
+       */
+
+       switch(self.beam_type)
+       {
+               case ARC_BT_MISS:        beamrgb = '-1 -1 1';    beamalpha = 0.5;  thickness = 8; break;
+               case ARC_BT_WALL:        beamrgb = '0.5 0.5 1';  beamalpha = 0.5;  thickness = 8; break;
+               case ARC_BT_HEAL:        beamrgb = '0 1 0';      beamalpha = 0.5;  thickness = 8; break;
+               case ARC_BT_HIT:         beamrgb = '1 0 1';      beamalpha = 0.5;  thickness = 8; break;
+               case ARC_BT_BURST_MISS:  beamrgb = '-1 -1 1';    beamalpha = 0.5;  thickness = 14; break;
+               case ARC_BT_BURST_WALL:  beamrgb = '0.5 0.5 1';  beamalpha = 0.5;  thickness = 14; break;
+               case ARC_BT_BURST_HEAL:  beamrgb = '0 1 0';      beamalpha = 0.5;  thickness = 14; break;
+               case ARC_BT_BURST_HIT:   beamrgb = '1 0 1';      beamalpha = 0.5;  thickness = 14; break;
+
+               // shouldn't be possible...
+               default: beamrgb = '1 1 1'; beamalpha = 1; thickness = 4; break;
+       }
+
+       printf("beam type: %d\n", self.beam_type); 
 
        vector thickdir = normalize(cross(beamdir, view_origin - start_pos));
 
@@ -515,16 +546,14 @@ void Draw_ArcBeam()
                //float falloff = 1;
                #endif
 
-               float thickness = 8;
-
                vector top    = hitorigin + (thickdir * thickness);
                vector bottom = hitorigin - (thickdir * thickness);
 
                R_BeginPolygon("particles/lgbeam", DRAWFLAG_NORMAL);
-               R_PolygonVertex(top,         '0 0.5 0' + ('0 0.5 0' * (thickness / maxthickness)), '0.5 0.5 1', 0.5);
-               R_PolygonVertex(last_top,    '0 0.5 0' + ('0 0.5 0' * (lastthickness / maxthickness)), '0.5 0.5 1', 0.5);
-               R_PolygonVertex(last_bottom, '0 0.5 0' * (1 - (lastthickness / maxthickness)), '0.5 0.5 1', 0.5);
-               R_PolygonVertex(bottom,      '0 0.5 0' * (1 - (thickness / maxthickness)), '0.5 0.5 1', 0.5);
+               R_PolygonVertex(top,         '0 0.5 0' + ('0 0.5 0' * (thickness / maxthickness)),     beamrgb, beamalpha);
+               R_PolygonVertex(last_top,    '0 0.5 0' + ('0 0.5 0' * (lastthickness / maxthickness)), beamrgb, beamalpha);
+               R_PolygonVertex(last_bottom, '0 0.5 0' * (1 - (lastthickness / maxthickness)),         beamrgb, beamalpha);
+               R_PolygonVertex(bottom,      '0 0.5 0' * (1 - (thickness / maxthickness)),             beamrgb, beamalpha);
                R_EndPolygon();
 
                // draw collision effect
index 519f565d05329096da7317fd2237336e695226f6..a11f722d054cee27a842ee22425f428c311b8a27 100644 (file)
@@ -109,7 +109,7 @@ float W_Arc_Beam_Send(entity to, float sf)
 
 void W_Arc_Beam_Think(void)
 {
-       float i, burst = TRUE;
+       float i, burst = 0;
        if(self != self.owner.arc_beam)
        {
                #ifdef ARC_DEBUG