summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c8
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_tutorial.c22
3 files changed, 26 insertions, 5 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index bbeb9848..ddfc9fb9 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -715,12 +715,18 @@ static void CG_DrawUsableBuildable( rectDef_t *rect, qhandle_t shader, vec4_t co
if( ( es->modelindex == BA_H_REACTOR || es->modelindex == BA_H_REPEATER ) &&
( !BG_Weapon( cg.snap->ps.weapon )->usesEnergy ||
BG_Weapon( cg.snap->ps.weapon )->infiniteAmmo ) )
+ {
+ cg.nearUsableBuildable = qfalse;
return;
+ }
trap_R_SetColor( color );
CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
trap_R_SetColor( NULL );
+ cg.nearUsableBuildable = qtrue;
}
+ else
+ cg.nearUsableBuildable = qfalse;
}
@@ -2903,7 +2909,7 @@ static void CG_DrawLighting( void )
cent = &cg_entities[ cg.snap->ps.clientNum ];
//fade to black if stamina is low
- if( ( cg.snap->ps.stats[ STAT_STAMINA ] < -800 ) &&
+ if( ( cg.snap->ps.stats[ STAT_STAMINA ] < STAMINA_BLACKOUT_LEVEL ) &&
( cg.snap->ps.stats[ STAT_TEAM ] == TEAM_HUMANS ) )
{
vec4_t black = { 0, 0, 0, 0 };
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 6b146653..a51e718a 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1155,6 +1155,7 @@ typedef struct
float chargeMeterValue;
qhandle_t lastHealthCross;
float healthCrossFade;
+ int nearUsableBuildable;
int nextWeaponClickTime;
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 38dd52f4..ef421ec6 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -524,16 +524,30 @@ static void CG_HumanText( char *text, playerState_t *ps )
BG_Upgrade( UP_MEDKIT )->humanName ) );
}
- Q_strcat( text, MAX_TUTORIAL_TEXT,
- va( "Press %s to use a structure\n",
- CG_KeyNameForCommand( "+button7" ) ) );
+ if( ps->stats[ STAT_STAMINA ] <= STAMINA_BLACKOUT_LEVEL )
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ "You are blacking out. Stop sprinting to recover stamina.\n" );
+ }
+ else if( ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL )
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ "Your stamina is low. Stop sprinting to recover.\n" );
+ }
+
+ if( cg.nearUsableBuildable )
+ {
+ Q_strcat( text, MAX_TUTORIAL_TEXT,
+ va( "Press %s to use this structure\n",
+ CG_KeyNameForCommand( "+button7" ) ) );
+ }
Q_strcat( text, MAX_TUTORIAL_TEXT,
va( "Press %s and any direction to sprint\n",
CG_KeyNameForCommand( "+button8" ) ) );
Q_strcat( text, MAX_TUTORIAL_TEXT,
- va( "Press %s and back, left-strafe, or right-strafe to dodge\n",
+ va( "Press %s and back or strafe to dodge\n",
CG_KeyNameForCommand( "+button6" ) ) );
}