diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_draw.c | 15 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 3 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 417 | ||||
-rw-r--r-- | src/game/bg_misc.c | 141 | ||||
-rw-r--r-- | src/game/bg_public.h | 5 | ||||
-rw-r--r-- | src/game/tremulous.h | 4 |
7 files changed, 274 insertions, 321 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 370e55b9..fecbfd70 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2510,10 +2510,11 @@ CG_DrawCrosshair */ static void CG_DrawCrosshair( void ) { - float w, h; - qhandle_t hShader; - float f; - float x, y; + float w, h; + qhandle_t hShader; + float f; + float x, y; + weaponInfo_t *wi; if( !cg_drawCrosshair.integer ) return; @@ -2526,13 +2527,15 @@ static void CG_DrawCrosshair( void ) if( cg.renderingThirdPerson ) return; - w = h = BG_FindCrosshairSizeForWeapon( cg.snap->ps.weapon ); + wi = &cg_weapons[ cg.snap->ps.weapon ]; + + w = h = wi->crossHairSize; x = cg_crosshairX.integer; y = cg_crosshairY.integer; CG_AdjustFrom640( &x, &y, &w, &h ); - hShader = cgs.media.crosshairShader[ cg.snap->ps.weapon ]; + hShader = wi->crossHair; if( hShader != 0 ) { diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 05783824..e1488cba 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -436,7 +436,8 @@ typedef struct weaponInfo_s qhandle_t weaponIcon; qhandle_t ammoIcon; - qhandle_t ammoModel; + qhandle_t crossHair; + int crossHairSize; qhandle_t missileModel; sfxHandle_t missileSound; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 474f18fa..13cd3b96 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -715,14 +715,6 @@ static void CG_RegisterGraphics( void ) cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" ); cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" ); - for( i = WP_NONE + 1 ; i < WP_NUM_WEAPONS ; i++ ) - { - char *crosshair = BG_FindCrosshairForWeapon( i ); - - if( crosshair != NULL ) - cgs.media.crosshairShader[ i ] = trap_R_RegisterShader( crosshair ); - } - cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" ); cgs.media.noammoShader = trap_R_RegisterShader( "icons/noammo" ); cgs.media.friendShader = trap_R_RegisterShader( "sprites/foe" ); @@ -1682,8 +1674,10 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) CG_RegisterGraphics( ); CG_UpdateMediaFraction( 0.90f ); + CG_InitWeapons( ); CG_UpdateMediaFraction( 0.95f ); + CG_InitUpgrades( ); CG_UpdateMediaFraction( 1.0f ); diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index d4b458ec..f592d583 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -147,6 +147,7 @@ void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum ) VectorCopy( end, re->oldorigin ); } + /* ================= CG_RegisterUpgrade @@ -199,16 +200,258 @@ void CG_InitUpgrades( void ) } /* +====================== +CG_ParseWeaponFile + +Parses a configuration file describing a weapon +====================== +*/ +static qboolean CG_ParseWeaponFile( const char *filename, weaponInfo_t *wi ) +{ + char *text_p; + int i; + int len; + char *token; + char text[ 20000 ]; + fileHandle_t f; + + // load the file + len = trap_FS_FOpenFile( filename, &f, FS_READ ); + if( len <= 0 ) + return qfalse; + + if( len >= sizeof( text ) - 1 ) + { + CG_Printf( "File %s too long\n", filename ); + return qfalse; + } + + trap_FS_Read( text, len, f ); + text[ len ] = 0; + trap_FS_FCloseFile( f ); + + // parse the text + text_p = text; + + // read optional parameters + while( 1 ) + { + token = COM_Parse( &text_p ); + + if( !token ) + break; + + if( !Q_stricmp( token, "" ) ) + return; + + if( !Q_stricmp( token, "weaponModel" ) ) + { + char path[ MAX_QPATH ]; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->weaponModel = trap_R_RegisterModel( token ); + + if( !wi->weaponModel ) + CG_Printf( "Weapon model not found %s: %s\n", filename, token ); + + strcpy( path, token ); + COM_StripExtension( path, path ); + strcat( path, "_flash.md3" ); + wi->flashModel = trap_R_RegisterModel( path ); + + strcpy( path, token ); + COM_StripExtension( path, path ); + strcat( path, "_barrel.md3" ); + wi->barrelModel = trap_R_RegisterModel( path ); + + strcpy( path, token ); + COM_StripExtension( path, path ); + strcat( path, "_hand.md3" ); + wi->handsModel = trap_R_RegisterModel( path ); + + if( !wi->handsModel ) + wi->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" ); + + continue; + } + else if( !Q_stricmp( token, "missileModel" ) ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->missileModel = trap_R_RegisterModel( token ); + + if( !wi->missileModel ) + CG_Printf( "Missile model not found %s: %s\n", filename, token ); + + continue; + } + else if( !Q_stricmp( token, "flashDLightColor" ) ) + { + for( i = 0 ; i < 3 ; i++ ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->flashDlightColor[ i ] = atof( token ); + } + + continue; + } + else if( !Q_stricmp( token, "missileDlightColor" ) ) + { + for( i = 0 ; i < 3 ; i++ ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->missileDlightColor[ i ] = atof( token ); + } + + continue; + } + else if( !Q_stricmp( token, "missileDlight" ) ) + { + int size = 0; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + size = atoi( token ); + + if( size < 0 ) + size = 0; + + wi->missileDlight = size; + + continue; + } + else if( !Q_stricmp( token, "idleSound" ) ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->readySound = trap_S_RegisterSound( token, qfalse ); + + if( !wi->readySound ) + CG_Printf( "Weapon idle sound not found %s: %s\n", filename, token ); + + continue; + } + else if( !Q_stricmp( token, "firingSound" ) ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->firingSound = trap_S_RegisterSound( token, qfalse ); + + if( !wi->firingSound ) + CG_Printf( "Weapon firing sound not found %s: %s\n", filename, token ); + + continue; + } + else if( !Q_stricmp( token, "missileSound" ) ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->missileSound = trap_S_RegisterSound( token, qfalse ); + + if( !wi->missileSound ) + CG_Printf( "Weapon missile sound not found %s: %s\n", filename, token ); + + continue; + } + else if( !Q_stricmp( token, "flashSound" ) ) + { + int index = 0; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + index = atoi( token ); + + if( index < 0 ) + index = 0; + else if( index > 3 ) + index = 3; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->flashSound[ index ] = trap_S_RegisterSound( token, qfalse ); + + if( !wi->flashSound[ index ] ) + CG_Printf( "Weapon flash sound %d not found %s: %s\n", index, filename, token ); + + continue; + } + else if( !Q_stricmp( token, "icon" ) ) + { + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->weaponIcon = wi->ammoIcon = trap_R_RegisterShader( token ); + + if( !wi->weaponIcon ) + CG_Printf( "Weapon icon shader not found %s: %s\n", filename, token ); + + continue; + } + else if( !Q_stricmp( token, "crosshair" ) ) + { + int size = 0; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + size = atoi( token ); + + if( size < 0 ) + size = 0; + + token = COM_Parse( &text_p ); + if( !token ) + break; + + wi->crossHair = trap_R_RegisterShader( token ); + wi->crossHairSize = size; + + if( !wi->crossHair ) + CG_Printf( "Weapon crosshair not found %s: %s\n", filename, token ); + + continue; + } + + Com_Printf( "unknown token '%s' in %s\n", token, filename ); + } + + return qtrue; +} + +/* ================= CG_RegisterWeapon - -The server says this item is used on this level ================= */ void CG_RegisterWeapon( int weaponNum ) { weaponInfo_t *weaponInfo; - char path[MAX_QPATH]; + char path[ MAX_QPATH ]; vec3_t mins, maxs; int i; char *icon, *model; @@ -227,175 +470,24 @@ void CG_RegisterWeapon( int weaponNum ) if( !BG_FindNameForWeapon( weaponNum ) ) CG_Error( "Couldn't find weapon %i", weaponNum ); + Com_sprintf( path, MAX_QPATH, "models/weapons/%s/weapon.cfg", BG_FindNameForWeapon( weaponNum ) ); + weaponInfo->humanName = BG_FindHumanNameForWeapon( weaponNum ); - // load cmodel before model so filecache works - if( model = BG_FindModelsForWeapon( weaponNum, 0 ) ) - weaponInfo->weaponModel = trap_R_RegisterModel( model ); - + CG_ParseWeaponFile( path, weaponInfo ); + // calc midpoint for rotation trap_R_ModelBounds( weaponInfo->weaponModel, mins, maxs ); for( i = 0 ; i < 3 ; i++ ) weaponInfo->weaponMidpoint[ i ] = mins[ i ] + 0.5 * ( maxs[ i ] - mins[ i ] ); - if( icon = BG_FindIconForWeapon( weaponNum ) ) - { - weaponInfo->weaponIcon = trap_R_RegisterShader( icon ); - weaponInfo->ammoIcon = trap_R_RegisterShader( icon ); - } - - strcpy( path, model ); - COM_StripExtension( path, path ); - strcat( path, "_flash.md3" ); - weaponInfo->flashModel = trap_R_RegisterModel( path ); - - strcpy( path, model ); - COM_StripExtension( path, path ); - strcat( path, "_barrel.md3" ); - weaponInfo->barrelModel = trap_R_RegisterModel( path ); - - strcpy( path, model ); - COM_StripExtension( path, path ); - strcat( path, "_hand.md3" ); - weaponInfo->handsModel = trap_R_RegisterModel( path ); - - if( !weaponInfo->handsModel ) - weaponInfo->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" ); - weaponInfo->loopFireSound = qfalse; switch( weaponNum ) { - case WP_TESLAGEN: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/lightning/lg_hum.wav", qfalse ); - - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); - cgs.media.lightningExplosionModel = trap_R_RegisterModel( "models/weaphits/crackle.md3" ); - cgs.media.sfx_lghit = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - break; - - case WP_AREA_ZAP: - case WP_DIRECT_ZAP: - MAKERGB( weaponInfo->flashDlightColor, 0.0f, 0.0f, 0.0f ); - - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); - cgs.media.sfx_lghit = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); - break; - case WP_MACHINEGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[ 1 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[ 2 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[ 3 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); - weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; - cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); - break; - - case WP_MASS_DRIVER: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 1 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[ 1 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[ 2 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[ 3 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); - break; - case WP_CHAINGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf1b.wav", qfalse ); - weaponInfo->flashSound[ 1 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf2b.wav", qfalse ); - weaponInfo->flashSound[ 2 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf3b.wav", qfalse ); - weaponInfo->flashSound[ 3 ] = trap_S_RegisterSound( "sound/weapons/machinegun/machgf4b.wav", qfalse ); weaponInfo->ejectBrassFunc = CG_MachineGunEjectBrass; - cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); - break; - - case WP_LOCKBLOB_LAUNCHER: - /* weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); - weaponInfo->missileTrailFunc = CG_RocketTrail; - weaponInfo->missileDlight = 200; - weaponInfo->wiTrailTime = 2000; - weaponInfo->trailRadius = 64; - MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.75f, 0 );*/ - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/ - break; - - case WP_FLAMER: - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/flamer/fireloop.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.25f, 0.1f, 0 ); - MAKERGB( weaponInfo->missileDlightColor, 0.25f, 0.1f, 0 ); - weaponInfo->missileDlight = 200; - //weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ - break; - - case WP_PULSE_RIFLE: - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); - cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); - break; - - case WP_LAS_GUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/plasma/hyprbf1a.wav", qfalse ); - cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); - break; - - case WP_LUCIFER_CANON: - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/bfg/bfg_hum.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.7f, 1 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/bfg/bfg_fire.wav", qfalse ); - cgs.media.bfgExplosionShader = trap_R_RegisterShader( "bfgExplosion" ); - weaponInfo->missileModel = trap_R_RegisterModel( "models/weaphits/bfg.md3" ); - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/rocket/rockfly.wav", qfalse ); - break; - - case WP_VENOM: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - case WP_PAIN_SAW: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - case WP_GRAB_CLAW: - case WP_GRAB_CLAW_UPG: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - case WP_POUNCE: - case WP_POUNCE_UPG: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" ); - break; - - case WP_GROUND_POUND: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - case WP_ABUILD: - case WP_ABUILD2: - case WP_HBUILD: - case WP_HBUILD2: - //nowt - break; - - default: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 1 ); - weaponInfo->flashSound[ 0 ] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); break; } } @@ -415,6 +507,15 @@ void CG_InitWeapons( void ) for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) CG_RegisterWeapon( i ); + + cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); + cgs.media.lightningExplosionModel = trap_R_RegisterModel( "models/weaphits/crackle.md3" ); + cgs.media.sfx_lghit = trap_S_RegisterSound( "sound/weapons/lightning/lg_fire.wav", qfalse ); + cgs.media.lightningShader = trap_R_RegisterShader( "models/ammo/tesla/tesla_bolt"); + cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); + cgs.media.plasmaExplosionShader = trap_R_RegisterShader( "plasmaExplosion" ); + cgs.media.bulletExplosionShader = trap_R_RegisterShader( "bulletExplosion" ); + cgs.media.bfgExplosionShader = trap_R_RegisterShader( "bfgExplosion" ); } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index ed0f56ac..c38015a9 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2058,9 +2058,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "rifle", //char *weaponName; "Rifle", //char *weaponHumanName; - { "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 }, - "icons/iconw_rifle", - "gfx/2d/crosshaira", 24, RIFLE_CLIPSIZE, //int quan; RIFLE_SPAWNCLIPS, //int clips; RIFLE_MAXCLIPS, //int maxClips; @@ -2083,9 +2080,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "flamer", //char *weaponName; "Flame Thrower", //char *weaponHumanName; - { "models/weapons2/plasma/plasma.md3", 0, 0, 0 }, - "icons/iconw_flamer", - "gfx/2d/crosshaira", 24, FLAMER_GAS, //int quan; 0, //int clips; 0, //int maxClips; @@ -2108,9 +2102,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "chaingun", //char *weaponName; "Chaingun", //char *weaponHumanName; - { "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 }, - "icons/iconw_chaingun", - "gfx/2d/crosshairb", 48, CHAINGUN_BULLETS, //int quan; 0, //int clips; 0, //int maxClips; @@ -2133,9 +2124,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "mdriver", //char *weaponName; "Mass Driver", //char *weaponHumanName; - { "models/weapons2/bfg/bfg.md3", 0, 0, 0 }, - "icons/iconw_driver", - "gfx/2d/crosshaira", 24, MDRIVER_CLIPSIZE, //int quan; MDRIVER_SPAWNCLIPS, //int clips; MDRIVER_MAXCLIPS, //int maxClips; @@ -2158,9 +2146,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "prifle", //char *weaponName; "Pulse Rifle", //char *weaponHumanName; - { "models/weapons2/prifle/prifle.md3", 0, 0, 0 }, - "icons/iconw_pulse", - "gfx/2d/crosshaira", 24, PRIFLE_CLIPS, //int quan; PRIFLE_SPAWNCLIPS, //int clips; PRIFLE_MAXCLIPS, //int maxClips; @@ -2183,9 +2168,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lcanon", //char *weaponName; "Lucifer Canon", //char *weaponHumanName; - { "models/weapons2/bfg/bfg.md3", 0, 0, 0 }, - "icons/iconw_lucifer", - "gfx/2d/crosshaira", 24, LCANON_AMMO, //int quan; 0, //int clips; 0, //int maxClips; @@ -2208,9 +2190,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lgun", //char *weaponName; "Las Gun", //char *weaponHumanName; - { "models/weapons2/grenadel/grenadel.md3", 0, 0, 0 }, - "icons/iconw_lasgun", - "gfx/2d/crosshaira", 24, LASGUN_AMMO, //int quan; 0, //int clips; 0, //int maxClips; @@ -2233,9 +2212,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "psaw", //char *weaponName; "Pain Saw", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_saw", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2258,9 +2234,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "ckit", //char *weaponName; "Construction Kit", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_construct", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2283,9 +2256,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "ackit", //char *weaponName; "Adv Construction Kit",//char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_construct", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2308,9 +2278,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "abuild", //char *weaponName; "Alien build weapon", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2333,9 +2300,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "abuild2", //char *weaponName; "Alien build weapon2",//char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2358,9 +2322,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "venom", //char *weaponName; "Venom", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2383,9 +2344,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "pounce", //char *weaponName; "Claw and pounce", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2408,9 +2366,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "pounce_upgrade", //char *weaponName; "Claw and pounce (upgrade)", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 3, //int quan; 0, //int clips; 0, //int maxClips; @@ -2433,9 +2388,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "grabandclaw", //char *weaponName; "Claws", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2458,9 +2410,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "grabandclaw_upgrade",//char *weaponName; "Claws Upgrade", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2483,9 +2432,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "areazap", //char *weaponName; "Area Zap", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2508,9 +2454,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "directzap", //char *weaponName; "Directed Zap", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2533,9 +2476,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "groundpound", //char *weaponName; "Ground Pound", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2558,9 +2498,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "lockblob", //char *weaponName; "Lock Blob", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2583,9 +2520,6 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "teslagen", //char *weaponName; "Tesla Generator", //char *weaponHumanName; - { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, - "icons/iconw_gauntlet", - NULL, 0, 0, //int quan; 0, //int clips; 0, //int maxClips; @@ -2727,81 +2661,6 @@ char *BG_FindHumanNameForWeapon( int weapon ) /* ============== -BG_FindModelsForWeapon -============== -*/ -char *BG_FindModelsForWeapon( int weapon, int modelNum ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - return bg_weapons[ i ].models[ modelNum ]; - } - - //wimp out - return 0; -} - -/* -============== -BG_FindIconForWeapon -============== -*/ -char *BG_FindIconForWeapon( int weapon ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - return bg_weapons[ i ].icon; - } - - //wimp out - return 0; -} - -/* -============== -BG_FindCrosshairForWeapon -============== -*/ -char *BG_FindCrosshairForWeapon( int weapon ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - return bg_weapons[ i ].crosshair; - } - - //wimp out - return 0; -} - -/* -============== -BG_FindCrosshairSizeForWeapon -============== -*/ -int BG_FindCrosshairSizeForWeapon( int weapon ) -{ - int i; - - for( i = 0; i < bg_numWeapons; i++ ) - { - if( bg_weapons[ i ].weaponNum == weapon ) - return bg_weapons[ i ].crosshairSize; - } - - return 24; -} - -/* -============== BG_FindAmmoForWeapon ============== */ diff --git a/src/game/bg_public.h b/src/game/bg_public.h index e14e1448..a61f9ef7 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -957,11 +957,6 @@ typedef struct char *weaponName; char *weaponHumanName; - char *models[ MAX_ITEM_MODELS ]; - char *icon; - char *crosshair; - int crosshairSize; - int quan; int clips; int maxClips; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index f97e865c..deb419c9 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -410,12 +410,12 @@ #define MGTURRET_BP 80 #define MGTURRET_HEALTH HBHM(100) #define MGTURRET_SPLASHDAMAGE 50 -#define MGTURRET_SPLASHRADIUS 1000 +#define MGTURRET_SPLASHRADIUS 100 #define MGTURRET_ANGULARSPEED 5 //degrees/think ~= 200deg/sec #define MGTURRET_ACCURACYTOLERANCE MGTURRET_ANGULARSPEED / 2 //angular difference for turret to fire #define MGTURRET_VERTICALCAP 30 // +/- maximum pitch #define MGTURRET_REPEAT 100 -#define MGTURRET_RANGE 200 +#define MGTURRET_RANGE 250 #define TESLAGEN_BP 100 #define TESLAGEN_HEALTH HBHM(200) |