summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-26 19:11:43 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:08 +0000
commit86509e9172baeb702ca8343120791fefdf663bfa (patch)
treed89f28ae5b172940b613e9a360f13759a4bf9d1b /src
parent54161abc42b98c89604eeea5bf960eb48407f6b8 (diff)
* Tutorial text no longer prints how to use a buildable if you aren't near a usable buildable
* Tutorial text explains low-stamina states
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c8
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_tutorial.c22
-rw-r--r--src/game/bg_pmove.c2
-rw-r--r--src/game/tremulous.h2
5 files changed, 29 insertions, 6 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" ) ) );
}
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 5d51c34a..80d33066 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -431,7 +431,7 @@ static float PM_CmdScale( usercmd_t *cmd )
cmd->upmove = 0;
//slow down once stamina depletes
- if( pm->ps->stats[ STAT_STAMINA ] <= -500 )
+ if( pm->ps->stats[ STAT_STAMINA ] <= STAMINA_SLOW_LEVEL )
modifier *= (float)( pm->ps->stats[ STAT_STAMINA ] + 1000 ) / 500.0f;
if( pm->ps->stats[ STAT_STATE ] & SS_CREEPSLOWED )
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 7267355b..0445a8d3 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -639,6 +639,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define STAMINA_JUMP_TAKE 250
#define STAMINA_DODGE_TAKE 250
#define STAMINA_BREATHING_LEVEL 0
+#define STAMINA_SLOW_LEVEL -500
+#define STAMINA_BLACKOUT_LEVEL -800
#define HUMAN_SPAWN_REPEAT_TIME 10000
#define HUMAN_REGEN_DAMAGE_TIME 2000 //msec since damage before dcc repairs