diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_buildable.c | 28 | ||||
-rw-r--r-- | src/cgame/cg_draw.c | 16 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 64 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 23 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 11 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 8 | ||||
-rw-r--r-- | src/cgame/cg_predict.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 217 | ||||
-rw-r--r-- | src/cgame/cg_weapons.c | 42 |
9 files changed, 281 insertions, 130 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 3b462dec..0c334e7b 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -925,6 +925,8 @@ static void CG_BuildableHealthBar( centity_t *cent ) } } +#define BUILDABLE_SOUND_PERIOD 500 + /* ================== CG_Buildable @@ -940,6 +942,8 @@ void CG_Buildable( centity_t *cent ) float rotAngle; buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex ); float scale; + int health; + float healthScale; //must be before EF_NODRAW check if( team == BIT_ALIENS ) @@ -1132,12 +1136,34 @@ void CG_Buildable( centity_t *cent ) if( weapon->wim[ WPM_PRIMARY ].firingSound ) { - trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, weapon->wim[ WPM_PRIMARY ].firingSound ); + trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, + weapon->wim[ WPM_PRIMARY ].firingSound ); } else if( weapon->readySound ) trap_S_AddLoopingSound( es->number, cent->lerpOrigin, vec3_origin, weapon->readySound ); } + health = es->generic1 & ~( B_POWERED_TOGGLEBIT | B_DCCED_TOGGLEBIT | B_SPAWNED_TOGGLEBIT ); + healthScale = (float)health / B_HEALTH_SCALE; + + if( healthScale < cent->lastBuildableHealthScale && ( es->generic1 & B_SPAWNED_TOGGLEBIT ) ) + { + if( cent->lastBuildableDamageSoundTime + BUILDABLE_SOUND_PERIOD < cg.time ) + { + if( team == BIT_HUMANS ) + { + int i = rand( ) % 4; + trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.humanBuildableDamage[ i ] ); + } + else if( team == BIT_ALIENS ) + trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.alienBuildableDamage ); + + cent->lastBuildableDamageSoundTime = cg.time; + } + } + + cent->lastBuildableHealthScale = healthScale; + //smoke etc for damaged buildables CG_BuildableParticleEffects( cent ); } diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index f5fb5487..9cb1740c 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -896,7 +896,7 @@ static void CG_DrawPlayerPoisonBarbs( rectDef_t *rect, vec4_t color, qhandle_t s qboolean vertical; int iconsize, numBarbs, i; - BG_UnpackAmmoArray( ps->weapon, ps->ammo, ps->powerups, &numBarbs, NULL, NULL ); + BG_UnpackAmmoArray( ps->weapon, ps->ammo, ps->powerups, &numBarbs, NULL ); if( height > width ) { @@ -981,7 +981,7 @@ static void CG_DrawPlayerAmmoValue( rectDef_t *rect, vec4_t color ) break; default: - BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &value, NULL, NULL ); + BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &value, NULL ); break; } @@ -1140,7 +1140,7 @@ static void CG_DrawPlayerClipsValue( rectDef_t *rect, vec4_t color ) break; default: - BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value, NULL ); + BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, NULL, &value ); if( value > -1 ) { @@ -1433,7 +1433,7 @@ float CG_GetValue( int ownerDraw ) int value; BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, - &value, NULL, NULL ); + &value, NULL ); return value; } @@ -1444,7 +1444,7 @@ float CG_GetValue( int ownerDraw ) int value; BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, - NULL, &value, NULL ); + NULL, &value ); return value; } @@ -2309,15 +2309,15 @@ CG_DrawWeaponIcon */ void CG_DrawWeaponIcon( rectDef_t *rect, vec4_t color ) { - int ammo, clips, maxAmmo, maxClips; + int ammo, clips, maxAmmo; centity_t *cent; playerState_t *ps; cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; - BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL ); - BG_FindAmmoForWeapon( cent->currentState.weapon, &maxAmmo, &maxClips, NULL ); + BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &ammo, &clips ); + BG_FindAmmoForWeapon( cent->currentState.weapon, &maxAmmo, NULL ); // don't display if dead if( cg.predictedPlayerState.stats[ STAT_HEALTH ] <= 0 ) diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index 1ed6cb2e..df269155 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -758,6 +758,64 @@ static void CG_LightFlare( centity_t *cent ) /* ========================= +CG_Lev2ZapChain +========================= +*/ +static void CG_Lev2ZapChain( centity_t *cent ) +{ + int i = 0; + entityState_t *es; + vec3_t start, end; + centity_t *source, *target; + + es = ¢->currentState; + + if( es->time > 0 ) + { + source = &cg_entities[ es->powerups ]; + target = &cg_entities[ es->time ]; + + if( es->powerups == cg.predictedPlayerState.clientNum ) + VectorCopy( cg.predictedPlayerState.origin, start ); + else + VectorCopy( source->currentState.pos.trBase, start ); + + VectorCopy( target->currentState.pos.trBase, end ); + + CG_DynamicLightningBolt( cgs.media.lightningShader, start, end, + 1+((cg.time%((i+2)*(i+3)))+i)%2, 7 + (float)(i%3)*5 + 6.0*random(), + qtrue, 1.0, 0, i*i*3 ); + } + + if( es->time2 > 0 ) + { + source = &cg_entities[ es->time ]; + target = &cg_entities[ es->time2 ]; + + VectorCopy( source->currentState.pos.trBase, start ); + VectorCopy( target->currentState.pos.trBase, end ); + + CG_DynamicLightningBolt( cgs.media.lightningShader, start, end, + 1+((cg.time%((i+2)*(i+3)))+i)%2, 7 + (float)(i%3)*5 + 6.0*random(), + qtrue, 1.0, 0, i*i*3 ); + } + + if( es->constantLight > 0 ) + { + source = &cg_entities[ es->time2 ]; + target = &cg_entities[ es->constantLight ]; + + VectorCopy( source->currentState.pos.trBase, start ); + VectorCopy( target->currentState.pos.trBase, end ); + + CG_DynamicLightningBolt( cgs.media.lightningShader, start, end, + 1+((cg.time%((i+2)*(i+3)))+i)%2, 7 + (float)(i%3)*5 + 6.0*random(), + qtrue, 1.0, 0, i*i*3 ); + } +} + +/* +========================= CG_AdjustPositionForMover Also called by client movement prediction code @@ -1010,6 +1068,10 @@ static void CG_AddCEntity( centity_t *cent ) case ET_LIGHTFLARE: CG_LightFlare( cent ); break; + + case ET_LEV2_ZAP_CHAIN: + CG_Lev2ZapChain( cent ); + break; } } @@ -1122,7 +1184,7 @@ void CG_AddPacketEntities( void ) mins[ 2 ] = -zd; maxs[ 2 ] = zu; - CG_DrawBoundingBox( es->origin, mins, maxs ); + CG_DrawBoundingBox( cent->lerpOrigin, mins, maxs ); break; default: diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 049cea33..4ac8f984 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -376,7 +376,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) const char *s; int clientNum; clientInfo_t *ci; - int steptime, i; + int steptime; if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) steptime = 200; @@ -767,28 +767,12 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) CG_AlienBuildableExplosion( position, dir ); break; - case EV_HUMAN_BUILDABLE_DAMAGE: - DEBUGNAME( "EV_HUMAN_BUILDABLE_DAMAGE" ); - i = rand( ) % 4; - trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.humanBuildableDamage[ i ] ); - break; - - case EV_ALIEN_BUILDABLE_DAMAGE: - DEBUGNAME( "EV_ALIEN_BUILDABLE_DAMAGE" ); - trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.alienBuildableDamage ); - break; - case EV_TESLATRAIL: DEBUGNAME( "EV_TESLATRAIL" ); cent->currentState.weapon = WP_TESLAGEN; CG_TeslaTrail( es->origin2, es->pos.trBase, es->generic1, es->clientNum ); break; - case EV_ALIENZAP: - DEBUGNAME( "EV_ALIENZAP" ); - CG_AlienZap( es->origin2, es->pos.trBase, es->generic1, es->clientNum ); - break; - case EV_BULLET_HIT_WALL: DEBUGNAME( "EV_BULLET_HIT_WALL" ); ByteToDir( es->eventParm, dir ); @@ -955,6 +939,11 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) } break; + case EV_MEDKIT_USED: + DEBUGNAME( "EV_MEDKIT_USED" ); + trap_S_StartSound( NULL, es->number, CHAN_AUTO, cgs.media.medkitUseSound ); + break; + case EV_PLAYER_RESPAWN: DEBUGNAME( "EV_PLAYER_RESPAWN" ); if( es->number == cg.clientNum ) diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 821972d9..d12e8001 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -479,6 +479,8 @@ typedef struct centity_s buildableAnimNumber_t buildableAnim; //persistant anim number buildableAnimNumber_t oldBuildableAnim; //to detect when new anims are set particleSystem_t *buildablePS; + float lastBuildableHealthScale; + int lastBuildableDamageSoundTime; lightFlareStatus_t lfs; @@ -1194,7 +1196,8 @@ typedef struct qhandle_t jetPackHoverPS; qhandle_t jetPackAscendPS; - //TA: + sfxHandle_t medkitUseSound; + sfxHandle_t alienStageTransition; sfxHandle_t humanStageTransition; @@ -1220,8 +1223,6 @@ typedef struct //TA: for wolf trail effects qhandle_t sparkFlareShader; - //TA: media used for armour switching stuff - //light armour qhandle_t larmourHeadSkin; qhandle_t larmourLegsSkin; @@ -1393,7 +1394,6 @@ extern vmCvar_t cg_debugAnim; extern vmCvar_t cg_debugPosition; extern vmCvar_t cg_debugEvents; extern vmCvar_t cg_teslaTrailTime; -extern vmCvar_t cg_alienZapTime; extern vmCvar_t cg_railTrailTime; extern vmCvar_t cg_errorDecay; extern vmCvar_t cg_nopredict; @@ -1467,7 +1467,7 @@ extern vmCvar_t cg_consoleLatency; extern vmCvar_t cg_lightFlare; extern vmCvar_t cg_debugParticles; extern vmCvar_t cg_debugPVS; -extern vmCvar_t cg_disableBuildWarnings; +extern vmCvar_t cg_disableWarningDialogs; extern vmCvar_t cg_disableScannerPlane; //TA: hack to get class an carriage through to UI module @@ -1663,7 +1663,6 @@ void CG_Bullet( vec3_t origin, int sourceEntityNum, vec3_t normal, qboole void CG_ShotgunFire( entityState_t *es ); void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum ); -void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum ); void CG_AddViewWeapon (playerState_t *ps); void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent ); void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 056fd76f..8a657ab7 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -96,7 +96,6 @@ upgradeInfo_t cg_upgrades[ 32 ]; buildableInfo_t cg_buildables[ BA_NUM_BUILDABLES ]; vmCvar_t cg_teslaTrailTime; -vmCvar_t cg_alienZapTime; vmCvar_t cg_railTrailTime; vmCvar_t cg_centertime; vmCvar_t cg_runpitch; @@ -200,7 +199,7 @@ vmCvar_t cg_consoleLatency; vmCvar_t cg_lightFlare; vmCvar_t cg_debugParticles; vmCvar_t cg_debugPVS; -vmCvar_t cg_disableBuildWarnings; +vmCvar_t cg_disableWarningDialogs; vmCvar_t cg_disableScannerPlane; //TA: hack to get class and carriage through to UI module @@ -254,7 +253,6 @@ static cvarTable_t cvarTable[ ] = { &cg_addMarks, "cg_marks", "1", CVAR_ARCHIVE }, { &cg_lagometer, "cg_lagometer", "0", CVAR_ARCHIVE }, { &cg_teslaTrailTime, "cg_teslaTrailTime", "600", CVAR_ARCHIVE }, - { &cg_alienZapTime, "cg_alienZapTime", "500", CVAR_ARCHIVE }, { &cg_railTrailTime, "cg_railTrailTime", "400", CVAR_ARCHIVE }, { &cg_gun_x, "cg_gunX", "0", CVAR_CHEAT }, { &cg_gun_y, "cg_gunY", "0", CVAR_CHEAT }, @@ -305,7 +303,7 @@ static cvarTable_t cvarTable[ ] = { &cg_lightFlare, "cg_lightFlare", "3", CVAR_ARCHIVE }, { &cg_debugParticles, "cg_debugParticles", "0", CVAR_CHEAT }, { &cg_debugPVS, "cg_debugPVS", "0", CVAR_CHEAT }, - { &cg_disableBuildWarnings, "cg_disableBuildWarnings", "0", CVAR_ARCHIVE }, + { &cg_disableWarningDialogs, "cg_disableWarningDialogs", "0", CVAR_ARCHIVE }, { &cg_disableScannerPlane, "cg_disableScannerPlane", "0", CVAR_ARCHIVE }, { &cg_hudFiles, "cg_hudFiles", "ui/hud.txt", CVAR_ARCHIVE}, @@ -680,6 +678,8 @@ static void CG_RegisterSounds( void ) cgs.media.jetpackDescendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/low.wav", qfalse ); cgs.media.jetpackIdleSound = trap_S_RegisterSound( "sound/upgrades/jetpack/idle.wav", qfalse ); cgs.media.jetpackAscendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/hi.wav", qfalse ); + + cgs.media.medkitUseSound = trap_S_RegisterSound( "sound/upgrades/medkit/medkit.wav", qfalse ); cgs.media.alienEvolveSound = trap_S_RegisterSound( "sound/player/alienevolve.wav", qfalse ); diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index 548efb86..d66fd653 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -63,7 +63,7 @@ void CG_BuildSolidList( void ) continue; } - if( cent->nextState.solid ) + if( cent->nextState.solid && ent->eType != ET_MISSILE ) { cg_solidEntities[ cg_numSolidEntities ] = cent; cg_numSolidEntities++; diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index e529d1ab..90b74f8c 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -556,7 +556,8 @@ static void CG_SetUIVars( void ) } for( i = UP_NONE + 1; i < UP_NUM_UPGRADES; i++ ) { - if( BG_InventoryContainsUpgrade( i, cg.snap->ps.stats ) ) + if( BG_InventoryContainsUpgrade( i, cg.snap->ps.stats ) && + BG_FindPurchasableForUpgrade( i ) ) strcat( carriageCvar, va( "U%d ", i ) ); } strcat( carriageCvar, "$" ); @@ -598,107 +599,158 @@ void CG_Menu( int menu ) break; case MN_H_NOROOM: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no room to build here. Move until the buildable turns " "translucent green indicating a valid build location." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "There is no room to build here\n" ); + break; case MN_H_NOPOWER: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no power remaining. Free up power by destroying existing " "buildable objects." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "There is no power remaining\n" ); + break; case MN_H_NOTPOWERED: - trap_Cvar_Set( "ui_dialog", "This buildable is not powered. Build a reactor and/or repeater in " - "order to power it." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "This buildable is not powered. Build a Reactor and/or Repeater in " + "order to power it." ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + } + else + CG_Printf( "This buildable is not powered\n" ); + break; case MN_H_NORMAL: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "Cannot build on this surface. The surface is too steep or unsuitable " "to build on. Please choose another site for this structure." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "Cannot build on this surface\n" ); + break; case MN_H_REACTOR: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { - trap_Cvar_Set( "ui_dialog", "There can only be one reactor. Destroy the existing one if you " + trap_Cvar_Set( "ui_dialog", "There can only be one Reactor. Destroy the existing one if you " "wish to move it." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "There can only be one Reactor\n" ); + break; case MN_H_REPEATER: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no power here. If available, a Repeater may be used to " "transmit power to this location." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "There is no power here\n" ); + break; case MN_H_NODCC: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no Defense Computer. A Defense Computer is needed to build " "this." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "There is no Defense Computer\n" ); + break; case MN_H_TNODEWARN: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { - trap_Cvar_Set( "ui_dialog", "WARNING: This telenode will not be powered. Build near a power " + trap_Cvar_Set( "ui_dialog", "WARNING: This Telenode will not be powered. Build near a power " "structure to prevent seeing this message again." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "This Telenode will not be powered\n" ); + break; case MN_H_RPTWARN: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { - trap_Cvar_Set( "ui_dialog", "WARNING: This repeater will not be powered as there is no parent " - "reactor providing power. Build a reactor." ); + trap_Cvar_Set( "ui_dialog", "WARNING: This Repeater will not be powered as there is no parent " + "Reactor providing power. Build a Reactor." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "This Repeater will not be powered\n" ); + break; case MN_H_RPTWARN2: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { - trap_Cvar_Set( "ui_dialog", "This area already has power. A repeater is not required here." ); + trap_Cvar_Set( "ui_dialog", "This area already has power. A Repeater is not required here." ); trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); } + else + CG_Printf( "This area already has power\n" ); + break; case MN_H_NOSLOTS: - trap_Cvar_Set( "ui_dialog", "You have no room to carry this. Please sell any conflicting " - "upgrades before purchasing this item." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "You have no room to carry this. Please sell any conflicting " + "upgrades before purchasing this item." ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + } + else + CG_Printf( "You have no room to carry this\n" ); + break; case MN_H_NOFUNDS: - trap_Cvar_Set( "ui_dialog", "Insufficient funds. You do not have enough credits to perform this " - "action." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "Insufficient funds. You do not have enough credits to perform this " + "action." ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + } + else + CG_Printf( "Insufficient funds\n" ); + break; case MN_H_ITEMHELD: - trap_Cvar_Set( "ui_dialog", "You already hold this item. It is not possible to carry multiple items " - "of the same type." ); - trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "You already hold this item. It is not possible to carry multiple items " + "of the same type." ); + trap_SendConsoleCommand( "menu tremulous_human_dialog\n" ); + } + else + CG_Printf( "You already hold this item\n" ); + break; @@ -706,103 +758,160 @@ void CG_Menu( int menu ) case MN_A_NOROOM: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no room to build here. Move until the structure turns " "translucent green indicating a valid build location." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "There is no room to build here\n" ); + break; case MN_A_NOCREEP: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no creep here. You must build near existing Eggs or " "the Overmind. Alien structures will not support themselves." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "There is no creep here\n" ); + break; case MN_A_NOOVMND: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to control " "the structure you tried to place" ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "There is no Overmind\n" ); + break; case MN_A_OVERMIND: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "There can only be one Overmind. Destroy the existing one if you " "wish to move it." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "There can only be one Overmind\n" ); + break; case MN_A_NOASSERT: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { - trap_Cvar_Set( "ui_dialog", "The Overmind cannot control anymore structures. Destroy existing " + trap_Cvar_Set( "ui_dialog", "The Overmind cannot control any more structures. Destroy existing " "structures to build more." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "The Overmind cannot control any more structures\n" ); + break; case MN_A_SPWNWARN: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "WARNING: This spawn will not be controlled by an Overmind. " "Build an Overmind to prevent seeing this message again." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "This spawn will not be controlled by an Overmind\n" ); + break; case MN_A_NORMAL: - if( !cg_disableBuildWarnings.integer ) + if( !cg_disableWarningDialogs.integer ) { trap_Cvar_Set( "ui_dialog", "Cannot build on this surface. This surface is too steep or unsuitable " "to build on. Please choose another site for this structure." ); trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); } + else + CG_Printf( "Cannot build on this surface\n" ); + break; case MN_A_NOEROOM: - trap_Cvar_Set( "ui_dialog", "There is no room to evolve here. Move away from walls or other " - "nearby objects and try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "There is no room to evolve here. Move away from walls or other " + "nearby objects and try again." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "There is no room to evolve here\n" ); + break; case MN_A_TOOCLOSE: - trap_Cvar_Set( "ui_dialog", "This location is too close to the enemy to evolve. " - "Move away until you are no longer aware of the enemy's " - "presence and try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "This location is too close to the enemy to evolve. " + "Move away until you are no longer aware of the enemy's " + "presence and try again." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "This location is too close to the enemy to evolve\n" ); + break; case MN_A_NOOVMND_EVOLVE: - trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to allow " - "you to upgrade." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "There is no Overmind. An Overmind must be built to allow " + "you to upgrade." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "There is no Overmind\n" ); + break; case MN_A_HOVEL_OCCUPIED: - trap_Cvar_Set( "ui_dialog", "This Hovel is occupied by another builder. Please find or build " - "another." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "This Hovel is occupied by another builder. Please find or build " + "another." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "This Hovel is occupied by another builder\n" ); + break; case MN_A_HOVEL_BLOCKED: - trap_Cvar_Set( "ui_dialog", "The exit to this Hovel is currently blocked. Please wait until it " - "becomes clear then try again." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "The exit to this Hovel is currently blocked. Please wait until it " + "becomes clear then try again." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "The exit to this Hovel is currently blocked\n" ); + break; case MN_A_HOVEL_EXIT: - trap_Cvar_Set( "ui_dialog", "The exit to this Hovel will always be blocked. Please choose " - "a more suitable location." ); - trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + if( !cg_disableWarningDialogs.integer ) + { + trap_Cvar_Set( "ui_dialog", "The exit to this Hovel would always be blocked. Please choose " + "a more suitable location." ); + trap_SendConsoleCommand( "menu tremulous_alien_dialog\n" ); + } + else + CG_Printf( "The exit to this Hovel would always be blocked\n" ); + break; case MN_A_INFEST: diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index afd9bb45..c67eaa04 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -186,36 +186,6 @@ void CG_TeslaTrail( vec3_t start, vec3_t end, int srcENum, int destENum ) VectorCopy( end, re->oldorigin ); } -/* -========================== -CG_AlienZap -========================== -*/ -void CG_AlienZap( vec3_t start, vec3_t end, int srcENum, int destENum ) -{ - localEntity_t *le; - refEntity_t *re; - - //add a bunch of bolt segments - le = CG_AllocLocalEntity(); - re = &le->refEntity; - - le->leType = LE_LIGHTNING_BOLT; - le->startTime = cg.time; - le->endTime = cg.time + cg_alienZapTime.value; - le->lifeRate = 1.0 / ( le->endTime - le->startTime ); - re->customShader = cgs.media.lightningShader; - - le->srcENum = srcENum; - le->destENum = destENum; - le->vOffset = 6.0f; - - le->maxRange = LEVEL2_AREAZAP_RANGE * M_ROOT3; - - VectorCopy( start, re->origin ); - VectorCopy( end, re->oldorigin ); -} - /* ================= @@ -1362,16 +1332,12 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) int length; int selectWindow; qboolean vertical; - int ammo, clips, maxAmmo, maxClips; centity_t *cent; playerState_t *ps; cent = &cg_entities[ cg.snap->ps.clientNum ]; ps = &cg.snap->ps; - BG_UnpackAmmoArray( cent->currentState.weapon, ps->ammo, ps->powerups, &ammo, &clips, NULL ); - BG_FindAmmoForWeapon( cent->currentState.weapon, &maxAmmo, &maxClips, NULL ); - // don't display if dead if( cg.predictedPlayerState.stats[ STAT_HEALTH ] <= 0 ) return; @@ -1504,13 +1470,13 @@ CG_WeaponSelectable */ static qboolean CG_WeaponSelectable( int i ) { - int ammo, clips, maxclips; + int ammo, clips; - BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips, &maxclips ); + BG_UnpackAmmoArray( i, cg.snap->ps.ammo, cg.snap->ps.powerups, &ammo, &clips ); //TA: this is a pain in the ass -/* if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) - return qfalse;*/ + //if( !ammo && !clips && !BG_FindInfinteAmmoForWeapon( i ) ) + // return qfalse; if( !BG_InventoryContainsWeapon( i, cg.snap->ps.stats ) ) return qfalse; |