From c77c95816fbbecba5994825d9b68b749ac7c0fe4 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Mon, 6 Apr 2020 11:03:23 +0200 Subject: Fractional evos - initial commit I probably missed something; this needs proper testing. --- src/cgame/cg_draw.c | 7 ++++--- src/cgame/cg_main.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/cgame') diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 33a275a..cea2527 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -539,10 +539,11 @@ 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 ) + value = floor( value / EVO_TO_CREDS_RATE ); + + if( !CG_AtHighestClass( ) && cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME ) { if( ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) % 2 ) color[ 3 ] = 0.0f; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 89a4c5c..36a9577 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -489,6 +489,7 @@ static void CG_SetPVars( void ) trap_Cvar_Set( "player_stage", va( "%d", cgs.alienStage+1 ) ); trap_Cvar_Set( "player_bp", va( "%d", cgs.alienBuildPoints )); trap_Cvar_Set( "player_maxbp", va( "%d", cgs.alienBuildPointsTotal )); + trap_Cvar_Set( "player_credits", va( "%f", ps->persistant[ PERS_CREDIT ] / EVO_TO_CREDS_RATE ) ); break; case PTE_HUMANS: @@ -498,10 +499,10 @@ static void CG_SetPVars( void ) trap_Cvar_Set( "player_kns", va( "%d",((cgs.humanStage==2)?0:abs(cgs.humanNextStageThreshold-cgs.humanKills)))); trap_Cvar_Set( "player_bp", va( "%d", cgs.humanBuildPoints )); trap_Cvar_Set( "player_maxbp", va( "%d", cgs.humanBuildPointsTotal )); + trap_Cvar_Set( "player_credits", va( "%d", ps->persistant[ PERS_CREDIT ] ) ); break; } - trap_Cvar_Set( "player_credits", va( "%d", ps->persistant[ PERS_CREDIT ] ) ); trap_Cvar_Set( "player_score", va( "%d", ps->persistant[ PERS_SCORE ] ) ); trap_Cvar_Set( "player_deaths", va( "%d", ps->persistant[ PERS_KILLED ] ) ); -- cgit