diff options
author | Tim Angus <tim@ngus.net> | 2001-12-30 02:20:36 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-12-30 02:20:36 +0000 |
commit | 969f12211fb141c6e7b68c662294002a177dc386 (patch) | |
tree | 81a5775900668b9147621e8405c9cd993a048a9e | |
parent | 8b42b0ff0714ff211801a7c7ec57197c1576884f (diff) |
bg_itemlist is dead. Yay
-rw-r--r-- | src/cgame/cg_buildable.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 17 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 149 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 53 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 7 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 55 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_predict.c | 14 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 469 | ||||
-rw-r--r-- | src/game/bg_misc.c | 1429 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 71 | ||||
-rw-r--r-- | src/game/bg_public.h | 99 | ||||
-rw-r--r-- | src/game/g_active.c | 10 | ||||
-rw-r--r-- | src/game/g_cmds.c | 9 | ||||
-rw-r--r-- | src/game/g_combat.c | 7 | ||||
-rw-r--r-- | src/game/g_misc.c | 6 | ||||
-rw-r--r-- | src/game/g_missile.c | 8 | ||||
-rw-r--r-- | src/game/g_weapon.c | 56 | ||||
-rw-r--r-- | src/ui/ui_main.c | 2 | ||||
-rw-r--r-- | src/ui/ui_players.c | 49 |
20 files changed, 589 insertions, 1933 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index b61735a7..03123e3c 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -390,8 +390,6 @@ void CG_Buildable( centity_t *cent ) trace_t tr; es = ¢->currentState; - if ( es->modelindex >= bg_numItems ) - CG_Error( "Bad item index %i on entity", es->modelindex ); //add creep if( es->modelindex2 == BIT_ALIENS ) diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 5acb96d8..e0c8d768 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -216,9 +216,9 @@ void CG_DrawFlagModel( float x, float y, float w, float h, int team, qboolean fo team == TEAM_HUMANS ? cgs.media.redFlagModel : cgs.media.blueFlagModel, 0, origin, angles ); } else if ( cg_drawIcons.integer ) { - gitem_t *item = BG_FindItemForPowerup( team == TEAM_HUMANS ? PW_REDFLAG : PW_BLUEFLAG ); +/* gitem_t *item = BG_FindItemForPowerup( team == TEAM_HUMANS ? PW_REDFLAG : PW_BLUEFLAG ); - CG_DrawPic( x, y, w, h, cg_items[ ITEM_INDEX(item) ].icon ); + CG_DrawPic( x, y, w, h, cg_items[ ITEM_INDEX(item) ].icon );*/ } } @@ -451,7 +451,7 @@ static void CG_DrawStatusBar( void ) { // if ( cent->currentState.weapon ) { //TA: must mask off clips and maxClips - if( !BG_infiniteAmmo( cent->currentState.weapon ) ) + if( !BG_FindInfinteAmmoForWeapon( cent->currentState.weapon ) ) BG_unpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &ammo, &clips, &maxclips ); else ammo = -1; @@ -1088,7 +1088,7 @@ static float CG_DrawScores( float y ) { if ( cgs.gametype == GT_CTF ) { // Display flag status - item = BG_FindItemForPowerup( PW_BLUEFLAG ); + /*item = BG_FindItemForPowerup( PW_BLUEFLAG );*/ if (item) { y1 = y - BIGCHAR_HEIGHT - 8; @@ -1113,7 +1113,7 @@ static float CG_DrawScores( float y ) { if ( cgs.gametype == GT_CTF ) { // Display flag status - item = BG_FindItemForPowerup( PW_REDFLAG ); + /*item = BG_FindItemForPowerup( PW_REDFLAG );*/ if (item) { y1 = y - BIGCHAR_HEIGHT - 8; @@ -1263,7 +1263,7 @@ static float CG_DrawPowerups( float y ) { // draw the icons and timers x = 640 - ICON_SIZE - CHAR_WIDTH * 2; for ( i = 0 ; i < active ; i++ ) { - item = BG_FindItemForPowerup( sorted[i] ); + /*item = BG_FindItemForPowerup( sorted[i] );*/ if (item) { @@ -1343,10 +1343,11 @@ static int CG_DrawPickupItem( int y ) { if ( value ) { fadeColor = CG_FadeColor( cg.itemPickupTime, 3000 ); if ( fadeColor ) { - CG_RegisterItemVisuals( value ); + /*CG_RegisterItemVisuals( value );*/ trap_R_SetColor( fadeColor ); CG_DrawPic( 8, y, ICON_SIZE, ICON_SIZE, cg_items[ value ].icon ); - CG_DrawBigString( ICON_SIZE + 16, y + (ICON_SIZE/2 - BIGCHAR_HEIGHT/2), bg_itemlist[ value ].pickup_name, fadeColor[0] ); + //TA: BG_FindHumanNameForWeapon is probably highly inappropriate here, but this will probably never get called + CG_DrawBigString( ICON_SIZE + 16, y + (ICON_SIZE/2 - BIGCHAR_HEIGHT/2), BG_FindHumanNameForWeapon( value ), fadeColor[0] ); trap_R_SetColor( NULL ); } } diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index a2f5a2b0..a7e95e1c 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -212,152 +212,6 @@ static void CG_Speaker( centity_t *cent ) { cent->miscTime = cg.time + cent->currentState.frame * 100 + cent->currentState.clientNum * 100 * crandom(); } -/* -================== -CG_Item -================== -*/ -static void CG_Item( centity_t *cent ) { - refEntity_t ent; - entityState_t *es; - gitem_t *item; - int msec; - float frac; - float scale; - weaponInfo_t *wi; - - - es = ¢->currentState; - if ( es->modelindex >= bg_numItems ) { - CG_Error( "Bad item index %i on entity", es->modelindex ); - } - - // if set to invisible, skip - if ( !es->modelindex || ( es->eFlags & EF_NODRAW ) ) { - return; - } - - item = &bg_itemlist[ es->modelindex ]; - if ( cg_simpleItems.integer && item->giType != IT_TEAM ) { - memset( &ent, 0, sizeof( ent ) ); - ent.reType = RT_SPRITE; - VectorCopy( cent->lerpOrigin, ent.origin ); - ent.radius = 14; - ent.customShader = cg_items[es->modelindex].icon; - ent.shaderRGBA[0] = 255; - ent.shaderRGBA[1] = 255; - ent.shaderRGBA[2] = 255; - ent.shaderRGBA[3] = 255; - trap_R_AddRefEntityToScene(&ent); - return; - } - - // items bob up and down continuously - scale = 0.005 + cent->currentState.number * 0.00001; - cent->lerpOrigin[2] += 4 + cos( ( cg.time + 1000 ) * scale ) * 4; - - memset (&ent, 0, sizeof(ent)); - - // autorotate at one of two speeds - if ( item->giType == IT_HEALTH ) { - VectorCopy( cg.autoAnglesFast, cent->lerpAngles ); - AxisCopy( cg.autoAxisFast, ent.axis ); - } else { - VectorCopy( cg.autoAngles, cent->lerpAngles ); - AxisCopy( cg.autoAxis, ent.axis ); - } - - // the weapons have their origin where they attatch to player - // models, so we need to offset them or they will rotate - // eccentricly - wi = NULL; - if ( item->giType == IT_WEAPON ) { - - wi = &cg_weapons[item->giTag]; - cent->lerpOrigin[0] -= - wi->weaponMidpoint[0] * ent.axis[0][0] + - wi->weaponMidpoint[1] * ent.axis[1][0] + - wi->weaponMidpoint[2] * ent.axis[2][0]; - cent->lerpOrigin[1] -= - wi->weaponMidpoint[0] * ent.axis[0][1] + - wi->weaponMidpoint[1] * ent.axis[1][1] + - wi->weaponMidpoint[2] * ent.axis[2][1]; - cent->lerpOrigin[2] -= - wi->weaponMidpoint[0] * ent.axis[0][2] + - wi->weaponMidpoint[1] * ent.axis[1][2] + - wi->weaponMidpoint[2] * ent.axis[2][2]; - - cent->lerpOrigin[2] += 8; // an extra height boost - } - - ent.hModel = cg_items[es->modelindex].models[0]; - - VectorCopy( cent->lerpOrigin, ent.origin); - VectorCopy( cent->lerpOrigin, ent.oldorigin); - - ent.nonNormalizedAxes = qfalse; - - // if just respawned, slowly scale up - msec = cg.time - cent->miscTime; - if ( msec >= 0 && msec < ITEM_SCALEUP_TIME ) { - frac = (float)msec / ITEM_SCALEUP_TIME; - VectorScale( ent.axis[0], frac, ent.axis[0] ); - VectorScale( ent.axis[1], frac, ent.axis[1] ); - VectorScale( ent.axis[2], frac, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } else { - frac = 1.0; - } - - // items without glow textures need to keep a minimum light value - // so they are always visible - if ( ( item->giType == IT_WEAPON ) || - ( item->giType == IT_ARMOR ) ) { - ent.renderfx |= RF_MINLIGHT; - } - - // increase the size of the weapons when they are presented as items - if ( item->giType == IT_WEAPON ) { - VectorScale( ent.axis[0], 1.5, ent.axis[0] ); - VectorScale( ent.axis[1], 1.5, ent.axis[1] ); - VectorScale( ent.axis[2], 1.5, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } - - // add to refresh list - trap_R_AddRefEntityToScene(&ent); - - // accompanying rings / spheres for powerups - if ( !cg_simpleItems.integer ) - { - vec3_t spinAngles; - - VectorClear( spinAngles ); - - if ( item->giType == IT_HEALTH || item->giType == IT_POWERUP ) - { - if ( ( ent.hModel = cg_items[es->modelindex].models[1] ) != 0 ) - { - if ( item->giType == IT_POWERUP ) - { - ent.origin[2] += 12; - spinAngles[1] = ( cg.time & 1023 ) * 360 / -1024.0f; - } - AnglesToAxis( spinAngles, ent.axis ); - - // scale up if respawning - if ( frac != 1.0 ) { - VectorScale( ent.axis[0], frac, ent.axis[0] ); - VectorScale( ent.axis[1], frac, ent.axis[1] ); - VectorScale( ent.axis[2], frac, ent.axis[2] ); - ent.nonNormalizedAxes = qtrue; - } - trap_R_AddRefEntityToScene( &ent ); - } - } - } -} - //============================================================================ @@ -968,9 +822,6 @@ static void CG_AddCEntity( centity_t *cent ) { case ET_PLAYER: CG_Player( cent ); break; - case ET_ITEM: - CG_Item( cent ); - break; case ET_BUILDABLE: CG_Buildable( cent ); break; diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index ec521b80..d5766621 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -321,7 +321,7 @@ static void CG_UseItem( centity_t *cent ) { if ( !itemNum ) { CG_CenterPrint( "No item to use", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); } else { - item = BG_FindItemForHoldable( itemNum ); + /*item = BG_FindItemForHoldable( itemNum );*/ CG_CenterPrint( va("Use %s", item->pickup_name), SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); } } @@ -359,13 +359,6 @@ static void CG_ItemPickup( int itemNum ) { cg.itemPickupTime = cg.time; cg.itemPickupBlendTime = cg.time; // see if it should be the grabbed weapon - if ( bg_itemlist[itemNum].giType == IT_WEAPON ) { - // select it immediately - if ( cg_autoswitch.integer && bg_itemlist[itemNum].giTag != WP_MACHINEGUN ) { - cg.weaponSelectTime = cg.time; - cg.weaponSelect = bg_itemlist[itemNum].giTag; - } - } } @@ -667,52 +660,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) case EV_ITEM_PICKUP: DEBUGNAME("EV_ITEM_PICKUP"); { - gitem_t *item; - int index; - - index = es->eventParm; // player predicted - - if ( index < 1 || index >= bg_numItems ) { - break; - } - item = &bg_itemlist[ index ]; - - // powerups and team items will have a separate global sound, this one - // will be played at prediction time - if ( item->giType == IT_POWERUP || item->giType == IT_TEAM) { - trap_S_StartSound (NULL, es->number, CHAN_AUTO, cgs.media.n_healthSound ); - } else { - trap_S_StartSound (NULL, es->number, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) ); - } - - // show icon and name on status bar - if ( es->number == cg.snap->ps.clientNum ) { - CG_ItemPickup( index ); - } } break; case EV_GLOBAL_ITEM_PICKUP: DEBUGNAME("EV_GLOBAL_ITEM_PICKUP"); { - gitem_t *item; - int index; - - index = es->eventParm; // player predicted - - if ( index < 1 || index >= bg_numItems ) { - break; - } - item = &bg_itemlist[ index ]; - // powerup pickups are global - if( item->pickup_sound ) { - trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( item->pickup_sound, qfalse ) ); - } - - // show icon and name on status bar - if ( es->number == cg.snap->ps.clientNum ) { - CG_ItemPickup( index ); - } } break; @@ -889,14 +842,14 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) break; case EV_RAILTRAIL: - DEBUGNAME("EV_RAILTRAIL"); +/* DEBUGNAME("EV_RAILTRAIL"); cent->currentState.weapon = WP_RAILGUN; // if the end was on a nomark surface, don't make an explosion CG_RailTrail( es->origin2, es->pos.trBase ); if ( es->eventParm != 255 ) { ByteToDir( es->eventParm, dir ); CG_MissileHitWall( es->weapon, es->clientNum, position, dir, IMPACTSOUND_DEFAULT ); - } + }*/ break; case EV_TESLATRAIL: diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 5b972aa8..514cc3c5 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -374,6 +374,7 @@ typedef struct { typedef struct weaponInfo_s { qboolean registered; gitem_t *item; + char *humanName; qhandle_t handsModel; // the hands don't actually draw, they just position the weapon qhandle_t weaponModel; @@ -410,7 +411,7 @@ typedef struct weaponInfo_s { typedef struct upgradeInfo_s { qboolean registered; - gitem_t *item; + char *humanName; qhandle_t upgradeIcon; } upgradeInfo_t; @@ -1411,8 +1412,10 @@ void CG_NextWeapon_f( void ); void CG_PrevWeapon_f( void ); void CG_Weapon_f( void ); +void CG_InitUpgrades( ); +void CG_RegisterUpgrade( int upgradeNum ); +void CG_InitWeapons( ); void CG_RegisterWeapon( int weaponNum ); -void CG_RegisterItemVisuals( int itemNum ); void CG_FireWeapon( centity_t *cent ); void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, impactSound_t soundType ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index c26564da..0052b426 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -474,44 +474,6 @@ The server says this item is used on this level ================= */ static void CG_RegisterItemSounds( int itemNum ) { - gitem_t *item; - char data[MAX_QPATH]; - char *s, *start; - int len; - - item = &bg_itemlist[ itemNum ]; - - if( item->pickup_sound ) { - trap_S_RegisterSound( item->pickup_sound, qfalse ); - } - - // parse the space seperated precache string for other media - s = item->sounds; - if (!s || !s[0]) - return; - - while (*s) { - start = s; - while (*s && *s != ' ') { - s++; - } - - len = s-start; - if (len >= MAX_QPATH || len < 5) { - CG_Error( "PrecacheItem: %s has bad precache string", - item->classname); - return; - } - memcpy (data, start, len); - data[len] = 0; - if ( *s ) { - s++; - } - - if ( !strcmp(data+len-3, "wav" )) { - trap_S_RegisterSound( data, qfalse ); - } - } } @@ -638,12 +600,6 @@ static void CG_RegisterSounds( void ) { // only register the items that the server says we need strcpy( items, CG_ConfigString( CS_ITEMS ) ); - for ( i = 1 ; i < bg_numItems ; i++ ) { - //if ( items[ i ] == '1' || cg_buildScript.integer ) { - CG_RegisterItemSounds( i ); - //} - } - for ( i = 1 ; i < MAX_SOUNDS ; i++ ) { soundName = CG_ConfigString( CS_SOUNDS+i ); if ( !soundName[0] ) { @@ -873,15 +829,6 @@ static void CG_RegisterGraphics( void ) { // only register the items that the server says we need strcpy( items, CG_ConfigString( CS_ITEMS) ); - for( i = 1; i < bg_numItems; i++ ) - { - if( items[ i ] == '1' || cg_buildScript.integer ) - { - CG_LoadingItem( i ); - CG_RegisterItemVisuals( i ); - } - } - // wall marks cgs.media.bulletMarkShader = trap_R_RegisterShader( "gfx/damage/bullet_mrk" ); cgs.media.burnMarkShader = trap_R_RegisterShader( "gfx/damage/burn_med_mrk" ); @@ -1107,6 +1054,8 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) { //TA: CG_InitBuildables( ); + CG_InitWeapons( ); + CG_InitUpgrades( ); CG_LoadingString( "clients" ); diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index 7573b471..e8a94a2e 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -43,11 +43,11 @@ void CG_CheckAmmo( void ) { BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); switch ( i ) { - case WP_ROCKET_LAUNCHER: + /*case WP_ROCKET_LAUNCHER:*/ case WP_LOCKBLOB_LAUNCHER: - case WP_GRENADE_LAUNCHER: - case WP_RAILGUN: - case WP_SHOTGUN: + /*case WP_GRENADE_LAUNCHER:*/ + /*case WP_RAILGUN:*/ + /*case WP_SHOTGUN:*/ total += ammo * 1000; break; default: @@ -56,7 +56,7 @@ void CG_CheckAmmo( void ) { total += ammo * 200; break; } - if ( total >= 5000 || BG_infiniteAmmo( i ) ) + if ( total >= 5000 || BG_FindInfinteAmmoForWeapon( i ) ) { cg.lowAmmoWarning = 0; return; diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index 3a2ae803..08e22518 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -285,20 +285,18 @@ static void CG_TouchItem( centity_t *cent ) { if ( !cg_predictItems.integer ) { return; } - if ( !BG_PlayerTouchesItem( &cg.predictedPlayerState, ¢->currentState, cg.time ) ) { +/* if ( !BG_PlayerTouchesItem( &cg.predictedPlayerState, ¢->currentState, cg.time ) ) { return; - } + }*/ // never pick an item up twice in a prediction if ( cent->miscTime == cg.time ) { return; } - if ( !BG_CanItemBeGrabbed( cgs.gametype, ¢->currentState, &cg.predictedPlayerState ) ) { +/* if ( !BG_CanItemBeGrabbed( cgs.gametype, ¢->currentState, &cg.predictedPlayerState ) ) { return; // can't hold it - } - - item = &bg_itemlist[ cent->currentState.modelindex ]; + }*/ // grab it BG_AddPredictableEventToPlayerstate( EV_ITEM_PICKUP, cent->currentState.modelindex , &cg.predictedPlayerState); @@ -310,12 +308,12 @@ static void CG_TouchItem( centity_t *cent ) { cent->miscTime = cg.time; // if its a weapon, give them some predicted ammo so the autoswitch will work - if ( item->giType == IT_WEAPON ) { +/* if ( item->giType == IT_WEAPON ) { BG_packWeapon( item->giTag, cg.predictedPlayerState.stats ); if ( ammo == 0 && clips == 0 ) { BG_packAmmoArray( item->giTag, cg.predictedPlayerState.ammo, cg.predictedPlayerState.powerups, 1, 0, 0 ); } - } + }*/ } diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 8b832966..c14aba28 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -536,37 +536,48 @@ CG_RegisterUpgrade The server says this item is used on this level ================= */ -void CG_RegisterUpgrade( int upgradeNum ) { - upgradeInfo_t *upgradeInfo; - gitem_t *item; - char path[MAX_QPATH]; - int i; +void CG_RegisterUpgrade( int upgradeNum ) +{ + upgradeInfo_t *upgradeInfo; + char path[MAX_QPATH]; + int i; + char *icon; upgradeInfo = &cg_upgrades[ upgradeNum ]; - if ( upgradeNum == 0 ) { + if( upgradeNum == 0 ) return; - } - if ( upgradeInfo->registered ) { + if( upgradeInfo->registered ) return; - } memset( upgradeInfo, 0, sizeof( *upgradeInfo ) ); upgradeInfo->registered = qtrue; - for ( item = bg_itemlist + 1 ; item->classname ; item++ ) { - if ( item->giType == IT_UPGRADE && item->giTag == upgradeNum ) { - upgradeInfo->item = item; - break; - } - } - if ( !item->classname ) { + if( !BG_FindNameForUpgrade( upgradeNum ) ) CG_Error( "Couldn't find upgrade %i", upgradeNum ); - } - CG_RegisterItemVisuals( item - bg_itemlist ); + + upgradeInfo->humanName = BG_FindHumanNameForUpgrade( upgradeNum ); + + if( icon = BG_FindIconForUpgrade( upgradeNum ) ) + upgradeInfo->upgradeIcon = trap_R_RegisterShader( icon ); +} + +/* +=============== +CG_InitUpgrades + +Precaches upgrades +=============== +*/ +void CG_InitUpgrades( ) +{ + int i; + + memset( cg_upgrades, 0, sizeof( cg_upgrades ) ); - upgradeInfo->upgradeIcon = trap_R_RegisterShader( item->icon ); + for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) + CG_RegisterUpgrade( i ); } /* @@ -576,70 +587,56 @@ CG_RegisterWeapon The server says this item is used on this level ================= */ -void CG_RegisterWeapon( int weaponNum ) { +void CG_RegisterWeapon( int weaponNum ) +{ weaponInfo_t *weaponInfo; - gitem_t *item, *ammo; - char path[MAX_QPATH]; - vec3_t mins, maxs; - int i; + char path[MAX_QPATH]; + vec3_t mins, maxs; + int i; + char *icon, *model; - weaponInfo = &cg_weapons[weaponNum]; + weaponInfo = &cg_weapons[ weaponNum ]; - if ( weaponNum == 0 ) { + if( weaponNum == 0 ) return; - } - if ( weaponInfo->registered ) { + if( weaponInfo->registered ) return; - } memset( weaponInfo, 0, sizeof( *weaponInfo ) ); weaponInfo->registered = qtrue; - for ( item = bg_itemlist + 1 ; item->classname ; item++ ) { - if ( item->giType == IT_WEAPON && item->giTag == weaponNum ) { - weaponInfo->item = item; - break; - } - } - if ( !item->classname ) { + if( !BG_FindNameForWeapon( weaponNum ) ) CG_Error( "Couldn't find weapon %i", weaponNum ); - } - CG_RegisterItemVisuals( item - bg_itemlist ); + + weaponInfo->humanName = BG_FindHumanNameForWeapon( weaponNum ); // load cmodel before model so filecache works - if( item->world_model[ 0 ] ) - weaponInfo->weaponModel = trap_R_RegisterModel( item->world_model[0] ); + if( model = BG_FindModelsForWeapon( weaponNum, 0 ) ) + weaponInfo->weaponModel = trap_R_RegisterModel( model ); // calc midpoint for rotation trap_R_ModelBounds( weaponInfo->weaponModel, mins, maxs ); - for ( i = 0 ; i < 3 ; i++ ) { + for( i = 0 ; i < 3 ; i++ ) weaponInfo->weaponMidpoint[i] = mins[i] + 0.5 * ( maxs[i] - mins[i] ); - } - weaponInfo->weaponIcon = trap_R_RegisterShader( item->icon ); - weaponInfo->ammoIcon = trap_R_RegisterShader( item->icon ); - - for ( ammo = bg_itemlist + 1 ; ammo->classname ; ammo++ ) { - if ( ammo->giType == IT_AMMO && ammo->giTag == weaponNum ) { - break; - } - } - if ( ammo->classname && ammo->world_model[0] ) { - weaponInfo->ammoModel = trap_R_RegisterModel( ammo->world_model[0] ); + if( icon = BG_FindIconForWeapon( weaponNum ) ) + { + weaponInfo->weaponIcon = trap_R_RegisterShader( icon ); + weaponInfo->ammoIcon = trap_R_RegisterShader( icon ); } - - strcpy( path, item->world_model[0] ); + + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_flash.md3" ); weaponInfo->flashModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_barrel.md3" ); weaponInfo->barrelModel = trap_R_RegisterModel( path ); - strcpy( path, item->world_model[0] ); + strcpy( path, model ); COM_StripExtension( path, path ); strcat( path, "_hand.md3" ); weaponInfo->handsModel = trap_R_RegisterModel( path ); @@ -650,215 +647,128 @@ void CG_RegisterWeapon( int weaponNum ) { weaponInfo->loopFireSound = qfalse; - switch ( weaponNum ) { - case WP_GAUNTLET: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; - - 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_GRAPPLING_HOOK: - MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f ); - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" ); - weaponInfo->missileTrailFunc = CG_GrappleTrail; - weaponInfo->missileDlight = 200; - weaponInfo->wiTrailTime = 2000; - weaponInfo->trailRadius = 64; - MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 ); - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse ); - weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.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_SHOTGUN: - MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/shotgun/sshotf1b.wav", qfalse ); - weaponInfo->ejectBrassFunc = CG_ShotgunEjectBrass; - break; - - case WP_ROCKET_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" ); - 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->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" ); - break; + 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_LOCKBLOB_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/trapper/trapper.md3" ); -/* 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->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); - /*cgs.media.rocketExplosionShader = trap_R_RegisterShader( "rocketExplosion" );*/ - 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_GRENADE_LAUNCHER: - weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/grenade1.md3" ); - weaponInfo->missileTrailFunc = CG_GrenadeTrail; - weaponInfo->wiTrailTime = 700; - weaponInfo->trailRadius = 32; - MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/grenade/grenlf1a.wav", qfalse ); - cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" ); - 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_FLAMER: - weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 0.25, 0.1, 0 ); - //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ - break; - - case WP_PLASMAGUN: - weaponInfo->missileTrailFunc = CG_PlasmaTrail; - 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" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - 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->missileModel = trap_R_RegisterModel( "models/ammo/trapper/trapper.md3" ); + /* 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->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); + /*cgs.media.rocketExplosionShader = 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" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - break; + case WP_FLAMER: + weaponInfo->missileSound = trap_S_RegisterSound( "sound/weapons/plasma/lasfly.wav", qfalse ); + MAKERGB( weaponInfo->flashDlightColor, 0.25, 0.1, 0 ); + //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); + /*cgs.media.flameExplShader = trap_R_RegisterShader( "rocketExplosion" );*/ + break; + + case WP_PLASMAGUN: + weaponInfo->missileTrailFunc = CG_PlasmaTrail; + 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" ); + cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); + break; - case WP_RAILGUN: - weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/railgun/rg_hum.wav", qfalse ); - MAKERGB( weaponInfo->flashDlightColor, 1, 0.5f, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/railgun/railgf1a.wav", qfalse ); - cgs.media.railExplosionShader = trap_R_RegisterShader( "railExplosion" ); - cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); - cgs.media.railCoreShader = trap_R_RegisterShader( "railCore" ); - 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" ); + cgs.media.railRingsShader = trap_R_RegisterShader( "railDisc" ); + break; - case WP_BFG: - 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_VENOM: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); + break; - case WP_GRABANDCSAW: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; + case WP_GRABANDCSAW: + MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); + break; - case WP_POUNCE: - MAKERGB( weaponInfo->flashDlightColor, 0, 0, 0 ); - weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/melee/fstatck.wav", qfalse ); - break; + case WP_POUNCE: + 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; + 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; + default: + MAKERGB( weaponInfo->flashDlightColor, 1, 1, 1 ); + weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/rocket/rocklf1a.wav", qfalse ); + break; } } /* -================= -CG_RegisterItemVisuals +=============== +CG_InitWeapons -The server says this item is used on this level -================= +Precaches weapons +=============== */ -void CG_RegisterItemVisuals( int itemNum ) { - itemInfo_t *itemInfo; - gitem_t *item; - int i; - - if ( itemNum < 0 || itemNum >= bg_numItems ) { - CG_Error( "CG_RegisterItemVisuals: itemNum %d out of range [0-%d]", itemNum, bg_numItems-1 ); - } - - itemInfo = &cg_items[ itemNum ]; - if ( itemInfo->registered ) { - return; - } - - item = &bg_itemlist[ itemNum ]; - - memset( itemInfo, 0, sizeof( &itemInfo ) ); - itemInfo->registered = qtrue; - - itemInfo->icon = trap_R_RegisterShader( item->icon ); +void CG_InitWeapons( ) +{ + int i; - if ( item->giType == IT_WEAPON ) { - CG_RegisterWeapon( item->giTag ); - } - - for( i = 0; i < 4; i++ ) - { - if( item->world_model[ i ] ) - itemInfo->models[i] = trap_R_RegisterModel( item->world_model[i] ); - } + memset( cg_weapons, 0, sizeof( cg_weapons ) ); + for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ ) + CG_RegisterWeapon( i ); } @@ -1077,14 +987,14 @@ different than the muzzle point used for determining hits. */ static void CG_SpawnRailTrail( centity_t *cent, vec3_t origin ) { - if ( cent->currentState.weapon != WP_RAILGUN ) +/* if ( cent->currentState.weapon != WP_RAILGUN ) return; if ( !cent->pe.railgunFlash ) return; cent->pe.railgunFlash = qtrue; - CG_RailTrail( origin, cent->pe.railgunImpact ); + CG_RailTrail( origin, cent->pe.railgunImpact );*/ } @@ -1179,7 +1089,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent // set custom shading for railgun refire rate if ( ps ) { - if ( cg.predictedPlayerState.weapon == WP_RAILGUN +/* if ( cg.predictedPlayerState.weapon == WP_RAILGUN && cg.predictedPlayerState.weaponstate == WEAPON_FIRING ) { float f; @@ -1189,7 +1099,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent gun.shaderRGBA[0] = gun.shaderRGBA[2] = 255 * ( 1.0 - f ); } - else + else*/ { gun.shaderRGBA[0] = 255; gun.shaderRGBA[1] = 255; @@ -1261,8 +1171,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent } // add the flash - if ( ( weaponNum == WP_TESLAGEN || weaponNum == WP_GAUNTLET || weaponNum == WP_GRAPPLING_HOOK ) - && ( nonPredictedCent->currentState.eFlags & EF_FIRING ) ) + if ( ( weaponNum == WP_TESLAGEN ) && ( nonPredictedCent->currentState.eFlags & EF_FIRING ) ) { // continuous flash } else { @@ -1287,14 +1196,14 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent AnglesToAxis( angles, flash.axis ); // colorize the railgun blast - if ( weaponNum == WP_RAILGUN ) { +/* if ( weaponNum == WP_RAILGUN ) { clientInfo_t *ci; ci = &cgs.clientinfo[ cent->currentState.clientNum ]; flash.shaderRGBA[0] = 255 * ci->color1[0]; flash.shaderRGBA[1] = 255 * ci->color1[1]; flash.shaderRGBA[2] = 255 * ci->color1[2]; - } + }*/ CG_PositionRotatedEntityOnTag( &flash, &gun, weapon->weaponModel, "tag_flash"); trap_R_AddRefEntityToScene( &flash ); @@ -1480,7 +1389,7 @@ void CG_DrawWeaponSelect( void ) { BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); // no ammo cross on top - if ( !ammo && !clips && !BG_infiniteAmmo( i ) ) { + if ( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) { CG_DrawPic( x, y, 16, 16, cgs.media.noammoShader ); } @@ -1514,9 +1423,9 @@ void CG_DrawWeaponSelect( void ) { // draw the selected name if( cg.weaponSelect <= 32 ) { - if ( cg_weapons[ cg.weaponSelect ].item ) + if( cg_weapons[ cg.weaponSelect ].registered ) { - name = cg_weapons[ cg.weaponSelect ].item->pickup_name; + name = cg_weapons[ cg.weaponSelect ].humanName; if ( name ) { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; @@ -1527,9 +1436,9 @@ void CG_DrawWeaponSelect( void ) { } else if( cg.weaponSelect > 32 ) { - if ( cg_upgrades[ cg.weaponSelect - 32 ].item ) + if( cg_upgrades[ cg.weaponSelect - 32 ].registered ) { - name = cg_upgrades[ cg.weaponSelect - 32 ].item->pickup_name; + name = cg_upgrades[ cg.weaponSelect - 32 ].humanName; if ( name ) { w = CG_DrawStrlen( name ) * BIGCHAR_WIDTH; @@ -1554,7 +1463,7 @@ static qboolean CG_WeaponSelectable( int i ) BG_unpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); - if ( !ammo && !clips && !BG_infiniteAmmo( i ) ) { + if ( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) { return qfalse; } if ( !BG_gotWeapon( i, cg.snap->ps.stats ) ) { @@ -1838,7 +1747,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im mark = cgs.media.energyMarkShader; radius = 24; break; - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: mod = cgs.media.dishFlashModel; shader = cgs.media.grenadeExplosionShader; sfx = cgs.media.sfx_rockexp; @@ -1846,8 +1755,8 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im radius = 64; light = 300; isSprite = qtrue; - break; - case WP_ROCKET_LAUNCHER: + break;*/ +/* case WP_ROCKET_LAUNCHER: mod = cgs.media.dishFlashModel; shader = cgs.media.rocketExplosionShader; sfx = cgs.media.sfx_rockexp; @@ -1866,20 +1775,20 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im CG_ParticleExplosion( "explode1", sprOrg, sprVel, 1400, 20, 30 ); } - break; + break;*/ case WP_LOCKBLOB_LAUNCHER: sfx = cgs.media.gibBounce1Sound; mark = cgs.media.greenBloodMarkShader; radius = 64; isSprite = qtrue; break; - case WP_RAILGUN: +/* case WP_RAILGUN: mod = cgs.media.ringFlashModel; shader = cgs.media.railExplosionShader; sfx = cgs.media.sfx_plasmaexp; mark = cgs.media.energyMarkShader; radius = 24; - break; + break;*/ case WP_FLAMER: sfx = cgs.media.sfx_lghit; mark = cgs.media.burnMarkShader; @@ -1899,21 +1808,21 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im mark = cgs.media.energyMarkShader; radius = 16; break; - case WP_BFG: +/* case WP_BFG: mod = cgs.media.dishFlashModel; shader = cgs.media.bfgExplosionShader; sfx = cgs.media.sfx_rockexp; mark = cgs.media.burnMarkShader; radius = 32; isSprite = qtrue; - break; - case WP_SHOTGUN: + break;*/ +/* case WP_SHOTGUN: mod = cgs.media.bulletFlashModel; shader = cgs.media.bulletExplosionShader; mark = cgs.media.bulletMarkShader; sfx = 0; radius = 4; - break; + break;*/ case WP_MASS_DRIVER: shader = cgs.media.bulletExplosionShader; mark = cgs.media.bulletMarkShader; @@ -1953,10 +1862,10 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im duration, isSprite ); le->light = light; VectorCopy( lightColor, le->lightColor ); - if ( weapon == WP_RAILGUN ) { +/* if ( weapon == WP_RAILGUN ) { // colorize with client color VectorCopy( cgs.clientinfo[clientNum].color1, le->color ); - } + }*/ } // @@ -1966,7 +1875,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im alphaFade = ( mark == cgs.media.energyMarkShader || mark == cgs.media.greenBloodMarkShader ); - if( weapon == WP_RAILGUN ) +/* if( weapon == WP_RAILGUN ) { float *color; @@ -1974,7 +1883,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im color = cgs.clientinfo[clientNum].color2; CG_ImpactMark( mark, origin, dir, random()*360, color[0],color[1], color[2],1, alphaFade, radius, qfalse ); } - else + else*/ { CG_ImpactMark( mark, origin, dir, random()*360, 1,1,1,1, alphaFade, radius, qfalse ); } @@ -1992,10 +1901,10 @@ void CG_MissileHitPlayer( int weapon, vec3_t origin, vec3_t dir, int entityNum ) // some weapons will make an explosion with the blood, while // others will just make the blood switch ( weapon ) { - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: case WP_ROCKET_LAUNCHER: CG_MissileHitWall( weapon, 0, origin, dir, IMPACTSOUND_FLESH ); - break; + break;*/ default: break; } @@ -2047,16 +1956,16 @@ static void CG_ShotgunPellet( vec3_t start, vec3_t end, int skipNum ) { } if ( cg_entities[tr.entityNum].currentState.eType == ET_PLAYER ) { - CG_MissileHitPlayer( WP_SHOTGUN, tr.endpos, tr.plane.normal, tr.entityNum ); + /*CG_MissileHitPlayer( WP_SHOTGUN, tr.endpos, tr.plane.normal, tr.entityNum );*/ } else { if ( tr.surfaceFlags & SURF_NOIMPACT ) { // SURF_NOIMPACT will not make a flame puff or a mark return; } if ( tr.surfaceFlags & SURF_METALSTEPS ) { - CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL ); + /*CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_METAL );*/ } else { - CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT ); + /*CG_MissileHitWall( WP_SHOTGUN, 0, tr.endpos, tr.plane.normal, IMPACTSOUND_DEFAULT );*/ } } } diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 071ceb7f..f2b132a8 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -18,940 +18,6 @@ #include "q_shared.h" #include "bg_public.h" -/*QUAKED item_***** ( 0 0 0 ) (-16 -16 -16) (16 16 16) suspended -DO NOT USE THIS CLASS, IT JUST HOLDS GENERAL INFORMATION. -The suspended flag will allow items to hang in the air, otherwise they are dropped to the next surface. - -If an item is the target of another entity, it will not spawn in until fired. - -An item fires all of its targets when it is picked up. If the toucher can't carry it, the targets won't be fired. - -"notfree" if set to 1, don't spawn in free for all games -"notteam" if set to 1, don't spawn in team games -"notsingle" if set to 1, don't spawn in single player games -"wait" override the default wait before respawning. -1 = never respawn automatically, which can be used with targeted spawning. -"random" random number of plus or minus seconds varied from the respawn time -"count" override quantity or duration on most items. -*/ - -gitem_t bg_itemlist[] = -{ - { - NULL, - NULL, - { NULL, - NULL, - 0, 0} , -/* icon */ NULL, -/* pickup */ NULL, - 0, - 0, - 0, -/* precache */ "", -/* sounds */ "" - }, // leave index 0 alone - - // - // ARMOR - // - -/*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_armor_shard", - "sound/misc/ar1_pkup.wav", - { "models/powerups/armor/shard.md3", - "models/powerups/armor/shard_sphere.md3", - 0, 0} , - "icons/iconr_shard", - "Armor Shard", - 5, - IT_ARMOR, - 0, - "", - "" - },*/ - -/*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_armor_combat", - "sound/misc/ar2_pkup.wav", - { "models/powerups/armor/armor_yel.md3", - 0, 0, 0}, - "icons/iconr_yellow", - "Armor", - 50, - IT_ARMOR, - 0, - "", - "" - },*/ - -/*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_armor_body", - "sound/misc/ar3_pkup.wav", - { "models/powerups/armor/armor_red.md3", - 0, 0, 0}, - "icons/iconr_red", - "Heavy Armor", - 100, - IT_ARMOR, - 0, - "", - "" - },*/ - - // - // health - // -/*QUAKED item_health_small (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_health_small", - "sound/items/s_health.wav", - { "models/powerups/health/small_cross.md3", - "models/powerups/health/small_sphere.md3", - 0, 0 }, - "icons/iconh_green", - "5 Health", - 5, - IT_HEALTH, - 0, - "", - "" - },*/ - -/*QUAKED item_health (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_health", - "sound/items/n_health.wav", - { "models/powerups/health/medium_cross.md3", - "models/powerups/health/medium_sphere.md3", - 0, 0 }, - "icons/iconh_yellow", - "25 Health", - 25, - IT_HEALTH, - 0, - "", - "" - },*/ - -/*QUAKED item_health_large (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_health_large", - "sound/items/l_health.wav", - { "models/powerups/health/large_cross.md3", - "models/powerups/health/large_sphere.md3", - 0, 0 }, - "icons/iconh_red", - "50 Health", - 50, - IT_HEALTH, - 0, - "", - "" - },*/ - -/*QUAKED item_health_mega (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_health_mega", - "sound/items/m_health.wav", - { "models/powerups/health/mega_cross.md3", - "models/powerups/health/mega_sphere.md3", - 0, 0 }, - "icons/iconh_mega", - "Mega Health", - 100, - IT_HEALTH, - 0, - "", - "" - },*/ - - - // - // WEAPONS - // - -/*QUAKED weapon_gauntlet (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -//TA:FIXME: must keep gauntlet and machinegun for now or bots have a fit and prevent game working - - { - "weapon_gauntlet", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Gauntlet", - 0, - IT_WEAPON, - WP_GAUNTLET, - "", - "" - }, - -/*QUAKED weapon_venom (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_venom", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Venom", - 0, - IT_WEAPON, - WP_VENOM, - "", - "" - }, - -/*QUAKED weapon_grabandcsaw (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_grabandcsaw", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Circular Saw", - 0, - IT_WEAPON, - WP_GRABANDCSAW, - "", - "" - }, - -/*QUAKED weapon_pounce (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_pounce", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Claw and Pounce", - 0, - IT_WEAPON, - WP_POUNCE, - "", - "" - }, - -/*QUAKED weapon_dbuild (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_dbuild", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Alien Build", - 0, - IT_WEAPON, - WP_ABUILD, - "", - "" - }, - -/*QUAKED weapon_dbuild2 (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_dbuild2", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Alien Build 2", - 0, - IT_WEAPON, - WP_ABUILD2, - "", - "" - }, - -/*QUAKED weapon_hbuild (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_hbuild", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "HBuild", - 0, - IT_WEAPON, - WP_HBUILD, - "", - "" - }, - -/*QUAKED weapon_hbuild2 (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_hbuild2", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Human Build 2", - 0, - IT_WEAPON, - WP_HBUILD2, - "", - "" - }, - -/*QUAKED weapon_shotgun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "weapon_shotgun", - "sound/misc/w_pkup.wav", - { "models/weapons2/shotgun/shotgun.md3", - 0, 0, 0}, - "icons/iconw_shotgun", - "Shotgun", - 10, - IT_WEAPON, - WP_SHOTGUN, - "", - "" - },*/ - -/*QUAKED weapon_machinegun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_machinegun", - "sound/misc/w_pkup.wav", - { "models/weapons2/machinegun/machinegun.md3", - 0, 0, 0}, - "icons/iconw_machinegun", - "Machinegun", - 40, - IT_WEAPON, - WP_MACHINEGUN, - "", - "" - }, - -/*QUAKED weapon_chaingun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_chaingun", - "sound/misc/w_pkup.wav", - { "models/weapons2/machinegun/machinegun.md3", - 0, 0, 0}, - "icons/iconw_machinegun", - "Chaingun", - 40, - IT_WEAPON, - WP_CHAINGUN, - "", - "" - }, - -/*QUAKED weapon_massdriver (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_massdriver", - "sound/misc/w_pkup.wav", - { "models/weapons2/bfg/bfg.md3", - 0, 0, 0}, - "icons/iconw_bfg", - "Mass Driver", - 40, - IT_WEAPON, - WP_MASS_DRIVER, - "", - "" - }, - -/*QUAKED weapon_pulserifle (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_pulserifle", - "sound/misc/w_pkup.wav", - { "models/weapons2/plasma/plasma.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Pulse Rifle", - 40, - IT_WEAPON, - WP_PULSE_RIFLE, - "", - "" - }, - -/*QUAKED weapon_ggrenade (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_ggrenade", - "sound/misc/w_pkup.wav", - { "models/weapons2/gauntlet/gauntlet.md3", - 0, 0, 0}, - "icons/iconw_gauntlet", - "Gas Grenade", - 0, - IT_WEAPON, - WP_GGRENADE, - "", - "" - }, - -/*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "weapon_grenadelauncher", - "sound/misc/w_pkup.wav", - { "models/weapons2/grenadel/grenadel.md3", - 0, 0, 0}, - "icons/iconw_grenade", - "Grenade Launcher", - 10, - IT_WEAPON, - WP_GRENADE_LAUNCHER, - "", - "sound/weapons/grenade/hgrenb1a.wav sound/weapons/grenade/hgrenb2a.wav" - },*/ - -/*QUAKED weapon_rocketlauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "weapon_rocketlauncher", - "sound/misc/w_pkup.wav", - { "models/weapons2/rocketl/rocketl.md3", - 0, 0, 0}, - "icons/iconw_rocket", - "Rocket Launcher", - 10, - IT_WEAPON, - WP_ROCKET_LAUNCHER, - "", - "" - },*/ - -/*QUAKED weapon_teslagen (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_teslagen", - "sound/misc/w_pkup.wav", - { 0, 0, 0, 0}, - "icons/iconw_lightning", - "Tesla Generator", - 100, - IT_WEAPON, - WP_TESLAGEN, - "", - "" - }, - -/*QUAKED weapon_railgun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_railgun", - "sound/misc/w_pkup.wav", - { 0, 0, 0, 0}, - "icons/iconw_railgun", - "Railgun", - 10, - IT_WEAPON, - WP_RAILGUN, - "", - "" - }, - -/*QUAKED weapon_sawbladelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_lockbloblauncher", - "sound/misc/w_pkup.wav", - { 0, 0, 0, 0}, - "icons/iconw_rocket", - "Lockblob Launcher", - 10, - IT_WEAPON, - WP_LOCKBLOB_LAUNCHER, - "", - "" - }, - -/*QUAKED weapon_plasmagun (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_plasmagun", - "sound/misc/w_pkup.wav", - { "models/weapons2/plasma/plasma.md3", - 0, 0, 0}, - "icons/iconw_plasma", - "Plasma Gun", - 50, - IT_WEAPON, - WP_PLASMAGUN, - "", - "" - }, - -/*QUAKED weapon_flamer (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_flamer", - "sound/misc/w_pkup.wav", - { "models/weapons2/plasma/plasma.md3", - 0, 0, 0}, - "icons/iconw_plasma", - "Flame Thrower", - 50, - IT_WEAPON, - WP_FLAMER, - "", - "" - }, - -/*QUAKED weapon_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - { - "weapon_bfg", - "sound/misc/w_pkup.wav", - { "models/weapons2/bfg/bfg.md3", - 0, 0, 0}, - "icons/iconw_bfg", - "Dual BFG", - 0, - IT_WEAPON, - WP_BFG, - "", - "" - }, - -/*QUAKED weapon_grapplinghook (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "weapon_grapplinghook", - "sound/misc/w_pkup.wav", - { "models/weapons2/grapple/grapple.md3", - 0, 0, 0}, - "Grappling Hook", - 0, - IT_WEAPON, - WP_GRAPPLING_HOOK, - "", - "" - },*/ - - // - // AMMO ITEMS - // - -/*QUAKED ammo_shells (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_shells", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/shotgunam.md3", - 0, 0, 0}, - "icons/icona_shotgun", - "Shells", - 10, - IT_AMMO, - WP_SHOTGUN, - "", - "" - },*/ - -/*QUAKED ammo_bullets (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_bullets", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/machinegunam.md3", - 0, 0, 0}, - "icons/icona_machinegun", - "Bullets", - 50, - IT_AMMO, - WP_MACHINEGUN, - "", - "" - },*/ - -/*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_grenades", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/grenadeam.md3", - 0, 0, 0}, - "icons/icona_grenade", - "Grenades", - 5, - IT_AMMO, - WP_GRENADE_LAUNCHER, - "", - "" - },*/ - -/*QUAKED ammo_cells (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_cells", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/plasmaam.md3", - 0, 0, 0}, - "icons/icona_plasma", - "Cells", - 30, - IT_AMMO, - WP_PLASMAGUN, - "", - "" - },*/ - -/*QUAKED ammo_lightning (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_lightning", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/lightningam.md3", - 0, 0, 0}, - "icons/icona_lightning", - "Lightning", - 60, - IT_AMMO, - WP_LIGHTNING, - "", - "" - },*/ - -/*QUAKED ammo_rockets (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_rockets", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/rocketam.md3", - 0, 0, 0}, - "icons/icona_rocket", - "Rockets", - 5, - IT_AMMO, - WP_ROCKET_LAUNCHER, - "", - "" - },*/ - -/*QUAKED ammo_slugs (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_slugs", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/railgunam.md3", - 0, 0, 0}, - "icons/icona_railgun", - "Slugs", - 10, - IT_AMMO, - WP_RAILGUN, - "", - "" - },*/ - -/*QUAKED ammo_bfg (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "ammo_bfg", - "sound/misc/am_pkup.wav", - { "models/powerups/ammo/bfgam.md3", - 0, 0, 0}, - "icons/icona_bfg", - "Bfg Ammo", - 15, - IT_AMMO, - WP_BFG, - "", - "" - },*/ - - // - // HOLDABLE ITEMS - // -/*QUAKED holdable_teleporter (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "holdable_teleporter", - "sound/items/holdable.wav", - { "models/powerups/holdable/teleporter.md3", - 0, 0, 0}, - "icons/teleporter", - "Personal Teleporter", - 60, - IT_HOLDABLE, - HI_TELEPORTER, - "", - "" - },*/ - -/*QUAKED holdable_medkit (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "holdable_medkit", - "sound/items/holdable.wav", - { "models/powerups/holdable/medkit.md3", - "models/powerups/holdable/medkit_sphere.md3", - 0, 0}, - "icons/medkit", - "Medkit", - 60, - IT_HOLDABLE, - HI_MEDKIT, - "", - "sound/items/use_medkit.wav" - },*/ - - // - // POWERUP ITEMS - // -/*QUAKED item_quad (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_quad", - "sound/items/quaddamage.wav", - { "models/powerups/instant/quad.md3", - "models/powerups/instant/quad_ring.md3", - 0, 0 }, - "icons/quad", - "Quad Damage", - 30, - IT_POWERUP, - PW_QUAD, - "", - "sound/items/damage2.wav sound/items/damage3.wav" - },*/ - -/*QUAKED item_enviro (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_enviro", - "sound/items/protect.wav", - { "models/powerups/instant/enviro.md3", - "models/powerups/instant/enviro_ring.md3", - 0, 0 }, - "icons/envirosuit", - "Battle Suit", - 30, - IT_POWERUP, - PW_BATTLESUIT, - "", - "sound/items/airout.wav sound/items/protect3.wav" - },*/ - -/*QUAKED item_haste (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_haste", - "sound/items/haste.wav", - { "models/powerups/instant/haste.md3", - "models/powerups/instant/haste_ring.md3", - 0, 0 }, - "icons/haste", - "Speed", - 30, - IT_POWERUP, - PW_HASTE, - "", - "" - },*/ - -/*QUAKED item_invis (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_invis", - "sound/items/invisibility.wav", - { "models/powerups/instant/invis.md3", - "models/powerups/instant/invis_ring.md3", - 0, 0 }, - "icons/invis", - "Invisibility", - 30, - IT_POWERUP, - PW_INVIS, - "", - "" - },*/ - -/*QUAKED item_regen (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_regen", - "sound/items/regeneration.wav", - { "models/powerups/instant/regen.md3", - "models/powerups/instant/regen_ring.md3", - 0, 0 }, - "icons/regen", - "Regeneration", - 30, - IT_POWERUP, - PW_REGEN, - "", - "sound/items/regen.wav" - },*/ - -/*QUAKED item_flight (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - /*{ - "item_flight", - "sound/items/flight.wav", - { "models/powerups/instant/flight.md3", - "models/powerups/instant/flight_ring.md3", - 0, 0 }, - "icons/flight", - "Flight", - 60, - IT_POWERUP, - PW_FLIGHT, - "", - "sound/items/flight.wav" - },*/ - -/*QUAKED upgrade_torch (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_torch", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "Torch", //pickup - 0, - IT_UPGRADE, - UP_TORCH, - "", //precache - "" //sounds - }, - -/*QUAKED upgrade_nvg (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_nvg", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "NVG", //pickup - 0, - IT_UPGRADE, - UP_NVG, - "", //precache - "" //sounds - }, - -/*QUAKED upgrade_carmour (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_carmour", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "Chest Armour", //pickup - 0, - IT_UPGRADE, - UP_CHESTARMOUR, - "", //precache - "" //sounds - }, - -/*QUAKED upgrade_larmour (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_larmour", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "Limb Armour", //pickup - 0, - IT_UPGRADE, - UP_LIMBARMOUR, - "", //precache - "" //sounds - }, - -/*QUAKED upgrade_helmet (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_helmet", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "Helmet", //pickup - 0, - IT_UPGRADE, - UP_HELMET, - "", //precache - "" //sounds - }, - -/*QUAKED upgrade_bsuit (0 0 1) (-16 -16 -16) (16 16 16) -*/ - { - "upgrade_bsuit", - "sound/items/holdable.wav", - { 0, 0, 0, 0 }, - "icons/teleporter", //icon - "Battle Suit", //pickup - 0, - IT_UPGRADE, - UP_BATTLESUIT, - "", //precache - "" //sounds - }, - -/*QUAKED team_CTF_redflag (1 0 0) (-16 -16 -16) (16 16 16) -Only in CTF games -*/ - /*{ - "team_CTF_redflag", - "sound/teamplay/flagtk_red.wav", - { "models/flags/r_flag.md3", - 0, 0, 0 }, - "icons/iconf_red1", - "Red Flag", - 0, - IT_TEAM, - PW_REDFLAG, - "", - "sound/teamplay/flagcap_red.wav sound/teamplay/flagtk_red.wav sound/teamplay/flagret_red.wav" - },*/ - -/*QUAKED team_CTF_blueflag (0 0 1) (-16 -16 -16) (16 16 16) -Only in CTF games -*/ - /*{ - "team_CTF_blueflag", - "sound/teamplay/flagtk_blu.wav", - { "models/flags/b_flag.md3", - 0, 0, 0 }, - "icons/iconf_blu1", - "Blue Flag", - 0, - IT_TEAM, - PW_BLUEFLAG, - "", - "sound/teamplay/flagcap_blu.wav sound/teamplay/flagtk_blu.wav sound/teamplay/flagret_blu.wav" - },*/ - - // end of list marker - {NULL} -}; - -int bg_numItems = sizeof(bg_itemlist) / sizeof(bg_itemlist[0]) - 1; - -//////////////////////////////////////////////////////////////////////////////// - buildableAttributes_t bg_buildableList[ ] = { { @@ -1536,7 +602,7 @@ char *BG_FindNameForBuildable( int bclass ) } //wimp out - return ""; + return 0; } /* @@ -1555,7 +621,7 @@ char *BG_FindHumanNameForBuildable( int bclass ) } //wimp out - return ""; + return 0; } /* @@ -1574,7 +640,7 @@ char *BG_FindEntityNameForBuildable( int bclass ) } //wimp out - return ""; + return 0; } /* @@ -1593,7 +659,7 @@ char *BG_FindModelsForBuildable( int bclass, int modelNum ) } //wimp out - return ""; + return 0; } /* @@ -2344,7 +1410,7 @@ char *BG_FindNameForClassNum( int pclass ) } //wimp out - return ""; + return 0; } /* @@ -2363,7 +1429,7 @@ char *BG_FindHumanNameForClassNum( int pclass ) } //wimp out - return ""; + return 0; } /* @@ -2723,11 +1789,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "rifle", //char *weaponName; "Rifle", //char *weaponHumanName; + { "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 }, + "icons/iconw_machinegun", 30, //int quan; 3, //int clips; 3, //int maxClips; + qfalse, //int infiniteAmmo; + 100, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2736,11 +1807,16 @@ 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_plasma", 400, //int quan; 0, //int clips; 0, //int maxClips; + qfalse, //int infiniteAmmo; + 40, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2749,11 +1825,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "chaingun", //char *weaponName; "Chaingun", //char *weaponHumanName; + { "models/weapons2/machinegun/machinegun.md3", 0, 0, 0 }, + "icons/iconw_machinegun", 300, //int quan; 0, //int clips; 0, //int maxClips; + qfalse, //int infiniteAmmo; + 50, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2762,11 +1843,16 @@ 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_bfg", 5, //int quan; 2, //int clips; 3, //int maxClips; + qfalse, //int infiniteAmmo; + 1000, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2775,11 +1861,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "prifle", //char *weaponName; "Pulse Rifle", //char *weaponHumanName; + { "models/weapons2/plasma/plasma.md3", 0, 0, 0 }, + "icons/iconw_plasma", 50, //int quan; 3, //int clips; 3, //int maxClips; + qfalse, //int infiniteAmmo; + 50, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2788,11 +1879,16 @@ 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_gauntlet", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 1000, //int repeatRate; qtrue, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2801,11 +1897,16 @@ 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_gauntlet", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 1000, //int repeatRate; qtrue, //qboolean hasAltMode; qfalse, //qboolean synced; + qtrue, //qboolean purchasable; WUT_HUMANS //WUTeam_t team; }, { @@ -2814,11 +1915,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "dbuild", //char *weaponName; "Alien build weapon", //char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 1000, //int repeatRate; qtrue, //qboolean hasAltMode; qfalse, //qboolean synced; + qfalse, //qboolean purchasable; WUT_ALIENS //WUTeam_t team; }, { @@ -2827,11 +1933,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "dbuild2", //char *weaponName; "Alien build weapon2",//char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 1000, //int repeatRate; qtrue, //qboolean hasAltMode; qfalse, //qboolean synced; + qfalse, //qboolean purchasable; WUT_ALIENS //WUTeam_t team; }, { @@ -2840,11 +1951,16 @@ 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", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 500, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qfalse, //qboolean purchasable; WUT_ALIENS //WUTeam_t team; }, { @@ -2853,11 +1969,16 @@ weaponAttributes_t bg_weapons[ ] = SLOT_WEAPON, //int slots; "grabandcsaw", //char *weaponName; "Circular Saw", //char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 500, //int repeatRate; qtrue, //qboolean hasAltMode; qtrue, //qboolean synced; + qfalse, //qboolean purchasable; WUT_ALIENS //WUTeam_t team; }, { @@ -2866,12 +1987,71 @@ 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", 0, //int quan; 0, //int clips; 0, //int maxClips; + qtrue, //int infiniteAmmo; + 750, //int repeatRate; qfalse, //qboolean hasAltMode; qfalse, //qboolean synced; + qfalse, //qboolean purchasable; WUT_ALIENS //WUTeam_t team; + }, + { + WP_LOCKBLOB_LAUNCHER, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "lockblob", //char *weaponName; + "Lock Blob", //char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qtrue, //int infiniteAmmo; + 500, //int repeatRate; + qfalse, //qboolean hasAltMode; + qfalse, //qboolean synced; + qfalse, //qboolean purchasable; + WUT_ALIENS //WUTeam_t team; + }, + { + WP_TESLAGEN, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "teslagen", //char *weaponName; + "Tesla Generator", //char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qtrue, //int infiniteAmmo; + 500, //int repeatRate; + qfalse, //qboolean hasAltMode; + qfalse, //qboolean synced; + qfalse, //qboolean purchasable; + WUT_HUMANS //WUTeam_t team; + }, + { + WP_PLASMAGUN, //int weaponNum; + 100, //int price; + SLOT_WEAPON, //int slots; + "plasmagun", //char *weaponName; + "Plasma Gun", //char *weaponHumanName; + { "models/weapons2/gauntlet/gauntlet.md3", 0, 0, 0 }, + "icons/iconw_gauntlet", + 0, //int quan; + 0, //int clips; + 0, //int maxClips; + qtrue, //int infiniteAmmo; + 500, //int repeatRate; + qfalse, //qboolean hasAltMode; + qfalse, //qboolean synced; + qfalse, //qboolean purchasable; + WUT_HUMANS //WUTeam_t team; } }; @@ -2933,7 +2113,7 @@ char *BG_FindNameForWeapon( int weapon ) } //wimp out - return ""; + return 0; } /* @@ -2971,7 +2151,45 @@ char *BG_FindHumanNameForWeapon( int weapon ) } //wimp out - return ""; + return 0; +} + +/* +============== +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; } /* @@ -3002,6 +2220,46 @@ void BG_FindAmmoForWeapon( int weapon, int *quan, int *clips, int *maxClips ) /* ============== +BG_FindInfinteAmmoForWeapon +============== +*/ +qboolean BG_FindInfinteAmmoForWeapon( int weapon ) +{ + int i; + + for( i = 0; i < bg_numWeapons; i++ ) + { + if( bg_weapons[ i ].weaponNum == weapon ) + { + return bg_weapons[ i ].infiniteAmmo; + } + } + + return qfalse; +} + +/* +============== +BG_FindRepeatRateForWeapon +============== +*/ +int BG_FindRepeatRateForWeapon( int weapon ) +{ + int i; + + for( i = 0; i < bg_numWeapons; i++ ) + { + if( bg_weapons[ i ].weaponNum == weapon ) + { + return bg_weapons[ i ].repeatRate; + } + } + + return 1000; +} + +/* +============== BG_WeaponHasAltMode ============== */ @@ -3042,6 +2300,26 @@ qboolean BG_WeaponModesAreSynced( int weapon ) /* ============== +BG_FindPurchasableForWeapon +============== +*/ +qboolean BG_FindPurchasableForWeapon( int weapon ) +{ + int i; + + for( i = 0; i < bg_numWeapons; i++ ) + { + if( bg_weapons[ i ].weaponNum == weapon ) + { + return bg_weapons[ i ].purchasable; + } + } + + return qfalse; +} + +/* +============== BG_FindTeamForWeapon ============== */ @@ -3070,6 +2348,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_NONE, //int slots; "torch", //char *upgradeName; "Torch", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3078,6 +2357,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_HEAD, //int slots; "nvg", //char *upgradeName; "NVG", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3086,6 +2366,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_TORSO, //int slots; "carmour", //char *upgradeName; "Chest Armour", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3094,6 +2375,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_ARMS|SLOT_LEGS, //int slots; "larmour", //char *upgradeName; "Limb Armour", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3102,6 +2384,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_HEAD, //int slots; "helmet", //char *upgradeName; "Helmet", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3110,6 +2393,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_NONE, //int slots; "atoxin", //char *upgradeName; "Anti-toxin", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3118,6 +2402,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_BACKPACK, //int slots; "battpack", //char *upgradeName; "Battery Pack", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3126,6 +2411,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_BACKPACK, //int slots; "jetpack", //char *upgradeName; "Jet Pack", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; }, { @@ -3134,6 +2420,7 @@ upgradeAttributes_t bg_upgrades[ ] = SLOT_HEAD|SLOT_TORSO|SLOT_ARMS|SLOT_LEGS, //int slots; "bsuit", //char *upgradeName; "Battlesuit", //char *upgradeHumanName; + "icons/iconw_gauntlet", WUT_HUMANS //WUTeam_t team; } }; @@ -3196,7 +2483,7 @@ char *BG_FindNameForUpgrade( int upgrade ) } //wimp out - return ""; + return 0; } /* @@ -3234,249 +2521,49 @@ char *BG_FindHumanNameForUpgrade( int upgrade ) } //wimp out - return ""; + return 0; } /* ============== -BG_FindTeamForUpgrade +BG_FindIconForUpgrade ============== */ -WUTeam_t BG_FindTeamForUpgrade( int upgrade ) +char *BG_FindIconForUpgrade( int upgrade ) { int i; for( i = 0; i < bg_numUpgrades; i++ ) { if( bg_upgrades[ i ].upgradeNum == upgrade ) - { - return bg_upgrades[ i ].team; - } + return bg_upgrades[ i ].icon; } - return WUT_NONE; -} - -//////////////////////////////////////////////////////////////////////////////// - -/* -============== -BG_FindItemForPowerup -============== -*/ -gitem_t *BG_FindItemForPowerup( powerup_t pw ) { - int i; - - for ( i = 0 ; i < bg_numItems ; i++ ) { - if ( (bg_itemlist[i].giType == IT_POWERUP /*|| - bg_itemlist[i].giType == IT_TEAM || - bg_itemlist[i].giType == IT_PERSISTANT_POWERUP*/) && - bg_itemlist[i].giTag == pw ) { - return &bg_itemlist[i]; - } - } - - return NULL; + //wimp out + return 0; } - /* ============== -BG_FindItemForHoldable +BG_FindTeamForUpgrade ============== */ -gitem_t *BG_FindItemForHoldable( holdable_t pw ) { - int i; - - for ( i = 0 ; i < bg_numItems ; i++ ) { - if ( bg_itemlist[i].giType == IT_HOLDABLE && bg_itemlist[i].giTag == pw ) { - return &bg_itemlist[i]; - } - } - - Com_Error( ERR_DROP, "HoldableItem not found" ); - - return NULL; -} - - -/* -=============== -BG_FindItemForWeapon - -=============== -*/ -gitem_t *BG_FindItemForWeapon( weapon_t weapon ) { - gitem_t *it; - - for ( it = bg_itemlist + 1 ; it->classname ; it++) { - if ( it->giType == IT_WEAPON && it->giTag == weapon ) { - return it; - } - } - - Com_Error( ERR_DROP, "Couldn't find item for weapon %i", weapon); - return NULL; -} - - -/* -=============== -BG_FindItemForUpgrade - -TA: new function for finding upgrade items -=============== -*/ -gitem_t *BG_FindItemForUpgrade( upgrade_t upgrade ) { - gitem_t *it; - - for ( it = bg_itemlist + 1 ; it->classname ; it++) { - if ( it->giType == IT_UPGRADE && it->giTag == upgrade ) { - return it; - } - } - - Com_Error( ERR_DROP, "Couldn't find item for upgrade %i", upgrade); - return NULL; -} - - -/* -=============== -BG_FindItem - -=============== -*/ -gitem_t *BG_FindItem( const char *pickupName ) { - gitem_t *it; - - for ( it = bg_itemlist + 1 ; it->classname ; it++ ) { - if ( !Q_stricmp( it->pickup_name, pickupName ) ) - return it; - } - - return NULL; -} - -/* -============ -BG_PlayerTouchesItem - -Items can be picked up without actually touching their physical bounds to make -grabbing them easier -============ -*/ -qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ) { - vec3_t origin; - - BG_EvaluateTrajectory( &item->pos, atTime, origin ); - - // we are ignoring ducked differences here - if ( ps->origin[0] - origin[0] > 44 - || ps->origin[0] - origin[0] < -50 - || ps->origin[1] - origin[1] > 36 - || ps->origin[1] - origin[1] < -36 - || ps->origin[2] - origin[2] > 36 - || ps->origin[2] - origin[2] < -36 ) { - return qfalse; - } - - return qtrue; -} - -/* -================ -BG_CanItemBeGrabbed - -Returns false if the item should not be picked up. -This needs to be the same for client side prediction and server use. -================ -*/ -qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps ) { - gitem_t *item; - - if ( ent->modelindex < 1 || ent->modelindex >= bg_numItems ) { - Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: index out of range" ); - } - - item = &bg_itemlist[ent->modelindex]; - - switch( item->giType ) { - case IT_WEAPON: - return qtrue; // weapons are always picked up - - case IT_AMMO: - if ( ps->ammo[ item->giTag ] >= 200 ) { - return qfalse; // can't hold any more - } - return qtrue; - - case IT_ARMOR: - if ( ps->stats[STAT_ARMOR] >= ps->stats[STAT_MAX_HEALTH] * 2 ) { - return qfalse; - } - return qtrue; - - case IT_HEALTH: - // small and mega healths will go over the max, otherwise - // don't pick up if already at max - if ( item->quantity == 5 || item->quantity == 100 ) { - if ( ps->stats[STAT_HEALTH] >= ps->stats[STAT_MAX_HEALTH] * 2 ) { - return qfalse; - } - return qtrue; - } - - if ( ps->stats[STAT_HEALTH] >= ps->stats[STAT_MAX_HEALTH] ) { - return qfalse; - } - return qtrue; - - case IT_POWERUP: - return qtrue; // powerups are always picked up - - case IT_TEAM: // team items, such as flags - // ent->modelindex2 is non-zero on items if they are dropped - // we need to know this because we can pick up our dropped flag (and return it) - // but we can't pick up our flag at base - if (ps->persistant[PERS_TEAM] == TEAM_HUMANS) { - //TA: remove powerups - /*if (item->giTag == PW_BLUEFLAG || - (item->giTag == PW_REDFLAG && ent->modelindex2) || - (item->giTag == PW_REDFLAG && ps->powerups[PW_BLUEFLAG])) - return qtrue;*/ - } else if (ps->persistant[PERS_TEAM] == TEAM_ALIENS) { - /*if (item->giTag == PW_REDFLAG || - (item->giTag == PW_BLUEFLAG && ent->modelindex2) || - (item->giTag == PW_BLUEFLAG && ps->powerups[PW_REDFLAG])) - return qtrue;*/ - } - return qfalse; +WUTeam_t BG_FindTeamForUpgrade( int upgrade ) +{ + int i; - //TA: not using the q3 holdable items code - /*case IT_HOLDABLE: - // can only hold one item at a time - if ( ps->stats[STAT_HOLDABLE_ITEM] ) { - return qfalse; + for( i = 0; i < bg_numUpgrades; i++ ) + { + if( bg_upgrades[ i ].upgradeNum == upgrade ) + { + return bg_upgrades[ i ].team; } - return qtrue;*/ - - case IT_BAD: - Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" ); - - default: -#ifndef Q3_VM -#ifndef NDEBUG // bk0001204 - Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType ); -#endif -#endif - break; } - return qfalse; + return WUT_NONE; } -//====================================================================== +//////////////////////////////////////////////////////////////////////////////// /* ================ @@ -3969,28 +3056,6 @@ void BG_packAmmoArray( int weapon, int ammo[ ], int ammo2[ ], int quan, int clip ammo2[ weapon - 16 ] = weaponvalue; } -//TA: check whether infinite ammo -qboolean BG_infiniteAmmo( int weapon ) -{ - switch( weapon ) - { - case WP_VENOM: - case WP_GRABANDCSAW: - case WP_POUNCE: - case WP_ABUILD: - case WP_ABUILD2: - case WP_HBUILD: - case WP_HBUILD2: - return qtrue; - break; - - //nothing else has infinite ammo - default: - return qfalse; - break; - } -} - //TA: pack weapons into the array void BG_packWeapon( int weapon, int stats[ ] ) { diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 9d570cb9..da3809fc 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2159,7 +2159,7 @@ static void PM_Weapon( void ) BG_unpackAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, &ammo, &clips, &maxclips ); // check for out of ammo - if ( !ammo && !clips && !BG_infiniteAmmo( pm->ps->weapon ) ) + if ( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) ) { PM_AddEvent( EV_NOAMMO ); pm->ps->weaponTime += 200; @@ -2306,74 +2306,15 @@ static void PM_Weapon( void ) pm->ps->weaponstate = WEAPON_FIRING; // take an ammo away if not infinite - if( !BG_infiniteAmmo( pm->ps->weapon ) ) + if( !BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) ) { ammo--; BG_packAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, ammo, clips, maxclips ); } - switch( pm->ps->weapon ) - { - default: - case WP_GAUNTLET: - addTime = 400; - break; - case WP_TESLAGEN: - addTime = 50; - break; - case WP_SHOTGUN: - addTime = 1000; - break; - case WP_MACHINEGUN: - addTime = 100; - break; - case WP_CHAINGUN: - addTime = 50; - break; - case WP_GRENADE_LAUNCHER: - addTime = 800; - break; - case WP_ROCKET_LAUNCHER: - addTime = 800; - break; - case WP_FLAMER: - addTime = 40; - break; - case WP_RAILGUN: - addTime = 1500; - break; - case WP_LOCKBLOB_LAUNCHER: - addTime = 1000; - break; - case WP_BFG: - addTime = 200; - break; - case WP_GRAPPLING_HOOK: - addTime = 400; - break; - case WP_VENOM: - addTime = 500; - break; - case WP_GRABANDCSAW: - addTime = 500; - break; - case WP_POUNCE: - addTime = 750; - break; - case WP_MASS_DRIVER: - addTime = 1000; - break; - case WP_PULSE_RIFLE: - addTime = 50; - break; - case WP_ABUILD: - case WP_ABUILD2: - case WP_HBUILD: - case WP_HBUILD2: - addTime = 1000; //abritutary since doesn't "fire" - break; - } + addTime = BG_FindRepeatRateForWeapon( pm->ps->weapon ); + //FIXME: predicted angles miss a problem?? if( pm->ps->weapon == WP_CHAINGUN ) { if( pm->ps->pm_flags & PMF_DUCKED ) @@ -2611,7 +2552,7 @@ void PmoveSingle (pmove_t *pmove) // set the firing flag for continuous beam weapons if ( !(pm->ps->pm_flags & PMF_RESPAWNED) && pm->ps->pm_type != PM_INTERMISSION && ( pm->cmd.buttons & BUTTON_ATTACK ) - && ( ( ammo > 0 || clips > 0 ) || BG_infiniteAmmo( pm->ps->weapon ) ) ) + && ( ( ammo > 0 || clips > 0 ) || BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) ) ) pm->ps->eFlags |= EF_FIRING; else pm->ps->eFlags &= ~EF_FIRING; @@ -2619,7 +2560,7 @@ void PmoveSingle (pmove_t *pmove) // set the firing flag for continuous beam weapons if ( !(pm->ps->pm_flags & PMF_RESPAWNED) && pm->ps->pm_type != PM_INTERMISSION && ( pm->cmd.buttons & BUTTON_ATTACK2 ) - && ( ( ammo > 0 || clips > 0 ) || BG_infiniteAmmo( pm->ps->weapon ) ) ) + && ( ( ammo > 0 || clips > 0 ) || BG_FindInfinteAmmoForWeapon( pm->ps->weapon ) ) ) pm->ps->eFlags |= EF_FIRING2; else pm->ps->eFlags &= ~EF_FIRING2; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index a6b152b0..3be0a0a4 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -327,19 +327,12 @@ typedef enum { WP_NONE, - WP_GAUNTLET, WP_MACHINEGUN, WP_CHAINGUN, - WP_SHOTGUN, - WP_GRENADE_LAUNCHER, - WP_ROCKET_LAUNCHER, WP_LOCKBLOB_LAUNCHER, WP_TESLAGEN, - WP_RAILGUN, WP_FLAMER, WP_PLASMAGUN, - WP_BFG, - WP_GRAPPLING_HOOK, WP_VENOM, WP_GRABANDCSAW, WP_POUNCE, @@ -352,8 +345,6 @@ typedef enum WP_HBUILD2, WP_HBUILD, //ok? - - WP_GGRENADE, WP_NUM_WEAPONS } weapon_t; @@ -911,14 +902,22 @@ typedef struct char *weaponName; char *weaponHumanName; + + char *models[ MAX_ITEM_MODELS ]; + char *icon; int quan; int clips; int maxClips; + qboolean infiniteAmmo; + + int repeatRate; qboolean hasAltMode; qboolean synced; + qboolean purchasable; + WUTeam_t team; } weaponAttributes_t; @@ -933,48 +932,40 @@ typedef struct char *upgradeName; char *upgradeHumanName; + + char *icon; WUTeam_t team; } upgradeAttributes_t; -// included in both the game dll and the client -extern gitem_t bg_itemlist[]; -extern int bg_numItems; - -gitem_t *BG_FindItem( const char *pickupName ); -gitem_t *BG_FindItemForWeapon( weapon_t weapon ); -gitem_t *BG_FindItemForUpgrade( upgrade_t upgrade ); -gitem_t *BG_FindItemForPowerup( powerup_t pw ); -gitem_t *BG_FindItemForHoldable( holdable_t pw ); - //TA: -int BG_FindBuildNumForName( char *name ); -int BG_FindBuildNumForEntityName( char *name ); -char *BG_FindNameForBuildable( int bclass ); -char *BG_FindHumanNameForBuildable( int bclass ); -char *BG_FindEntityNameForBuildable( int bclass ); -char *BG_FindModelsForBuildable( int bclass, int modelNum ); -void BG_FindBBoxForBuildable( int bclass, vec3_t mins, vec3_t maxs ); -int BG_FindHealthForBuildable( int bclass ); -trType_t BG_FindTrajectoryForBuildable( int bclass ); -float BG_FindBounceForBuildable( int bclass ); -int BG_FindBuildPointsForBuildable( int bclass ); -int BG_FindDamageForBuildable( int bclass ); -int BG_FindSplashDamageForBuildable( int bclass ); -int BG_FindSplashRadiusForBuildable( int bclass ); -int BG_FindMODForBuildable( int bclass ); -int BG_FindTeamForBuildable( int bclass ); -weapon_t BG_FindBuildWeaponForBuildable( int bclass ); -int BG_FindAnimForBuildable( int bclass ); -int BG_FindNextThinkForBuildable( int bclass ); -int BG_FindFireSpeedForBuildable( int bclass ); -int BG_FindRangeForBuildable( int bclass ); -weapon_t BG_FindProjTypeForBuildable( int bclass ); -float BG_FindMinNormalForBuildable( int bclass ); -qboolean BG_FindInvertNormalForBuildable( int bclass ); -int BG_FindCreepTestForBuildable( int bclass ); -int BG_FindCreepSizeForBuildable( int bclass ); -int BG_FindUniqueTestForBuildable( int bclass ); +int BG_FindBuildNumForName( char *name ); +int BG_FindBuildNumForEntityName( char *name ); +char *BG_FindNameForBuildable( int bclass ); +char *BG_FindHumanNameForBuildable( int bclass ); +char *BG_FindEntityNameForBuildable( int bclass ); +char *BG_FindModelsForBuildable( int bclass, int modelNum ); +void BG_FindBBoxForBuildable( int bclass, vec3_t mins, vec3_t maxs ); +int BG_FindHealthForBuildable( int bclass ); +trType_t BG_FindTrajectoryForBuildable( int bclass ); +float BG_FindBounceForBuildable( int bclass ); +int BG_FindBuildPointsForBuildable( int bclass ); +int BG_FindDamageForBuildable( int bclass ); +int BG_FindSplashDamageForBuildable( int bclass ); +int BG_FindSplashRadiusForBuildable( int bclass ); +int BG_FindMODForBuildable( int bclass ); +int BG_FindTeamForBuildable( int bclass ); +weapon_t BG_FindBuildWeaponForBuildable( int bclass ); +int BG_FindAnimForBuildable( int bclass ); +int BG_FindNextThinkForBuildable( int bclass ); +int BG_FindFireSpeedForBuildable( int bclass ); +int BG_FindRangeForBuildable( int bclass ); +weapon_t BG_FindProjTypeForBuildable( int bclass ); +float BG_FindMinNormalForBuildable( int bclass ); +qboolean BG_FindInvertNormalForBuildable( int bclass ); +int BG_FindCreepTestForBuildable( int bclass ); +int BG_FindCreepSizeForBuildable( int bclass ); +int BG_FindUniqueTestForBuildable( int bclass ); int BG_FindClassNumForName( char *name ); char *BG_FindNameForClassNum( int pclass ); @@ -1000,9 +991,14 @@ int BG_FindSlotsForWeapon( int weapon ); char *BG_FindNameForWeapon( int weapon ); int BG_FindWeaponNumForName( char *name ); char *BG_FindHumanNameForWeapon( int weapon ); +char *BG_FindModelsForWeapon( int weapon, int modelNum ); +char *BG_FindIconForWeapon( int weapon ); void BG_FindAmmoForWeapon( int weapon, int *quan, int *clips, int *maxClips ); +qboolean BG_FindInfinteAmmoForWeapon( int weapon ); +int BG_FindRepeatRateForWeapon( int weapon ); qboolean BG_WeaponHasAltMode( int weapon ); qboolean BG_WeaponModesAreSynced( int weapon ); +qboolean BG_FindPurchasableForWeapon( int weapon ); WUTeam_t BG_FindTeamForWeapon( int weapon ); int BG_FindPriceForUpgrade( int upgrade ); @@ -1010,13 +1006,9 @@ int BG_FindSlotsForUpgrade( int upgrade ); char *BG_FindNameForUpgrade( int upgrade ); int BG_FindUpgradeNumForName( char *name ); char *BG_FindHumanNameForUpgrade( int upgrade ); +char *BG_FindIconForUpgrade( int upgrade ); WUTeam_t BG_FindTeamForUpgrade( int upgrade ); -#define ITEM_INDEX(x) ((x)-bg_itemlist) - -qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const playerState_t *ps ); - - // g_dmflags->integer flags #define DF_NO_FALLING 8 #define DF_FIXED_FOV 16 @@ -1077,11 +1069,10 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t * qboolean BG_PlayerTouchesItem( playerState_t *ps, entityState_t *item, int atTime ); //TA: extra bits: (which I apparently dont need) -/*void BG_unpackAmmoArray( int weapon, int ammo[ ], int ammo2[ ], int *quan, int *clips, int *maxclips ); +void BG_unpackAmmoArray( int weapon, int ammo[ ], int ammo2[ ], int *quan, int *clips, int *maxclips ); void BG_packAmmoArray( int weapon, int ammo[ ], int ammo2[ ], int quan, int clips, int maxclips ); -qboolean BG_infiniteAmmo( int weapon ); void BG_packWeapon( int weapon, int stats[ ] ); -qboolean BG_gotWeapon( int weapon, int stats[ ] );*/ +qboolean BG_gotWeapon( int weapon, int stats[ ] ); #define CREEP_BASESIZE 120 #define REACTOR_BASESIZE 1000 diff --git a/src/game/g_active.c b/src/game/g_active.c index b9a6712c..7982ecac 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -278,15 +278,15 @@ void G_TouchTriggers( gentity_t *ent ) { // use seperate code for determining if an item is picked up // so you don't have to actually contact its bounding box - if ( hit->s.eType == ET_ITEM || hit->s.eType == ET_BUILDABLE ) { +/* if ( hit->s.eType == ET_ITEM || hit->s.eType == ET_BUILDABLE ) { if ( !BG_PlayerTouchesItem( &ent->client->ps, &hit->s, level.time ) ) { continue; } - } else { + } else {*/ if ( !trap_EntityContact( mins, maxs, hit ) ) { continue; } - } + /*}*/ memset( &trace, 0, sizeof(trace) ); @@ -893,10 +893,10 @@ void ClientThink_real( gentity_t *ent ) { }*/ // Let go of the hook if we aren't firing - if ( client->ps.weapon == WP_GRAPPLING_HOOK && +/* if ( client->ps.weapon == WP_GRAPPLING_HOOK && client->hook && !( ucmd->buttons & BUTTON_ATTACK ) ) { Weapon_HookFree(client->hook); - } + }*/ //TA: torch stuff if( client->torch == NULL && diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 8c5be1a4..a79de6c8 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -235,7 +235,7 @@ void Cmd_Give_f (gentity_t *ent) if (give_all || Q_stricmp(name, "weapons") == 0) { - BG_packWeapon( (1 << WP_NUM_WEAPONS) - 1 - ( 1 << WP_GRAPPLING_HOOK ) - ( 1 << WP_NONE ), ent->client->ps.stats ); + BG_packWeapon( (1 << WP_NUM_WEAPONS) - 1 - ( 1 << WP_NONE ), ent->client->ps.stats ); if (!give_all) return; } @@ -1875,6 +1875,13 @@ void Cmd_Buy_f( gentity_t *ent ) return; } + //are we /allowed/ to buy this? + if( !BG_FindPurchasableForWeapon( weapon ) ) + { + trap_SendServerCommand( ent-g_entities, va("print \"You can't buy this item\n\"" ) ); + return; + } + //add to inventory BG_packWeapon( weapon, ent->client->ps.stats ); BG_FindAmmoForWeapon( weapon, &quan, &clips, &maxClips ); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 5ac3126b..2d7fafce 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -113,7 +113,7 @@ void TossClientItems( gentity_t *self ) { // weapon that isn't the mg or gauntlet. Without this, a client // can pick up a weapon, be killed, and not drop the weapon because // their weapon change hasn't completed yet and they are still holding the MG. - if ( weapon == WP_MACHINEGUN || weapon == WP_GRAPPLING_HOOK ) { + if( weapon == WP_MACHINEGUN ) { if ( self->client->ps.weaponstate == WEAPON_DROPPING ) { weapon = self->client->pers.cmd.weapon; } @@ -122,10 +122,9 @@ void TossClientItems( gentity_t *self ) { } } - if( weapon > WP_MACHINEGUN && weapon != WP_GRAPPLING_HOOK && - ( ammo > 0 || clips > 0 ) ) { + if( weapon > WP_MACHINEGUN && ( ammo > 0 || clips > 0 ) ) { // find the item type for this weapon - item = BG_FindItemForWeapon( weapon ); + /*item = BG_FindItemForWeapon( weapon );*/ //TA: never drop weapons... // spawn the item diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 29583b64..77960646 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -264,14 +264,14 @@ void Use_Shooter( gentity_t *ent, gentity_t *other, gentity_t *activator ) { VectorNormalize( dir ); - switch ( ent->s.weapon ) { +/* switch ( ent->s.weapon ) { case WP_GRENADE_LAUNCHER: fire_grenade( ent, ent->s.origin, dir ); break; case WP_ROCKET_LAUNCHER: fire_rocket( ent, ent->s.origin, dir ); break; - } + }*/ G_AddEvent( ent, EV_FIRE_WEAPON, 0 ); } @@ -287,7 +287,7 @@ void InitShooter( gentity_t *ent, int weapon ) { ent->use = Use_Shooter; ent->s.weapon = weapon; - RegisterItem( BG_FindItemForWeapon( weapon ) ); + /*RegisterItem( BG_FindItemForWeapon( weapon ) );*/ G_SetMovedir( ent->s.angles, ent->movedir ); diff --git a/src/game/g_missile.c b/src/game/g_missile.c index c92edc17..84a64741 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -425,7 +425,7 @@ gentity_t *fire_grenade (gentity_t *self, vec3_t start, vec3_t dir) { bolt->think = G_ExplodeMissile; bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_GRENADE_LAUNCHER; + /*bolt->s.weapon = WP_GRENADE_LAUNCHER;*/ bolt->s.eFlags = EF_BOUNCE_HALF; bolt->r.ownerNum = self->s.number; bolt->parent = self; @@ -467,7 +467,7 @@ gentity_t *fire_bfg (gentity_t *self, vec3_t start, vec3_t dir) { bolt->think = G_ExplodeMissile; bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_BFG; + /*bolt->s.weapon = WP_BFG;*/ bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = 100; @@ -507,7 +507,7 @@ gentity_t *fire_rocket (gentity_t *self, vec3_t start, vec3_t dir) { bolt->think = G_ExplodeMissile; bolt->s.eType = ET_MISSILE; bolt->r.svFlags = SVF_USE_CURRENT_ORIGIN; - bolt->s.weapon = WP_ROCKET_LAUNCHER; + /*bolt->s.weapon = WP_ROCKET_LAUNCHER;*/ bolt->r.ownerNum = self->s.number; bolt->parent = self; bolt->damage = 100; @@ -582,7 +582,7 @@ gentity_t *fire_grapple (gentity_t *self, vec3_t start, vec3_t dir) { hook->think = Weapon_HookFree; hook->s.eType = ET_MISSILE; hook->r.svFlags = SVF_USE_CURRENT_ORIGIN; - hook->s.weapon = WP_GRAPPLING_HOOK; + /*hook->s.weapon = WP_GRAPPLING_HOOK;*/ hook->r.ownerNum = self->s.number; hook->methodOfDeath = MOD_GRAPPLE; hook->clipmask = MASK_SHOT; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index ab91f40c..a347e513 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -1022,27 +1022,27 @@ void FireWeapon2( gentity_t *ent ) // fire the specific weapon switch( ent->s.weapon ) { - case WP_GAUNTLET: +/* case WP_GAUNTLET: Weapon_Gauntlet( ent ); - break; + break;*/ case WP_TESLAGEN: Weapon_TeslaFire( ent ); break; - case WP_SHOTGUN: +/* case WP_SHOTGUN: weapon_supershotgun_fire( ent ); - break; + break;*/ case WP_MACHINEGUN: Bullet_Fire( ent, MACHINEGUN_SPREAD, MACHINEGUN_DAMAGE, MOD_MACHINEGUN ); break; case WP_CHAINGUN: Bullet_Fire( ent, CHAINGUN_SPREAD, CHAINGUN_DAMAGE, MOD_CHAINGUN ); break; - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: weapon_grenadelauncher_fire( ent ); - break; - case WP_ROCKET_LAUNCHER: + break;*/ +/* case WP_ROCKET_LAUNCHER: Weapon_RocketLauncher_Fire( ent ); - break; + break;*/ case WP_FLAMER: Weapon_Flamer_Fire( ent ); break; @@ -1052,20 +1052,20 @@ void FireWeapon2( gentity_t *ent ) case WP_PULSE_RIFLE: Weapon_PulseRifle_Fire( ent ); break; - case WP_RAILGUN: +/* case WP_RAILGUN: weapon_railgun_fire( ent ); - break; + break;*/ case WP_MASS_DRIVER: massDriverFire( ent ); break; case WP_LOCKBLOB_LAUNCHER: break; - case WP_BFG: +/* case WP_BFG: BFG_Fire( ent ); - break; - case WP_GRAPPLING_HOOK: + break;*/ +/* case WP_GRAPPLING_HOOK: Weapon_GrapplingHook_Fire( ent ); - break; + break;*/ case WP_VENOM: Weapon_Venom_Fire( ent ); break; @@ -1115,27 +1115,27 @@ void FireWeapon( gentity_t *ent ) // fire the specific weapon switch( ent->s.weapon ) { - case WP_GAUNTLET: +/* case WP_GAUNTLET: Weapon_Gauntlet( ent ); - break; + break;*/ case WP_TESLAGEN: Weapon_TeslaFire( ent ); break; - case WP_SHOTGUN: +/* case WP_SHOTGUN: weapon_supershotgun_fire( ent ); - break; + break;*/ case WP_MACHINEGUN: Bullet_Fire( ent, MACHINEGUN_SPREAD, MACHINEGUN_DAMAGE, MOD_MACHINEGUN ); break; case WP_CHAINGUN: Bullet_Fire( ent, CHAINGUN_SPREAD, CHAINGUN_DAMAGE, MOD_CHAINGUN ); break; - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: weapon_grenadelauncher_fire( ent ); - break; - case WP_ROCKET_LAUNCHER: + break;*/ +/* case WP_ROCKET_LAUNCHER: Weapon_RocketLauncher_Fire( ent ); - break; + break;*/ case WP_FLAMER: Weapon_Flamer_Fire( ent ); break; @@ -1145,21 +1145,21 @@ void FireWeapon( gentity_t *ent ) case WP_PULSE_RIFLE: Weapon_PulseRifle_Fire( ent ); break; - case WP_RAILGUN: +/* case WP_RAILGUN: weapon_railgun_fire( ent ); - break; + break;*/ case WP_MASS_DRIVER: massDriverFire( ent ); break; case WP_LOCKBLOB_LAUNCHER: Weapon_LockBlobLauncher_Fire( ent ); break; - case WP_BFG: +/* case WP_BFG: BFG_Fire( ent ); - break; - case WP_GRAPPLING_HOOK: + break;*/ +/* case WP_GRAPPLING_HOOK: Weapon_GrapplingHook_Fire( ent ); - break; + break;*/ case WP_VENOM: Weapon_Venom_Fire( ent ); break; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 50fbeec6..b16ec3a7 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -2887,7 +2887,7 @@ static void UI_LoadTremHumanMCUBuys( ) for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ ) { - if( BG_FindTeamForWeapon( i ) == WUT_HUMANS ) + if( BG_FindTeamForWeapon( i ) == WUT_HUMANS && BG_FindPurchasableForWeapon( i ) ) { uiInfo.tremHumanMCUBuyList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); diff --git a/src/ui/ui_players.c b/src/ui/ui_players.c index f8e6f982..a2745552 100644 --- a/src/ui/ui_players.c +++ b/src/ui/ui_players.c @@ -60,15 +60,6 @@ tryagain: return; } - for ( item = bg_itemlist + 1; item->classname ; item++ ) { - if ( item->giType != IT_WEAPON ) { - continue; - } - if ( item->giTag == weaponNum ) { - break; - } - } - if ( item->classname ) { pi->weaponModel = trap_R_RegisterModel( item->world_model[0] ); } @@ -82,7 +73,7 @@ tryagain: goto tryagain; } - if ( weaponNum == WP_MACHINEGUN || weaponNum == WP_GAUNTLET || weaponNum == WP_BFG ) { + if ( weaponNum == WP_MACHINEGUN ) { strcpy( path, item->world_model[0] ); COM_StripExtension( path, path ); strcat( path, "_barrel.md3" ); @@ -95,45 +86,45 @@ tryagain: pi->flashModel = trap_R_RegisterModel( path ); switch( weaponNum ) { - case WP_GAUNTLET: +/* case WP_GAUNTLET: MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; + break;*/ case WP_MACHINEGUN: MAKERGB( pi->flashDlightColor, 1, 1, 0 ); break; - case WP_SHOTGUN: +/* case WP_SHOTGUN: MAKERGB( pi->flashDlightColor, 1, 1, 0 ); - break; + break;*/ - case WP_GRENADE_LAUNCHER: +/* case WP_GRENADE_LAUNCHER: MAKERGB( pi->flashDlightColor, 1, 0.7f, 0.5f ); - break; + break;*/ - case WP_ROCKET_LAUNCHER: +/* case WP_ROCKET_LAUNCHER: MAKERGB( pi->flashDlightColor, 1, 0.75f, 0 ); - break; + break;*/ case WP_TESLAGEN: MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); break; - case WP_RAILGUN: +/* case WP_RAILGUN: MAKERGB( pi->flashDlightColor, 1, 0.5f, 0 ); - break; + break;*/ case WP_PLASMAGUN: MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); break; - case WP_BFG: +/* case WP_BFG: MAKERGB( pi->flashDlightColor, 1, 0.7f, 1 ); - break; + break;*/ - case WP_GRAPPLING_HOOK: +/* case WP_GRAPPLING_HOOK: MAKERGB( pi->flashDlightColor, 0.6f, 0.6f, 1 ); - break; + break;*/ default: MAKERGB( pi->flashDlightColor, 1, 1, 1 ); @@ -828,7 +819,7 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti // // add the spinning barrel // - if ( pi->realWeapon == WP_MACHINEGUN || pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { + if ( pi->realWeapon == WP_MACHINEGUN ) { vec3_t angles; memset( &barrel, 0, sizeof(barrel) ); @@ -839,10 +830,10 @@ void UI_DrawPlayer( float x, float y, float w, float h, playerInfo_t *pi, int ti angles[YAW] = 0; angles[PITCH] = 0; angles[ROLL] = UI_MachinegunSpinAngle( pi ); - if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { +/* if( pi->realWeapon == WP_GAUNTLET || pi->realWeapon == WP_BFG ) { angles[PITCH] = angles[ROLL]; angles[ROLL] = 0; - } + }*/ AnglesToAxis( angles, barrel.axis ); UI_PositionRotatedEntityOnTag( &barrel, &gun, pi->weaponModel, "tag_barrel"); @@ -1338,7 +1329,7 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_ // torso animation if ( torsoAnim == TORSO_STAND || torsoAnim == TORSO_STAND2 ) { - if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) { + if ( weaponNum == WP_NONE ) { torsoAnim = TORSO_STAND2; } else { @@ -1347,7 +1338,7 @@ void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_ } if ( torsoAnim == TORSO_ATTACK || torsoAnim == TORSO_ATTACK2 ) { - if ( weaponNum == WP_NONE || weaponNum == WP_GAUNTLET ) { + if ( weaponNum == WP_NONE ) { torsoAnim = TORSO_ATTACK2; } else { |