From: Samual Lenks <samual@xonotic.org>
Date: Tue, 18 Feb 2014 23:08:42 +0000 (-0500)
Subject: Begin adding special effects for each beam type
X-Git-Tag: xonotic-v0.8.0~152^2~89
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=485fb8637e78eedd6a31df859ebe0de4bc208fbc;p=xonotic%2Fxonotic-data.pk3dir.git

Begin adding special effects for each beam type
---

diff --git a/qcsrc/client/particles.qc b/qcsrc/client/particles.qc
index 7259b808cf..6c7face62e 100644
--- a/qcsrc/client/particles.qc
+++ b/qcsrc/client/particles.qc
@@ -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
diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc
index 519f565d05..a11f722d05 100644
--- a/qcsrc/common/weapons/w_arc.qc
+++ b/qcsrc/common/weapons/w_arc.qc
@@ -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