codemp/cgame/cg_weaponinit.c File Reference

#include "cg_local.h"
#include "fx_local.h"

Go to the source code of this file.

Functions

void CG_RegisterWeapon (int weaponNum)


Function Documentation

void CG_RegisterWeapon int  weaponNum  ) 
 

Definition at line 14 of file cg_weaponinit.c.

References weaponInfo_s::altChargeSound, weaponInfo_s::altFiringSound, weaponInfo_s::altFlashSound, weaponInfo_s::altMissileDlight, weaponInfo_s::altMissileDlightColor, weaponInfo_s::altMissileHitSound, weaponInfo_s::altMissileModel, weaponInfo_s::altMissileSound, weaponInfo_s::altMissileTrailFunc, weaponInfo_s::altMuzzleEffect, weaponInfo_s::ammoIcon, weaponInfo_s::ammoModel, weaponInfo_s::barrelModel, bg_itemlist, cgEffects_t::blasterDroidImpactEffect, cgEffects_t::blasterFleshImpactEffect, cgEffects_t::blasterShotEffect, cgEffects_t::blasterWallImpactEffect, cgEffects_t::bowcasterImpactEffect, cgEffects_t::bowcasterShotEffect, cgEffects_t::bryarDroidImpactEffect, cgEffects_t::bryarFleshImpactEffect, cgMedia_t::bryarFrontFlash, cgEffects_t::bryarPowerupShotEffect, cgEffects_t::bryarShotEffect, cgEffects_t::bryarWallImpactEffect, cgEffects_t::bryarWallImpactEffect2, cgEffects_t::bryarWallImpactEffect3, CG_Error(), CG_RegisterItemVisuals(), cg_weapons, cgs, weaponInfo_s::chargeSound, gitem_s::classname, COM_StripExtension(), cgEffects_t::concussionImpactEffect, cgEffects_t::concussionShotEffect, cgEffects_t::demp2FleshImpactEffect, cgEffects_t::demp2ProjectileEffect, cgMedia_t::demp2Shell, cgMedia_t::demp2ShellShader, cgEffects_t::demp2WallImpactEffect, cgEffects_t::disruptorAltHitEffect, cgEffects_t::disruptorAltMissEffect, cgMedia_t::disruptorChargeShader, cgEffects_t::disruptorFleshImpactEffect, cgMedia_t::disruptorInsert, cgMedia_t::disruptorInsertTick, cgMedia_t::disruptorLight, cgMedia_t::disruptorMask, cgEffects_t::disruptorProjectileEffect, cgEffects_t::disruptorRingsEffect, cgEffects_t::disruptorWallImpactEffect, cgMedia_t::disruptorZoomLoop, cgs_t::effects, weaponInfo_s::firingSound, weaponInfo_s::flashDlightColor, weaponInfo_s::flashModel, weaponInfo_s::flashSound, cgEffects_t::flechetteAltShotEffect, cgEffects_t::flechetteFleshImpactEffect, cgEffects_t::flechetteShotEffect, cgEffects_t::flechetteWallImpactEffect, FX_BlasterProjectileThink(), FX_BowcasterAltProjectileThink(), FX_BowcasterProjectileThink(), FX_BryarAltProjectileThink(), FX_BryarProjectileThink(), FX_ConcussionProjectileThink(), FX_DEMP2_ProjectileThink(), FX_FlechetteAltProjectileThink(), FX_FlechetteProjectileThink(), FX_RepeaterAltProjectileThink(), FX_RepeaterProjectileThink(), FX_RocketAltProjectileThink(), FX_RocketProjectileThink(), FX_TurretProjectileThink(), gitem_s::giTag, gitem_t, gitem_s::giType, cgMedia_t::greenFrontFlash, cgMedia_t::grenadeBounce1, cgMedia_t::grenadeBounce2, weaponInfo_s::handsModel, gitem_s::icon, IT_AMMO, IT_WEAPON, weaponInfo_s::item, cgMedia_t::lightningFlash, MAKERGB, MAX_QPATH, cgs_t::media, memset(), weaponInfo_s::missileDlight, weaponInfo_s::missileDlightColor, weaponInfo_s::missileHitSound, weaponInfo_s::missileModel, weaponInfo_s::missileSound, weaponInfo_s::missileTrailFunc, weaponInfo_s::muzzleEffect, NULL_FX, NULL_HANDLE, NULL_SOUND, qtrue, weaponInfo_s::registered, cgEffects_t::repeaterAltProjectileEffect, cgEffects_t::repeaterAltWallImpactEffect, cgEffects_t::repeaterFleshImpactEffect, cgEffects_t::repeaterProjectileEffect, cgEffects_t::repeaterWallImpactEffect, cgEffects_t::rocketExplosionEffect, cgEffects_t::rocketShotEffect, weaponInfo_s::selectSound, strcat(), strcpy(), cgEffects_t::thermalExplosionEffect, cgEffects_t::thermalShockwaveEffect, trap_FX_RegisterEffect(), trap_R_ModelBounds(), trap_R_RegisterModel(), trap_R_RegisterShader(), trap_R_RegisterShaderNoMip(), trap_S_RegisterSound(), cgEffects_t::tripmineGlowFX, cgEffects_t::tripmineLaserFX, vec3_t, VectorSet, gitem_s::view_model, weaponInfo_s::viewModel, weaponInfo_s::weaponIcon, weaponInfo_t, weaponInfo_s::weaponMidpoint, weaponInfo_s::weaponModel, gitem_s::world_model, WP_BLASTER, WP_BOWCASTER, WP_BRYAR_OLD, WP_BRYAR_PISTOL, WP_CONCUSSION, WP_DEMP2, WP_DISRUPTOR, WP_EMPLACED_GUN, WP_FLECHETTE, WP_MELEE, WP_REPEATER, WP_ROCKET_LAUNCHER, WP_SABER, and WP_STUN_BATON.

Referenced by CG_AddPlayerWeapon(), CG_AddViewWeapon(), CG_DrawWeaponSelect(), CG_EntityEvent(), CG_RegisterItemVisuals(), and TurretClientRun().

00014                                        {
00015         weaponInfo_t    *weaponInfo;
00016         gitem_t                 *item, *ammo;
00017         char                    path[MAX_QPATH];
00018         vec3_t                  mins, maxs;
00019         int                             i;
00020 
00021         weaponInfo = &cg_weapons[weaponNum];
00022 
00023         if ( weaponNum == 0 ) {
00024                 return;
00025         }
00026 
00027         if ( weaponInfo->registered ) {
00028                 return;
00029         }
00030 
00031         memset( weaponInfo, 0, sizeof( *weaponInfo ) );
00032         weaponInfo->registered = qtrue;
00033 
00034         for ( item = bg_itemlist + 1 ; item->classname ; item++ ) {
00035                 if ( item->giType == IT_WEAPON && item->giTag == weaponNum ) {
00036                         weaponInfo->item = item;
00037                         break;
00038                 }
00039         }
00040         if ( !item->classname ) {
00041                 CG_Error( "Couldn't find weapon %i", weaponNum );
00042         }
00043         CG_RegisterItemVisuals( item - bg_itemlist );
00044 
00045         // load cmodel before model so filecache works
00046         weaponInfo->weaponModel = trap_R_RegisterModel( item->world_model[0] );
00047         // load in-view model also
00048         weaponInfo->viewModel = trap_R_RegisterModel(item->view_model);
00049 
00050         // calc midpoint for rotation
00051         trap_R_ModelBounds( weaponInfo->weaponModel, mins, maxs );
00052         for ( i = 0 ; i < 3 ; i++ ) {
00053                 weaponInfo->weaponMidpoint[i] = mins[i] + 0.5 * ( maxs[i] - mins[i] );
00054         }
00055 
00056         weaponInfo->weaponIcon = trap_R_RegisterShader( item->icon );
00057         weaponInfo->ammoIcon = trap_R_RegisterShader( item->icon );
00058 
00059         for ( ammo = bg_itemlist + 1 ; ammo->classname ; ammo++ ) {
00060                 if ( ammo->giType == IT_AMMO && ammo->giTag == weaponNum ) {
00061                         break;
00062                 }
00063         }
00064         if ( ammo->classname && ammo->world_model[0] ) {
00065                 weaponInfo->ammoModel = trap_R_RegisterModel( ammo->world_model[0] );
00066         }
00067 
00068 //      strcpy( path, item->view_model );
00069 //      COM_StripExtension( path, path );
00070 //      strcat( path, "_flash.md3" );
00071         weaponInfo->flashModel = 0;//trap_R_RegisterModel( path );
00072 
00073         if (weaponNum == WP_DISRUPTOR ||
00074                 weaponNum == WP_FLECHETTE ||
00075                 weaponNum == WP_REPEATER ||
00076                 weaponNum == WP_ROCKET_LAUNCHER)
00077         {
00078                 strcpy( path, item->view_model );
00079                 COM_StripExtension( path, path );
00080                 strcat( path, "_barrel.md3" );
00081                 weaponInfo->barrelModel = trap_R_RegisterModel( path );
00082         }
00083         else if (weaponNum == WP_STUN_BATON)
00084         { //only weapon with more than 1 barrel..
00085                 trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel.md3");
00086                 trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel2.md3");
00087                 trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel3.md3");
00088         }
00089         else
00090         {
00091                 weaponInfo->barrelModel = 0;
00092         }
00093 
00094         if (weaponNum != WP_SABER)
00095         {
00096                 strcpy( path, item->view_model );
00097                 COM_StripExtension( path, path );
00098                 strcat( path, "_hand.md3" );
00099                 weaponInfo->handsModel = trap_R_RegisterModel( path );
00100         }
00101         else
00102         {
00103                 weaponInfo->handsModel = 0;
00104         }
00105 
00106 //      if ( !weaponInfo->handsModel ) {
00107 //              weaponInfo->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" );
00108 //      }
00109 
00110         switch ( weaponNum ) {
00111         case WP_STUN_BATON:
00112         case WP_MELEE:
00113 /*              MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f );
00114                 weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/saber/saberhum.wav" );
00115 //              weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav" );
00116 */
00117                 //trap_R_RegisterShader( "gfx/effects/stunPass" );
00118                 trap_FX_RegisterEffect( "stunBaton/flesh_impact" );
00119 
00120                 if (weaponNum == WP_STUN_BATON)
00121                 {
00122                         trap_S_RegisterSound( "sound/weapons/baton/idle.wav" );
00123                         weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/baton/fire.mp3" );
00124                         weaponInfo->altFlashSound[0] = trap_S_RegisterSound( "sound/weapons/baton/fire.mp3" );
00125                 }
00126                 else
00127                 {
00128                         /*
00129                         int j = 0;
00130 
00131                         while (j < 4)
00132                         {
00133                                 weaponInfo->flashSound[j] = trap_S_RegisterSound( va("sound/weapons/melee/swing%i", j+1) );
00134                                 weaponInfo->altFlashSound[j] = weaponInfo->flashSound[j];
00135                                 j++;
00136                         }
00137                         */
00138                         //No longer needed, animsound config plays them for us
00139                 }
00140                 break;
00141         case WP_SABER:
00142                 MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f );
00143                 weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/saber/saberhum1.wav" );
00144                 weaponInfo->missileModel                = trap_R_RegisterModel( "models/weapons2/saber/saber_w.glm" );
00145                 break;
00146 
00147         case WP_CONCUSSION:
00148                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/concussion/select.wav");
00149 
00150                 weaponInfo->flashSound[0]               = NULL_SOUND;
00151                 weaponInfo->firingSound                 = NULL_SOUND;
00152                 weaponInfo->chargeSound                 = NULL_SOUND;
00153                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "concussion/muzzle_flash" );
00154                 weaponInfo->missileModel                = NULL_HANDLE;
00155                 weaponInfo->missileSound                = NULL_SOUND;
00156                 weaponInfo->missileDlight               = 0;
00157                 //weaponInfo->missileDlightColor= {0,0,0};
00158                 weaponInfo->missileHitSound             = NULL_SOUND;
00159                 weaponInfo->missileTrailFunc    = FX_ConcussionProjectileThink;
00160 
00161                 weaponInfo->altFlashSound[0]    = NULL_SOUND;
00162                 weaponInfo->altFiringSound              = NULL_SOUND;
00163                 weaponInfo->altChargeSound              = trap_S_RegisterSound( "sound/weapons/bryar/altcharge.wav");
00164                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "concussion/altmuzzle_flash" );
00165                 weaponInfo->altMissileModel             = NULL_HANDLE;
00166                 weaponInfo->altMissileSound             = NULL_SOUND;
00167                 weaponInfo->altMissileDlight    = 0;
00168                 //weaponInfo->altMissileDlightColor= {0,0,0};
00169                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00170                 weaponInfo->altMissileTrailFunc = FX_ConcussionProjectileThink;
00171 
00172                 cgs.effects.disruptorAltMissEffect              = trap_FX_RegisterEffect( "disruptor/alt_miss" );
00173 
00174                 cgs.effects.concussionShotEffect                = trap_FX_RegisterEffect( "concussion/shot" );
00175                 cgs.effects.concussionImpactEffect              = trap_FX_RegisterEffect( "concussion/explosion" );
00176                 trap_R_RegisterShader("gfx/effects/blueLine");
00177                 trap_R_RegisterShader("gfx/misc/whiteline2");
00178                 break;
00179 
00180         case WP_BRYAR_PISTOL:
00181         case WP_BRYAR_OLD:
00182                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/bryar/select.wav");
00183 
00184                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/bryar/fire.wav");
00185                 weaponInfo->firingSound                 = NULL_SOUND;
00186                 weaponInfo->chargeSound                 = NULL_SOUND;
00187                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "bryar/muzzle_flash" );
00188                 weaponInfo->missileModel                = NULL_HANDLE;
00189                 weaponInfo->missileSound                = NULL_SOUND;
00190                 weaponInfo->missileDlight               = 0;
00191                 //weaponInfo->missileDlightColor= {0,0,0};
00192                 weaponInfo->missileHitSound             = NULL_SOUND;
00193                 weaponInfo->missileTrailFunc    = FX_BryarProjectileThink;
00194 
00195                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/bryar/alt_fire.wav");
00196                 weaponInfo->altFiringSound              = NULL_SOUND;
00197                 weaponInfo->altChargeSound              = trap_S_RegisterSound( "sound/weapons/bryar/altcharge.wav");
00198                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "bryar/muzzle_flash" );
00199                 weaponInfo->altMissileModel             = NULL_HANDLE;
00200                 weaponInfo->altMissileSound             = NULL_SOUND;
00201                 weaponInfo->altMissileDlight    = 0;
00202                 //weaponInfo->altMissileDlightColor= {0,0,0};
00203                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00204                 weaponInfo->altMissileTrailFunc = FX_BryarAltProjectileThink;
00205 
00206                 cgs.effects.bryarShotEffect                     = trap_FX_RegisterEffect( "bryar/shot" );
00207                 cgs.effects.bryarPowerupShotEffect      = trap_FX_RegisterEffect( "bryar/crackleShot" );
00208                 cgs.effects.bryarWallImpactEffect       = trap_FX_RegisterEffect( "bryar/wall_impact" );
00209                 cgs.effects.bryarWallImpactEffect2      = trap_FX_RegisterEffect( "bryar/wall_impact2" );
00210                 cgs.effects.bryarWallImpactEffect3      = trap_FX_RegisterEffect( "bryar/wall_impact3" );
00211                 cgs.effects.bryarFleshImpactEffect      = trap_FX_RegisterEffect( "bryar/flesh_impact" );
00212                 cgs.effects.bryarDroidImpactEffect      = trap_FX_RegisterEffect( "bryar/droid_impact" );
00213 
00214                 cgs.media.bryarFrontFlash = trap_R_RegisterShader( "gfx/effects/bryarFrontFlash" );
00215 
00216                 // Note these are temp shared effects
00217                 trap_FX_RegisterEffect("blaster/wall_impact.efx");
00218                 trap_FX_RegisterEffect("blaster/flesh_impact.efx");
00219 
00220                 break;
00221 
00222         case WP_BLASTER:
00223         case WP_EMPLACED_GUN: //rww - just use the same as this for now..
00224                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/blaster/select.wav");
00225 
00226                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/blaster/fire.wav");
00227                 weaponInfo->firingSound                 = NULL_SOUND;
00228                 weaponInfo->chargeSound                 = NULL_SOUND;
00229                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "blaster/muzzle_flash" );
00230                 weaponInfo->missileModel                = NULL_HANDLE;
00231                 weaponInfo->missileSound                = NULL_SOUND;
00232                 weaponInfo->missileDlight               = 0;
00233 //              weaponInfo->missileDlightColor  = {0,0,0};
00234                 weaponInfo->missileHitSound             = NULL_SOUND;
00235                 weaponInfo->missileTrailFunc    = FX_BlasterProjectileThink;
00236 
00237                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/blaster/alt_fire.wav");
00238                 weaponInfo->altFiringSound              = NULL_SOUND;
00239                 weaponInfo->altChargeSound              = NULL_SOUND;
00240                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "blaster/muzzle_flash" );
00241                 weaponInfo->altMissileModel             = NULL_HANDLE;
00242                 weaponInfo->altMissileSound             = NULL_SOUND;
00243                 weaponInfo->altMissileDlight    = 0;
00244 //              weaponInfo->altMissileDlightColor= {0,0,0};
00245                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00246                 weaponInfo->altMissileTrailFunc = FX_BlasterProjectileThink;
00247 
00248                 trap_FX_RegisterEffect( "blaster/deflect" );
00249                 cgs.effects.blasterShotEffect                   = trap_FX_RegisterEffect( "blaster/shot" );
00250                 cgs.effects.blasterWallImpactEffect             = trap_FX_RegisterEffect( "blaster/wall_impact" );
00251                 cgs.effects.blasterFleshImpactEffect    = trap_FX_RegisterEffect( "blaster/flesh_impact" );
00252                 cgs.effects.blasterDroidImpactEffect    = trap_FX_RegisterEffect( "blaster/droid_impact" );
00253                 break;
00254 
00255         case WP_DISRUPTOR:
00256                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/disruptor/select.wav");
00257 
00258                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/disruptor/fire.wav");
00259                 weaponInfo->firingSound                 = NULL_SOUND;
00260                 weaponInfo->chargeSound                 = NULL_SOUND;
00261                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "disruptor/muzzle_flash" );
00262                 weaponInfo->missileModel                = NULL_HANDLE;
00263                 weaponInfo->missileSound                = NULL_SOUND;
00264                 weaponInfo->missileDlight               = 0;
00265 //              weaponInfo->missileDlightColor  = {0,0,0};
00266                 weaponInfo->missileHitSound             = NULL_SOUND;
00267                 weaponInfo->missileTrailFunc    = 0;
00268 
00269                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/disruptor/alt_fire.wav");
00270                 weaponInfo->altFiringSound              = NULL_SOUND;
00271                 weaponInfo->altChargeSound              = trap_S_RegisterSound("sound/weapons/disruptor/altCharge.wav");
00272                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "disruptor/muzzle_flash" );
00273                 weaponInfo->altMissileModel             = NULL_HANDLE;
00274                 weaponInfo->altMissileSound             = NULL_SOUND;
00275                 weaponInfo->altMissileDlight    = 0;
00276 //              weaponInfo->altMissileDlightColor= {0,0,0};
00277                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00278                 weaponInfo->altMissileTrailFunc = 0;
00279 
00280                 cgs.effects.disruptorRingsEffect                = trap_FX_RegisterEffect( "disruptor/rings" );
00281                 cgs.effects.disruptorProjectileEffect   = trap_FX_RegisterEffect( "disruptor/projectile" );
00282                 cgs.effects.disruptorWallImpactEffect   = trap_FX_RegisterEffect( "disruptor/wall_impact" );
00283                 cgs.effects.disruptorFleshImpactEffect  = trap_FX_RegisterEffect( "disruptor/flesh_impact" );
00284                 cgs.effects.disruptorAltMissEffect              = trap_FX_RegisterEffect( "disruptor/alt_miss" );
00285                 cgs.effects.disruptorAltHitEffect               = trap_FX_RegisterEffect( "disruptor/alt_hit" );
00286 
00287                 trap_R_RegisterShader( "gfx/effects/redLine" );
00288                 trap_R_RegisterShader( "gfx/misc/whiteline2" );
00289                 trap_R_RegisterShader( "gfx/effects/smokeTrail" );
00290 
00291                 trap_S_RegisterSound("sound/weapons/disruptor/zoomstart.wav");
00292                 trap_S_RegisterSound("sound/weapons/disruptor/zoomend.wav");
00293 
00294                 // Disruptor gun zoom interface
00295                 cgs.media.disruptorMask                 = trap_R_RegisterShader( "gfx/2d/cropCircle2");
00296                 cgs.media.disruptorInsert               = trap_R_RegisterShader( "gfx/2d/cropCircle");
00297                 cgs.media.disruptorLight                = trap_R_RegisterShader( "gfx/2d/cropCircleGlow" );
00298                 cgs.media.disruptorInsertTick   = trap_R_RegisterShader( "gfx/2d/insertTick" );
00299                 cgs.media.disruptorChargeShader = trap_R_RegisterShaderNoMip("gfx/2d/crop_charge");
00300 
00301                 cgs.media.disruptorZoomLoop             = trap_S_RegisterSound( "sound/weapons/disruptor/zoomloop.wav" );
00302                 break;
00303 
00304         case WP_BOWCASTER:
00305                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/bowcaster/select.wav");
00306 
00307                 weaponInfo->altFlashSound[0]            = trap_S_RegisterSound( "sound/weapons/bowcaster/fire.wav");
00308                 weaponInfo->altFiringSound                      = NULL_SOUND;
00309                 weaponInfo->altChargeSound                      = NULL_SOUND;
00310                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "bowcaster/muzzle_flash" );
00311                 weaponInfo->altMissileModel             = NULL_HANDLE;
00312                 weaponInfo->altMissileSound             = NULL_SOUND;
00313                 weaponInfo->altMissileDlight            = 0;
00314 //              weaponInfo->altMissileDlightColor       = {0,0,0};
00315                 weaponInfo->altMissileHitSound          = NULL_SOUND;
00316                 weaponInfo->altMissileTrailFunc = FX_BowcasterProjectileThink;
00317 
00318                 weaponInfo->flashSound[0]       = trap_S_RegisterSound( "sound/weapons/bowcaster/fire.wav");
00319                 weaponInfo->firingSound         = NULL_SOUND;
00320                 weaponInfo->chargeSound         = trap_S_RegisterSound( "sound/weapons/bowcaster/altcharge.wav");
00321                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "bowcaster/muzzle_flash" );
00322                 weaponInfo->missileModel                = NULL_HANDLE;
00323                 weaponInfo->missileSound                = NULL_SOUND;
00324                 weaponInfo->missileDlight       = 0;
00325 //              weaponInfo->missileDlightColor= {0,0,0};
00326                 weaponInfo->missileHitSound     = NULL_SOUND;
00327                 weaponInfo->missileTrailFunc = FX_BowcasterAltProjectileThink;
00328 
00329                 cgs.effects.bowcasterShotEffect         = trap_FX_RegisterEffect( "bowcaster/shot" );
00330                 cgs.effects.bowcasterImpactEffect       = trap_FX_RegisterEffect( "bowcaster/explosion" );
00331 
00332                 trap_FX_RegisterEffect( "bowcaster/deflect" );
00333 
00334                 cgs.media.greenFrontFlash = trap_R_RegisterShader( "gfx/effects/greenFrontFlash" );
00335                 break;
00336 
00337         case WP_REPEATER:
00338                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/repeater/select.wav");
00339 
00340                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/repeater/fire.wav");
00341                 weaponInfo->firingSound                 = NULL_SOUND;
00342                 weaponInfo->chargeSound                 = NULL_SOUND;
00343                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "repeater/muzzle_flash" );
00344                 weaponInfo->missileModel                = NULL_HANDLE;
00345                 weaponInfo->missileSound                = NULL_SOUND;
00346                 weaponInfo->missileDlight               = 0;
00347 //              weaponInfo->missileDlightColor  = {0,0,0};
00348                 weaponInfo->missileHitSound             = NULL_SOUND;
00349                 weaponInfo->missileTrailFunc    = FX_RepeaterProjectileThink;
00350 
00351                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/repeater/alt_fire.wav");
00352                 weaponInfo->altFiringSound              = NULL_SOUND;
00353                 weaponInfo->altChargeSound              = NULL_SOUND;
00354                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "repeater/muzzle_flash" );
00355                 weaponInfo->altMissileModel             = NULL_HANDLE;
00356                 weaponInfo->altMissileSound             = NULL_SOUND;
00357                 weaponInfo->altMissileDlight    = 0;
00358 //              weaponInfo->altMissileDlightColor= {0,0,0};
00359                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00360                 weaponInfo->altMissileTrailFunc = FX_RepeaterAltProjectileThink;
00361 
00362                 cgs.effects.repeaterProjectileEffect    = trap_FX_RegisterEffect( "repeater/projectile" );
00363                 cgs.effects.repeaterAltProjectileEffect = trap_FX_RegisterEffect( "repeater/alt_projectile" );
00364                 cgs.effects.repeaterWallImpactEffect    = trap_FX_RegisterEffect( "repeater/wall_impact" );
00365                 cgs.effects.repeaterFleshImpactEffect   = trap_FX_RegisterEffect( "repeater/flesh_impact" );
00366                 //cgs.effects.repeaterAltWallImpactEffect       = trap_FX_RegisterEffect( "repeater/alt_wall_impact" );
00367                 cgs.effects.repeaterAltWallImpactEffect = trap_FX_RegisterEffect( "repeater/concussion" );
00368                 break;
00369 
00370         case WP_DEMP2:
00371                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/demp2/select.wav");
00372 
00373                 weaponInfo->flashSound[0]               = trap_S_RegisterSound("sound/weapons/demp2/fire.wav");
00374                 weaponInfo->firingSound                 = NULL_SOUND;
00375                 weaponInfo->chargeSound                 = NULL_SOUND;
00376                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect("demp2/muzzle_flash");
00377                 weaponInfo->missileModel                = NULL_HANDLE;
00378                 weaponInfo->missileSound                = NULL_SOUND;
00379                 weaponInfo->missileDlight               = 0;
00380 //              weaponInfo->missileDlightColor  = {0,0,0};
00381                 weaponInfo->missileHitSound             = NULL_SOUND;
00382                 weaponInfo->missileTrailFunc    = FX_DEMP2_ProjectileThink;
00383 
00384                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound("sound/weapons/demp2/altfire.wav");
00385                 weaponInfo->altFiringSound              = NULL_SOUND;
00386                 weaponInfo->altChargeSound              = trap_S_RegisterSound("sound/weapons/demp2/altCharge.wav");
00387                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect("demp2/muzzle_flash");
00388                 weaponInfo->altMissileModel             = NULL_HANDLE;
00389                 weaponInfo->altMissileSound             = NULL_SOUND;
00390                 weaponInfo->altMissileDlight    = 0;
00391 //              weaponInfo->altMissileDlightColor= {0,0,0};
00392                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00393                 weaponInfo->altMissileTrailFunc = 0;
00394 
00395                 cgs.effects.demp2ProjectileEffect               = trap_FX_RegisterEffect( "demp2/projectile" );
00396                 cgs.effects.demp2WallImpactEffect               = trap_FX_RegisterEffect( "demp2/wall_impact" );
00397                 cgs.effects.demp2FleshImpactEffect              = trap_FX_RegisterEffect( "demp2/flesh_impact" );
00398 
00399                 cgs.media.demp2Shell = trap_R_RegisterModel( "models/items/sphere.md3" );
00400                 cgs.media.demp2ShellShader = trap_R_RegisterShader( "gfx/effects/demp2shell" );
00401 
00402                 cgs.media.lightningFlash = trap_R_RegisterShader("gfx/misc/lightningFlash");
00403                 break;
00404 
00405         case WP_FLECHETTE:
00406                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/flechette/select.wav");
00407 
00408                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/flechette/fire.wav");
00409                 weaponInfo->firingSound                 = NULL_SOUND;
00410                 weaponInfo->chargeSound                 = NULL_SOUND;
00411                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "flechette/muzzle_flash" );
00412                 weaponInfo->missileModel                = trap_R_RegisterModel("models/weapons2/golan_arms/projectileMain.md3");
00413                 weaponInfo->missileSound                = NULL_SOUND;
00414                 weaponInfo->missileDlight               = 0;
00415 //              weaponInfo->missileDlightColor  = {0,0,0};
00416                 weaponInfo->missileHitSound             = NULL_SOUND;
00417                 weaponInfo->missileTrailFunc    = FX_FlechetteProjectileThink;
00418 
00419                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/flechette/alt_fire.wav");
00420                 weaponInfo->altFiringSound              = NULL_SOUND;
00421                 weaponInfo->altChargeSound              = NULL_SOUND;
00422                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "flechette/muzzle_flash" );
00423                 weaponInfo->altMissileModel             = trap_R_RegisterModel( "models/weapons2/golan_arms/projectile.md3" );
00424                 weaponInfo->altMissileSound             = NULL_SOUND;
00425                 weaponInfo->altMissileDlight    = 0;
00426 //              weaponInfo->altMissileDlightColor= {0,0,0};
00427                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00428                 weaponInfo->altMissileTrailFunc = FX_FlechetteAltProjectileThink;
00429 
00430                 cgs.effects.flechetteShotEffect                 = trap_FX_RegisterEffect( "flechette/shot" );
00431                 cgs.effects.flechetteAltShotEffect              = trap_FX_RegisterEffect( "flechette/alt_shot" );
00432                 cgs.effects.flechetteWallImpactEffect   = trap_FX_RegisterEffect( "flechette/wall_impact" );
00433                 cgs.effects.flechetteFleshImpactEffect  = trap_FX_RegisterEffect( "flechette/flesh_impact" );
00434                 break;
00435 
00436         case WP_ROCKET_LAUNCHER:
00437                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/rocket/select.wav");
00438 
00439                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/rocket/fire.wav");
00440                 weaponInfo->firingSound                 = NULL_SOUND;
00441                 weaponInfo->chargeSound                 = NULL_SOUND;
00442                 weaponInfo->muzzleEffect                = trap_FX_RegisterEffect( "rocket/muzzle_flash" ); //trap_FX_RegisterEffect( "rocket/muzzle_flash2" );
00443                 //flash2 still looks crappy with the fx bolt stuff. Because the fx bolt stuff doesn't work entirely right.
00444                 weaponInfo->missileModel                = trap_R_RegisterModel( "models/weapons2/merr_sonn/projectile.md3" );
00445                 weaponInfo->missileSound                = trap_S_RegisterSound( "sound/weapons/rocket/missleloop.wav");
00446                 weaponInfo->missileDlight               = 125;
00447                 VectorSet(weaponInfo->missileDlightColor, 1.0, 1.0, 0.5);
00448                 weaponInfo->missileHitSound             = NULL_SOUND;
00449                 weaponInfo->missileTrailFunc    = FX_RocketProjectileThink;
00450 
00451                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/rocket/alt_fire.wav");
00452                 weaponInfo->altFiringSound              = NULL_SOUND;
00453                 weaponInfo->altChargeSound              = NULL_SOUND;
00454                 weaponInfo->altMuzzleEffect             = trap_FX_RegisterEffect( "rocket/altmuzzle_flash" );
00455                 weaponInfo->altMissileModel             = trap_R_RegisterModel( "models/weapons2/merr_sonn/projectile.md3" );
00456                 weaponInfo->altMissileSound             = trap_S_RegisterSound( "sound/weapons/rocket/missleloop.wav");
00457                 weaponInfo->altMissileDlight    = 125;
00458                 VectorSet(weaponInfo->altMissileDlightColor, 1.0, 1.0, 0.5);
00459                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00460                 weaponInfo->altMissileTrailFunc = FX_RocketAltProjectileThink;
00461 
00462                 cgs.effects.rocketShotEffect                    = trap_FX_RegisterEffect( "rocket/shot" );
00463                 cgs.effects.rocketExplosionEffect               = trap_FX_RegisterEffect( "rocket/explosion" );
00464         
00465                 trap_R_RegisterShaderNoMip( "gfx/2d/wedge" );
00466                 trap_R_RegisterShaderNoMip( "gfx/2d/lock" );
00467 
00468                 trap_S_RegisterSound( "sound/weapons/rocket/lock.wav" );
00469                 trap_S_RegisterSound( "sound/weapons/rocket/tick.wav" );
00470                 break;
00471 
00472         case WP_THERMAL:
00473                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/thermal/select.wav");
00474 
00475                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/thermal/fire.wav");
00476                 weaponInfo->firingSound                 = NULL_SOUND;
00477                 weaponInfo->chargeSound                 = trap_S_RegisterSound( "sound/weapons/thermal/charge.wav");
00478                 weaponInfo->muzzleEffect                = NULL_FX;
00479                 weaponInfo->missileModel                = trap_R_RegisterModel( "models/weapons2/thermal/thermal_proj.md3" );
00480                 weaponInfo->missileSound                = NULL_SOUND;
00481                 weaponInfo->missileDlight               = 0;
00482 //              weaponInfo->missileDlightColor  = {0,0,0};
00483                 weaponInfo->missileHitSound             = NULL_SOUND;
00484                 weaponInfo->missileTrailFunc    = 0;
00485 
00486                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/thermal/fire.wav");
00487                 weaponInfo->altFiringSound              = NULL_SOUND;
00488                 weaponInfo->altChargeSound              = trap_S_RegisterSound( "sound/weapons/thermal/charge.wav");
00489                 weaponInfo->altMuzzleEffect             = NULL_FX;
00490                 weaponInfo->altMissileModel             = trap_R_RegisterModel( "models/weapons2/thermal/thermal_proj.md3" );
00491                 weaponInfo->altMissileSound             = NULL_SOUND;
00492                 weaponInfo->altMissileDlight    = 0;
00493 //              weaponInfo->altMissileDlightColor= {0,0,0};
00494                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00495                 weaponInfo->altMissileTrailFunc = 0;
00496 
00497                 cgs.effects.thermalExplosionEffect              = trap_FX_RegisterEffect( "thermal/explosion" );
00498                 cgs.effects.thermalShockwaveEffect              = trap_FX_RegisterEffect( "thermal/shockwave" );
00499 
00500                 cgs.media.grenadeBounce1                = trap_S_RegisterSound( "sound/weapons/thermal/bounce1.wav" );
00501                 cgs.media.grenadeBounce2                = trap_S_RegisterSound( "sound/weapons/thermal/bounce2.wav" );
00502 
00503                 trap_S_RegisterSound( "sound/weapons/thermal/thermloop.wav" );
00504                 trap_S_RegisterSound( "sound/weapons/thermal/warning.wav" );
00505 
00506                 break;
00507 
00508         case WP_TRIP_MINE:
00509                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/detpack/select.wav");
00510 
00511                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/laser_trap/fire.wav");
00512                 weaponInfo->firingSound                 = NULL_SOUND;
00513                 weaponInfo->chargeSound                 = NULL_SOUND;
00514                 weaponInfo->muzzleEffect                = NULL_FX;
00515                 weaponInfo->missileModel                = 0;//trap_R_RegisterModel( "models/weapons2/laser_trap/laser_trap_w.md3" );
00516                 weaponInfo->missileSound                = NULL_SOUND;
00517                 weaponInfo->missileDlight               = 0;
00518 //              weaponInfo->missileDlightColor  = {0,0,0};
00519                 weaponInfo->missileHitSound             = NULL_SOUND;
00520                 weaponInfo->missileTrailFunc    = 0;
00521 
00522                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/laser_trap/fire.wav");
00523                 weaponInfo->altFiringSound              = NULL_SOUND;
00524                 weaponInfo->altChargeSound              = NULL_SOUND;
00525                 weaponInfo->altMuzzleEffect             = NULL_FX;
00526                 weaponInfo->altMissileModel             = 0;//trap_R_RegisterModel( "models/weapons2/laser_trap/laser_trap_w.md3" );
00527                 weaponInfo->altMissileSound             = NULL_SOUND;
00528                 weaponInfo->altMissileDlight    = 0;
00529 //              weaponInfo->altMissileDlightColor= {0,0,0};
00530                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00531                 weaponInfo->altMissileTrailFunc = 0;
00532 
00533                 cgs.effects.tripmineLaserFX = trap_FX_RegisterEffect("tripMine/laserMP.efx");
00534                 cgs.effects.tripmineGlowFX = trap_FX_RegisterEffect("tripMine/glowbit.efx");
00535 
00536                 trap_FX_RegisterEffect( "tripMine/explosion" );
00537                 // NOTENOTE temp stuff
00538                 trap_S_RegisterSound( "sound/weapons/laser_trap/stick.wav" );
00539                 trap_S_RegisterSound( "sound/weapons/laser_trap/warning.wav" );
00540                 break;
00541 
00542         case WP_DET_PACK:
00543                 weaponInfo->selectSound                 = trap_S_RegisterSound("sound/weapons/detpack/select.wav");
00544 
00545                 weaponInfo->flashSound[0]               = trap_S_RegisterSound( "sound/weapons/detpack/fire.wav");
00546                 weaponInfo->firingSound                 = NULL_SOUND;
00547                 weaponInfo->chargeSound                 = NULL_SOUND;
00548                 weaponInfo->muzzleEffect                = NULL_FX;
00549                 weaponInfo->missileModel                = trap_R_RegisterModel( "models/weapons2/detpack/det_pack.md3" );
00550                 weaponInfo->missileSound                = NULL_SOUND;
00551                 weaponInfo->missileDlight               = 0;
00552 //              weaponInfo->missileDlightColor  = {0,0,0};
00553                 weaponInfo->missileHitSound             = NULL_SOUND;
00554                 weaponInfo->missileTrailFunc    = 0;
00555 
00556                 weaponInfo->altFlashSound[0]    = trap_S_RegisterSound( "sound/weapons/detpack/fire.wav");
00557                 weaponInfo->altFiringSound              = NULL_SOUND;
00558                 weaponInfo->altChargeSound              = NULL_SOUND;
00559                 weaponInfo->altMuzzleEffect             = NULL_FX;
00560                 weaponInfo->altMissileModel             = trap_R_RegisterModel( "models/weapons2/detpack/det_pack.md3" );
00561                 weaponInfo->altMissileSound             = NULL_SOUND;
00562                 weaponInfo->altMissileDlight    = 0;
00563 //              weaponInfo->altMissileDlightColor= {0,0,0};
00564                 weaponInfo->altMissileHitSound  = NULL_SOUND;
00565                 weaponInfo->altMissileTrailFunc = 0;
00566 
00567                 trap_R_RegisterModel( "models/weapons2/detpack/det_pack.md3" );
00568                 trap_S_RegisterSound( "sound/weapons/detpack/stick.wav" );
00569                 trap_S_RegisterSound( "sound/weapons/detpack/warning.wav" );
00570                 trap_S_RegisterSound( "sound/weapons/explosions/explode5.wav" );
00571                 break;
00572         case WP_TURRET:
00573                 weaponInfo->flashSound[0]               = NULL_SOUND;
00574                 weaponInfo->firingSound                 = NULL_SOUND;
00575                 weaponInfo->chargeSound                 = NULL_SOUND;
00576                 weaponInfo->muzzleEffect                = NULL_HANDLE;
00577                 weaponInfo->missileModel                = NULL_HANDLE;
00578                 weaponInfo->missileSound                = NULL_SOUND;
00579                 weaponInfo->missileDlight               = 0;
00580                 weaponInfo->missileHitSound             = NULL_SOUND;
00581                 weaponInfo->missileTrailFunc    = FX_TurretProjectileThink;
00582 
00583                 trap_FX_RegisterEffect("effects/blaster/wall_impact.efx");
00584                 trap_FX_RegisterEffect("effects/blaster/flesh_impact.efx");
00585                 break;
00586 
00587          default:
00588                 MAKERGB( weaponInfo->flashDlightColor, 1, 1, 1 );
00589                 weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav" );
00590                 break;
00591         }
00592 }