diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 17 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 1 | ||||
-rw-r--r-- | src/cgame/cg_players.c | 28 | ||||
-rw-r--r-- | src/cgame/cg_tutorial.c | 4 |
4 files changed, 14 insertions, 36 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index c8f75da0..374c7a75 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -316,14 +316,17 @@ static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean p value = ps->persistant[ PERS_CREDIT ]; if( value > -1 ) { - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS && - !CG_AtHighestClass( ) ) + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS ) { - if( cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME ) + if( !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_PCLASS ], + value, cgs.alienStage ) && + cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME && + ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) & 1 ) { - if( ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) % 2 ) - color[ 3 ] = 0.0f; + color[ 3 ] = 0.0f; } + + value /= ALIEN_CREDITS_PER_FRAG; } trap_R_SetColor( color ); @@ -1931,7 +1934,9 @@ void CG_DrawWeaponIcon( rectDef_t *rect, vec4_t color ) } } - if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS && CG_AtHighestClass( ) ) + if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS && + !BG_AlienCanEvolve( cg.predictedPlayerState.stats[ STAT_PCLASS ], + ps->persistant[ PERS_CREDIT ], cgs.alienStage ) ) { if( cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME ) { diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 00ddb519..f14c7b40 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1619,7 +1619,6 @@ void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin ); sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ); void CG_PlayerDisconnect( vec3_t org ); void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum ); -qboolean CG_AtHighestClass( void ); // // cg_buildable.c diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c index ad517800..95ec60bb 100644 --- a/src/cgame/cg_players.c +++ b/src/cgame/cg_players.c @@ -2464,31 +2464,3 @@ void CG_Bleed( vec3_t origin, vec3_t normal, int entityNum ) } } -/* -=============== -CG_AtHighestClass - -Is the local client at the highest class possible? -=============== -*/ -qboolean CG_AtHighestClass( void ) -{ - int i; - qboolean superiorClasses = qfalse; - - for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ ) - { - if( BG_ClassCanEvolveFromTo( - cg.predictedPlayerState.stats[ STAT_PCLASS ], i, - ALIEN_MAX_KILLS, 0 ) >= 0 && - BG_FindStagesForClass( i, cgs.alienStage ) && - BG_ClassIsAllowed( i ) ) - { - superiorClasses = qtrue; - break; - } - } - - return !superiorClasses; -} - diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c index bfcd03ac..7d08a6d2 100644 --- a/src/cgame/cg_tutorial.c +++ b/src/cgame/cg_tutorial.c @@ -671,7 +671,9 @@ const char *CG_TutorialText( void ) va( "Press %s to enter the hovel\n", CG_KeyNameForCommand( "+button7" ) ) ); } - else if( BG_UpgradeClassAvailable( ps ) ) + else if( BG_AlienCanEvolve( ps->stats[ STAT_PCLASS ], + ps->persistant[ PERS_CREDIT ], + cgs.alienStage ) ) { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to evolve\n", |