codemp/cgame/fx_disruptor.c

Go to the documentation of this file.
00001 // Disruptor Weapon
00002 
00003 #include "cg_local.h"
00004 #include "fx_local.h"
00005 
00006 /*
00007 ---------------------------
00008 FX_DisruptorMainShot
00009 ---------------------------
00010 */
00011 static vec3_t WHITE={1.0f,1.0f,1.0f};
00012 
00013 void FX_DisruptorMainShot( vec3_t start, vec3_t end )
00014 {
00015 //      vec3_t  dir;
00016 //      float   len;
00017 
00018         trap_FX_AddLine( start, end, 0.1f, 6.0f, 0.0f, 
00019                                                         1.0f, 0.0f, 0.0f,
00020                                                         WHITE, WHITE, 0.0f,
00021                                                         150, trap_R_RegisterShader( "gfx/effects/redLine" ), 
00022                                                         FX_SIZE_LINEAR | FX_ALPHA_LINEAR );
00023 
00024 //      VectorSubtract( end, start, dir );
00025 //      len = VectorNormalize( dir );
00026 
00027 //      FX_AddCylinder( start, dir, 5.0f, 5.0f, 0.0f,
00028 //                                                              5.0f, 5.0f, 0.0f,
00029 //                                                              len, len, 0.0f,
00030 //                                                              1.0f, 1.0f, 0.0f,
00031 //                                                              WHITE, WHITE, 0.0f,
00032 //                                                              400, cgi_R_RegisterShader( "gfx/effects/spiral" ), 0 );
00033 }
00034 
00035 
00036 /*
00037 ---------------------------
00038 FX_DisruptorAltShot
00039 ---------------------------
00040 */
00041 void FX_DisruptorAltShot( vec3_t start, vec3_t end, qboolean fullCharge )
00042 {
00043         trap_FX_AddLine( start, end, 0.1f, 10.0f, 0.0f, 
00044                                                         1.0f, 0.0f, 0.0f,
00045                                                         WHITE, WHITE, 0.0f,
00046                                                         175, trap_R_RegisterShader( "gfx/effects/redLine" ), 
00047                                                         FX_SIZE_LINEAR | FX_ALPHA_LINEAR );
00048 
00049         if ( fullCharge )
00050         {
00051                 vec3_t  YELLER={0.8f,0.7f,0.0f};
00052 
00053                 // add some beef
00054                 trap_FX_AddLine( start, end, 0.1f, 7.0f, 0.0f, 
00055                                                         1.0f, 0.0f, 0.0f,
00056                                                         YELLER, YELLER, 0.0f,
00057                                                         150, trap_R_RegisterShader( "gfx/misc/whiteline2" ), 
00058                                                         FX_SIZE_LINEAR | FX_ALPHA_LINEAR );
00059         }
00060 }
00061 
00062 
00063 /*
00064 ---------------------------
00065 FX_DisruptorAltMiss
00066 ---------------------------
00067 */
00068 #define FX_ALPHA_WAVE           0x00000008
00069 
00070 void FX_DisruptorAltMiss( vec3_t origin, vec3_t normal )
00071 {
00072         vec3_t pos, c1, c2;
00073         addbezierArgStruct_t b;
00074 
00075         VectorMA( origin, 4.0f, normal, c1 );
00076         VectorCopy( c1, c2 );
00077         c1[2] += 4;
00078         c2[2] += 12;
00079         
00080         VectorAdd( origin, normal, pos );
00081         pos[2] += 28;
00082 
00083         /*
00084         FX_AddBezier( origin, pos, c1, vec3_origin, c2, vec3_origin, 6.0f, 6.0f, 0.0f, 0.0f, 0.2f, 0.5f,
00085         WHITE, WHITE, 0.0f, 4000, trap_R_RegisterShader( "gfx/effects/smokeTrail" ), FX_ALPHA_WAVE );
00086         */
00087 
00088         VectorCopy(origin, b.start);
00089         VectorCopy(pos, b.end);
00090         VectorCopy(c1, b.control1);
00091         VectorCopy(vec3_origin, b.control1Vel);
00092         VectorCopy(c2, b.control2);
00093         VectorCopy(vec3_origin, b.control2Vel);
00094 
00095         b.size1 = 6.0f;
00096         b.size2 = 6.0f;
00097         b.sizeParm = 0.0f;
00098         b.alpha1 = 0.0f;
00099         b.alpha2 = 0.2f;
00100         b.alphaParm = 0.5f;
00101         
00102         VectorCopy(WHITE, b.sRGB);
00103         VectorCopy(WHITE, b.eRGB);
00104 
00105         b.rgbParm = 0.0f;
00106         b.killTime = 4000;
00107         b.shader = trap_R_RegisterShader( "gfx/effects/smokeTrail" );
00108         b.flags = FX_ALPHA_WAVE;
00109 
00110         trap_FX_AddBezier(&b);
00111 
00112         trap_FX_PlayEffectID( cgs.effects.disruptorAltMissEffect, origin, normal, -1, -1 );
00113 }
00114 
00115 /*
00116 ---------------------------
00117 FX_DisruptorAltHit
00118 ---------------------------
00119 */
00120 
00121 void FX_DisruptorAltHit( vec3_t origin, vec3_t normal )
00122 {
00123         trap_FX_PlayEffectID( cgs.effects.disruptorAltHitEffect, origin, normal, -1, -1 );
00124 }
00125 
00126 
00127 
00128 /*
00129 ---------------------------
00130 FX_DisruptorHitWall
00131 ---------------------------
00132 */
00133 
00134 void FX_DisruptorHitWall( vec3_t origin, vec3_t normal )
00135 {
00136         trap_FX_PlayEffectID( cgs.effects.disruptorWallImpactEffect, origin, normal, -1, -1 );
00137 }
00138 
00139 /*
00140 ---------------------------
00141 FX_DisruptorHitPlayer
00142 ---------------------------
00143 */
00144 
00145 void FX_DisruptorHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid )
00146 {
00147         trap_FX_PlayEffectID( cgs.effects.disruptorFleshImpactEffect, origin, normal, -1, -1 );
00148 }