summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2003-06-13 23:58:32 +0000
committerTim Angus <tim@ngus.net>2003-06-13 23:58:32 +0000
commit7cca20bab858badbef5f3d519c418b7d118eb53e (patch)
tree5f7a80e969cd0bc7da19a4ffcfb05ec6980a414b /src
parent7630d01bc896bf5fa2403810867e6bc0f19c9d5a (diff)
* Code support for the "new" huds
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c60
-rw-r--r--src/game/bg_misc.c20
-rw-r--r--src/game/bg_public.h5
-rw-r--r--src/game/g_active.c4
4 files changed, 77 insertions, 12 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index fecbfd70..3d82440b 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -754,6 +754,31 @@ static void CG_DrawPlayerClipsRing( rectDef_t *rect, vec4_t color, qhandle_t sha
/*
==============
+CG_DrawPlayerBuildTimerRing
+==============
+*/
+static void CG_DrawPlayerBuildTimerRing( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ playerState_t *ps = &cg.snap->ps;
+ centity_t *cent;
+ float buildTime = ps->stats[ STAT_MISC ];
+ float progress;
+ float maxDelay;
+
+ cent = &cg_entities[ cg.snap->ps.clientNum ];
+
+ maxDelay = (float)BG_FindBuildDelayForWeapon( cent->currentState.weapon );
+ progress = ( maxDelay - buildTime ) / maxDelay;
+
+ color[ 3 ] = AH_MIN_ALPHA + ( progress * AH_ALPHA_DIFF );
+
+ trap_R_SetColor( color );
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
CG_DrawPlayerBoosted
==============
*/
@@ -774,6 +799,35 @@ static void CG_DrawPlayerBoosted( rectDef_t *rect, vec4_t color, qhandle_t shade
/*
==============
+CG_DrawPlayerBoosterBolt
+==============
+*/
+static void CG_DrawPlayerBoosterBolt( rectDef_t *rect, vec4_t color, qhandle_t shader )
+{
+ playerState_t *ps = &cg.snap->ps;
+ qboolean boosted = ps->stats[ STAT_STATE ] & SS_BOOSTED;
+ vec4_t localColor;
+
+ Vector4Copy( color, localColor );
+
+ if( boosted )
+ {
+ if( ps->stats[ STAT_BOOSTTIME ] > BOOST_TIME - 3000 )
+ {
+ qboolean flash = ( ps->stats[ STAT_BOOSTTIME ] / 500 ) % 2;
+
+ if( flash )
+ localColor[ 3 ] = 1.0f;
+ }
+ }
+
+ trap_R_SetColor( localColor );
+ CG_DrawPic( rect->x, rect->y, rect->w, rect->h, shader );
+ trap_R_SetColor( NULL );
+}
+
+/*
+==============
CG_DrawPlayerPoisonBarbs
==============
*/
@@ -2129,12 +2183,18 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
case CG_PLAYER_CLIPS_RING:
CG_DrawPlayerClipsRing( &rect, color, shader );
break;
+ case CG_PLAYER_BUILD_TIMER_RING:
+ CG_DrawPlayerBuildTimerRing( &rect, color, shader );
+ break;
case CG_PLAYER_WALLCLIMBING:
CG_DrawPlayerWallclimbing( &rect, color, shader );
break;
case CG_PLAYER_BOOSTED:
CG_DrawPlayerBoosted( &rect, color, shader );
break;
+ case CG_PLAYER_BOOST_BOLT:
+ CG_DrawPlayerBoosterBolt( &rect, color, shader );
+ break;
case CG_PLAYER_POISON_BARBS:
CG_DrawPlayerPoisonBarbs( &rect, color, shader );
break;
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index c38015a9..fde42787 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1188,7 +1188,7 @@ classAttributes_t bg_classList[ ] =
"lucy", //char *modelname;
1.0f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_builder_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -20 }, //vec3_t mins;
{ 15, 15, 20 }, //vec3_t maxs;
@@ -1218,7 +1218,7 @@ classAttributes_t bg_classList[ ] =
"lucy", //char *modelname;
1.0f, //float modelScale;
"angel", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_builder_hud", //char *hudname;
( 1 << S2 )|( 1 << S3 ), //int stages
{ -20, -20, -20 }, //vec3_t mins;
{ 20, 20, 20 }, //vec3_t maxs;
@@ -1248,7 +1248,7 @@ classAttributes_t bg_classList[ ] =
"jumper", //char *modelname;
0.2f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -6 }, //vec3_t mins;
{ 15, 15, 6 }, //vec3_t maxs;
@@ -1278,7 +1278,7 @@ classAttributes_t bg_classList[ ] =
"prowl", //char *modelname;
0.75f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -16 }, //vec3_t mins;
{ 24, 24, 16 }, //vec3_t maxs;
@@ -1308,7 +1308,7 @@ classAttributes_t bg_classList[ ] =
"prowl", //char *modelname;
0.75f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -16 }, //vec3_t mins;
{ 24, 24, 16 }, //vec3_t maxs;
@@ -1338,7 +1338,7 @@ classAttributes_t bg_classList[ ] =
"spitter", //char *modelname;
0.6f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -18, -18, -18 }, //vec3_t mins;
{ 18, 18, 18 }, //vec3_t maxs;
@@ -1369,7 +1369,7 @@ classAttributes_t bg_classList[ ] =
"spitter", //char *modelname;
0.7f, //float modelScale;
"blue", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -20, -20, -20 }, //vec3_t mins;
{ 20, 20, 20 }, //vec3_t maxs;
@@ -1400,7 +1400,7 @@ classAttributes_t bg_classList[ ] =
"tarantula", //char *modelname;
0.75f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -22, -22, -22 }, //vec3_t mins;
{ 22, 22, 22 }, //vec3_t maxs;
@@ -1430,7 +1430,7 @@ classAttributes_t bg_classList[ ] =
"tarantula", //char *modelname;
0.9f, //float modelScale;
"red", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -24 }, //vec3_t mins;
{ 24, 24, 24 }, //vec3_t maxs;
@@ -1460,7 +1460,7 @@ classAttributes_t bg_classList[ ] =
"bug", //char *modelname;
1.2f, //float modelScale;
"default", //char *skinname;
- "alien_hud", //char *hudname;
+ "alien_general_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -30, -30, -29 }, //vec3_t mins;
{ 30, 30, 29 }, //vec3_t maxs;
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index a61f9ef7..62ab7fab 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -206,7 +206,8 @@ typedef enum
STAT_STAMINA, //TA: stamina (human only)
STAT_STATE, //TA: client states e.g. wall climbing
STAT_MISC, //TA: for uh...misc stuff
- STAT_BUILDABLE //TA: which ghost model to display for building
+ STAT_BUILDABLE, //TA: which ghost model to display for building
+ STAT_BOOSTTIME //TA: time left for boost (alien only)
} statIndex_t;
#define SCA_WALLCLIMBER 0x00000001
@@ -237,6 +238,8 @@ typedef enum
#define MAX_STAMINA 1000
+#define BOOST_TIME 20000
+
// player_state->persistant[] indexes
// these fields are the only part of player_state that isn't
// cleared on respawn
diff --git a/src/game/g_active.c b/src/game/g_active.c
index 43c6fa16..ecae1f6c 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -869,8 +869,10 @@ void ClientThink_real( gentity_t *ent )
client->lastLockTime + DRAGOON_SLOWBLOB_TIME < level.time )
client->ps.stats[ STAT_STATE ] &= ~SS_SLOWLOCKED;
+ client->ps.stats[ STAT_BOOSTTIME ] = level.time - client->lastBoostedTime;
+
if( client->ps.stats[ STAT_STATE ] & SS_BOOSTED &&
- client->lastBoostedTime + 20000 < level.time )
+ client->lastBoostedTime + BOOST_TIME < level.time )
client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED;
if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED &&