diff --git a/reaction/cgame/cg_draw.c b/reaction/cgame/cg_draw.c index 02f07d58..73f31b85 100644 --- a/reaction/cgame/cg_draw.c +++ b/reaction/cgame/cg_draw.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.43 2002/06/03 00:48:32 niceass +// match scoreboard changes +// // Revision 1.42 2002/05/19 18:32:11 jbravo // Made new cvars for regular xhair colors. // @@ -1330,7 +1333,7 @@ static void CG_DrawUpperRight( void ) { if ( cg_drawFPS.integer ) { y = CG_DrawFPS( y ); } - if ( cg_drawTimer.integer || cg_RQ3_matchmode.integer) { + if ( cg_drawTimer.integer ) { y = CG_DrawTimer( y ); } if ( cg_drawAttacker.integer ) { diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index ef6a19aa..a7c3a37c 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.84 2002/06/03 00:48:10 niceass +// match scoreboard changes +// // Revision 1.83 2002/05/28 01:17:01 jbravo // More gib fixes. g_RQ3_gib added // @@ -492,22 +495,14 @@ typedef struct localEntity_s { typedef struct { int client; int score; - int deaths; // NiceAss: Added deaths - int damage; // JBravo: Added damage - int alive; // JBravo: Added flag to tell if player is alive + int deaths; + int damage; + int alive; int ping; int time; int scoreFlags; int powerUps; int accuracy; - //Elder: no more of these - int impressiveCount; - int excellentCount; - int guantletCount; - int defendCount; - int assistCount; - int captures; - qboolean perfect; int team; //Slicer Matchmode team_t captain; @@ -928,15 +923,21 @@ typedef struct { int records[REC_NUM_RECORDS]; // Blaze: for our statistics tracking float loadingMapPercent; // NiceAss: Ranges from 0 to 1. Used on map load. + + // NiceAss: Scoreboard MM stuff: + int matchTime; + int team1ready; + int team2ready; } cg_t; + //Blaze: struct to hold the func_breakable stuff typedef struct { - qhandle_t model[3]; - sfxHandle_t sound[3]; - sfxHandle_t exp_sound; - qhandle_t shader; - int jump; - int velocity; + qhandle_t model[3]; + sfxHandle_t sound[3]; + sfxHandle_t exp_sound; + qhandle_t shader; + int jump; + int velocity; } breakable_t; // all of the model, shader, and sound references that are diff --git a/reaction/cgame/cg_scoreboard.c b/reaction/cgame/cg_scoreboard.c index 3cc7b502..063c1d85 100644 --- a/reaction/cgame/cg_scoreboard.c +++ b/reaction/cgame/cg_scoreboard.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.29 2002/06/03 00:47:18 niceass +// match scoreboard changes +// // Revision 1.28 2002/05/27 17:47:19 jbravo // Fixes and cleanups // @@ -198,17 +201,17 @@ static void CG_DrawTeamplayClientScore( int y, score_t *score, float *Fill, floa DrawStrip(y, SB_FONTSIZEH, qtrue, qfalse, qfalse, FillColor, Boarder); - - //cg_RQ3_matchmode - //cg_RQ3_RefID - //cg_RQ3_team1ready - //cg_RQ3_team2ready - //ent->client->pers.sub - Com_sprintf(Tmp, 128, "%5i %s", score->score, ci->name); DrawLeftStripText(y, SB_FONTSIZEH, Tmp, 27, TextColor); Com_sprintf(Tmp, 128, "%4i %4i %6i", score->time, score->ping, score->damage); DrawRightStripText(y, SB_FONTSIZEH, Tmp, 100, TextColor); + + if (score->captain && score->sub == 0) + DrawStripText(y, -(SB_FONTSIZEW * 10), SB_FONTSIZEH, "[CAPTAIN]", 100, colorWhite); + else if (score->sub && score->captain == 0) + DrawStripText(y, -(SB_FONTSIZEW * 6), SB_FONTSIZEH, "[SUB]", 100, colorWhite); + else if (score->sub && score->captain) + DrawStripText(y, -(SB_FONTSIZEW * 16), SB_FONTSIZEH, "[CAPTAIN] [SUB]", 100, colorWhite); } /* @@ -220,10 +223,10 @@ CG_TeamScoreboard static int CG_TeamplayScoreboard(void) { clientInfo_t *ci; - int i; // subs; + int i; int Reds, Blues, Spectators, Refs; -// int RedSubs, BlueSubs; + int RedSubs, BlueSubs; float Alpha; score_t *Score; @@ -259,22 +262,42 @@ static int CG_TeamplayScoreboard(void) MAKERGBA(BlueL, 0.0f, 0.0f, 0.8f, 0.4f * Alpha); MAKERGBA(GreyL, 0.3f, 0.3f, 0.3f, 0.4f * Alpha); - Reds = Blues = Spectators = Refs = 0; + Reds = Blues = Spectators = Refs = RedSubs = BlueSubs = 0; for ( i = 0 ; i < cg.numScores ; i++ ) { Score = &cg.scores[i]; ci = &cgs.clientinfo[ Score->client ]; + if (cg_RQ3_matchmode.integer) { if (Score->client == cg_RQ3_RefID.integer && ci->team == TEAM_SPECTATOR) continue; } - if (ci->team == TEAM_RED) Reds++; - if (ci->team == TEAM_BLUE) Blues++; - if (ci->team == TEAM_SPECTATOR) Spectators++; + if (Score->sub == TEAM_RED) + RedSubs++; + else if (Score->sub == TEAM_BLUE) + BlueSubs++; + else if (ci->team == TEAM_RED) + Reds++; + else if (ci->team == TEAM_BLUE) + Blues++; + + if (ci->team == TEAM_SPECTATOR) Spectators++; } y = 20; // Starting height. + if ( cg_RQ3_matchmode.integer ) { + int mins, secs; + char Time[16]; + + mins = (int)floor(cg.matchTime / 60.0f); + secs = cg.matchTime - (mins * 60); + Com_sprintf(Time, 16, "%d:%02d", mins, secs); + + DrawRightStripText(y, SB_FONTSIZEH, va("Matchtime: %s", Time), 100, colorWhite); + y += SB_FONTSIZEH+SB_PADDING*2+2; + } + // MATCHMODE / TEAMPLAY for showing Referee if ( cg_RQ3_matchmode.integer && cg_RQ3_RefID.integer >= 0) { DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, GreyL, colorBlack); @@ -284,7 +307,7 @@ static int CG_TeamplayScoreboard(void) y += SB_FONTSIZEH+SB_PADDING*4+2; } - // NOT TEAMPLAY: + // DEATHMATCH: if (cg.scoreTPMode == 1 || cgs.gametype < GT_TEAM) { DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, BlackL, colorWhite); DrawLeftStripText(y, SB_FONTSIZEH, "Frags Name", 100, colorWhite); @@ -308,13 +331,14 @@ static int CG_TeamplayScoreboard(void) // *************** RED TEAM *************** //trap_Cvar_VariableStringBuffer("g_RQ3_team1model", Tmp, sizeof(Tmp)); + DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, RedD, colorBlack); trap_Cvar_VariableStringBuffer("g_RQ3_team1name", teamname, sizeof(teamname)); DrawStripText(y, 50, SB_FONTSIZEH, teamname, 100, colorBlack); if ( cg_RQ3_matchmode.integer ) DrawRightStripText(y, SB_FONTSIZEH, va("%s - Wins: %d", - cg_RQ3_team1ready.integer ? "Ready" : "Not Ready", cg.teamScores[0]), 100, colorWhite); + cg.team1ready ? "Ready" : "Not Ready", cg.teamScores[0]), 100, colorWhite); else DrawRightStripText(y, SB_FONTSIZEH, va("Wins: %d", cg.teamScores[0]), 100, colorWhite); @@ -323,30 +347,56 @@ static int CG_TeamplayScoreboard(void) DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, GreyL, colorBlack); DrawLeftStripText(y, SB_FONTSIZEH, "Frags Name", 100, colorWhite); DrawRightStripText(y, SB_FONTSIZEH, "Time Ping Damage", 100, colorWhite); - y += SB_FONTSIZEH+SB_PADDING*2+2; + y += SB_FONTSIZEH+SB_PADDING*2; Ping = Frags = Damage = 0; - if (Reds) { - First = 0; + if (Reds || RedSubs) { + if (Reds) { + y += 2; + First = 0; + for ( i = 0 ; i < cg.numScores; i++ ) { + Score = &cg.scores[i]; + ci = &cgs.clientinfo[ Score->client ]; + + if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; - for ( i = 0 ; i < cg.numScores; i++ ) { - Score = &cg.scores[i]; - ci = &cgs.clientinfo[ Score->client ]; - - if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; - - if (ci->team == TEAM_RED) { - CG_DrawTeamplayClientScore(y, Score, RedL, colorBlack, colorWhite); - if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, RedL, colorBlack); - y += SB_FONTSIZEH+SB_PADDING*2; - Ping += Score->ping; - Frags += Score->score; - Damage += Score->damage; - First = 1; + if (ci->team == TEAM_RED && Score->sub == 0) { + CG_DrawTeamplayClientScore(y, Score, RedL, colorBlack, colorWhite); + if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, RedL, colorBlack); + y += SB_FONTSIZEH+SB_PADDING*2; + Ping += Score->ping; + Frags += Score->score; + Damage += Score->damage; + First = 1; + } } + DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, RedL, colorBlack); + } + + // SUBS + if (RedSubs) { + y += 2; + First = 0; + for ( i = 0 ; i < cg.numScores; i++ ) { + Score = &cg.scores[i]; + ci = &cgs.clientinfo[ Score->client ]; + + if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; + + if (ci->team == TEAM_RED && Score->sub ) { + CG_DrawTeamplayClientScore(y, Score, RedL, colorBlack, colorWhite); + if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, RedL, colorBlack); + y += SB_FONTSIZEH+SB_PADDING*2; + Ping += Score->ping; + Frags += Score->score; + Damage += Score->damage; + First = 1; + + } + } + DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, RedL, colorBlack); } - DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, RedL, colorBlack); y += 2; Com_sprintf(Tmp, 128, "%5d", Frags); @@ -357,6 +407,7 @@ static int CG_TeamplayScoreboard(void) DrawCenterStripText(y, SB_FONTSIZEH, "Averages", 20, colorWhite); } else { + y += 2; DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, RedL, colorBlack); DrawCenterStripText(y, SB_FONTSIZEH, "No team members", 100, colorWhite); } @@ -369,7 +420,7 @@ static int CG_TeamplayScoreboard(void) if ( cg_RQ3_matchmode.integer ) DrawRightStripText(y, SB_FONTSIZEH, va("%s - Wins: %d", - cg_RQ3_team2ready.integer ? "Ready" : "Not Ready", cg.teamScores[1]), 100, colorWhite); + cg.team2ready ? "Ready" : "Not Ready", cg.teamScores[1]), 100, colorWhite); else DrawRightStripText(y, SB_FONTSIZEH, va("Wins: %d", cg.teamScores[1]), 100, colorWhite); @@ -378,30 +429,54 @@ static int CG_TeamplayScoreboard(void) DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, GreyL, colorBlack); DrawLeftStripText(y, SB_FONTSIZEH, "Frags Name", 100, colorWhite); DrawRightStripText(y, SB_FONTSIZEH, "Time Ping Damage", 100, colorWhite); - y += SB_FONTSIZEH+SB_PADDING*2+2; + y += SB_FONTSIZEH+SB_PADDING*2; Ping = Frags = Damage = 0; - if (Blues) { - First = 0; - - for ( i = 0 ; i < cg.numScores; i++ ) { - Score = &cg.scores[i]; - ci = &cgs.clientinfo[ Score->client ]; + if (Blues || BlueSubs) { + if (Blues) { + y+=2; + First = 0; + for ( i = 0 ; i < cg.numScores; i++ ) { + Score = &cg.scores[i]; + ci = &cgs.clientinfo[ Score->client ]; - if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; + if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; - if (ci->team == TEAM_BLUE) { - CG_DrawTeamplayClientScore(y, Score, BlueL, colorBlack, colorWhite); - if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, BlueL, colorBlack); - y += SB_FONTSIZEH+SB_PADDING*2; - Ping += Score->ping; - Frags += Score->score; - Damage += Score->damage; - First = 1; + if (ci->team == TEAM_BLUE && Score->sub == 0) { + CG_DrawTeamplayClientScore(y, Score, BlueL, colorBlack, colorWhite); + if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, BlueL, colorBlack); + y += SB_FONTSIZEH+SB_PADDING*2; + Ping += Score->ping; + Frags += Score->score; + Damage += Score->damage; + First = 1; + } } + DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, BlueL, colorBlack); } - DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, BlueL, colorBlack); + // SUBS: + if (BlueSubs) { + y += 2; + First = 0; + for ( i = 0 ; i < cg.numScores; i++ ) { + Score = &cg.scores[i]; + ci = &cgs.clientinfo[ Score->client ]; + + if (cg_RQ3_matchmode.integer && Score->client == cg_RQ3_RefID.integer) continue; + + if (ci->team == TEAM_BLUE && Score->sub ) { + CG_DrawTeamplayClientScore(y, Score, BlueL, colorBlack, colorWhite); + if (First == 0) DrawStrip(y, SB_FONTSIZEH, qfalse, qtrue, qfalse, BlueL, colorBlack); + y += SB_FONTSIZEH+SB_PADDING*2; + Ping += Score->ping; + Frags += Score->score; + Damage += Score->damage; + First = 1; + } + } + DrawStrip(y - (SB_FONTSIZEH+SB_PADDING*2), SB_FONTSIZEH, qfalse, qfalse, qtrue, BlueL, colorBlack); + } y += 2; Com_sprintf(Tmp, 128, "%5d", Frags); @@ -412,6 +487,7 @@ static int CG_TeamplayScoreboard(void) DrawCenterStripText(y, SB_FONTSIZEH, "Averages", 20, colorWhite); } else { + y+=2; DrawStrip(y, SB_FONTSIZEH, qtrue, qtrue, qtrue, BlueL, colorBlack); DrawCenterStripText(y, SB_FONTSIZEH, "No team members", 100, colorWhite); } diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index 5c41aa6c..529e5603 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.45 2002/06/03 00:47:06 niceass +// match scoreboard changes +// // Revision 1.44 2002/06/02 22:23:57 makro // no message // @@ -168,36 +171,25 @@ static void CG_ParseScores( void ) { cg.teamScores[0] = atoi( CG_Argv( 2 ) ); cg.teamScores[1] = atoi( CG_Argv( 3 ) ); + cg.team1ready = atoi( CG_Argv( 4 ) ); + cg.team2ready = atoi( CG_Argv( 5 ) ); + cg.matchTime = atoi( CG_Argv( 6 ) ); memset( cg.scores, 0, sizeof( cg.scores ) ); for ( i = 0 ; i < cg.numScores ; i++ ) { //Elder: Leave as-is ... sent zeros by server - //CG_Printf("client: %d\n", cg.scores[i].client); - cg.scores[i].client = atoi( CG_Argv( i * 14 + 4 ) ); - cg.scores[i].score = atoi( CG_Argv( i * 14 + 5 ) ); - cg.scores[i].ping = atoi( CG_Argv( i * 14 + 6 ) ); - cg.scores[i].time = atoi( CG_Argv( i * 14 + 7 ) ); - cg.scores[i].scoreFlags = atoi( CG_Argv( i * 14 + 8 ) ); - powerups = atoi( CG_Argv( i * 14 + 9 ) ); - cg.scores[i].accuracy = atoi(CG_Argv(i * 14 + 10)); - // Added deaths, replaced the place of impressiveCount - cg.scores[i].deaths = atoi(CG_Argv(i * 14 + 11)); - // JBravo: Added damage, replaced the place of excellentCount - cg.scores[i].damage = atoi(CG_Argv(i * 14 + 12)); - // JBravo: Added health, replaced the place of guantletCount - cg.scores[i].alive = atoi(CG_Argv(i * 14 + 13)); - //Elder: these should be zero - //cg.scores[i].impressiveCount = atoi(CG_Argv(i * 14 + 11)); - //cg.scores[i].excellentCount = atoi(CG_Argv(i * 14 + 12)); - //cg.scores[i].guantletCount = atoi(CG_Argv(i * 14 + 13)); - //Slicer using first two for Matchmode - //cg.scores[i].defendCount = atoi(CG_Argv(i * 14 + 14)); - //cg.scores[i].assistCount = atoi(CG_Argv(i * 14 + 15)); - cg.scores[i].captain = atoi(CG_Argv(i * 14 + 14)); - cg.scores[i].sub = atoi(CG_Argv(i * 14 + 15)); - - cg.scores[i].perfect = atoi(CG_Argv(i * 14 + 16)); - cg.scores[i].captures = atoi(CG_Argv(i * 14 + 17)); + cg.scores[i].client = atoi( CG_Argv( i * 12 + 7 ) ); + cg.scores[i].score = atoi( CG_Argv( i * 12 + 8 ) ); + cg.scores[i].ping = atoi( CG_Argv( i * 12 + 9 ) ); + cg.scores[i].time = atoi( CG_Argv( i * 12 + 10) ); + cg.scores[i].scoreFlags = atoi( CG_Argv( i * 12 + 11) ); + powerups = atoi( CG_Argv( i * 12 + 12) ); + cg.scores[i].accuracy = atoi(CG_Argv(i * 12 + 13)); + cg.scores[i].deaths = atoi(CG_Argv(i * 12 + 14)); + cg.scores[i].damage = atoi(CG_Argv(i * 12 + 15)); + cg.scores[i].alive = atoi(CG_Argv(i * 12 + 16)); + cg.scores[i].captain = atoi(CG_Argv(i * 12 + 17)); + cg.scores[i].sub = atoi(CG_Argv(i * 12 + 18)); if ( cg.scores[i].client < 0 || cg.scores[i].client >= MAX_CLIENTS ) { cg.scores[i].client = 0; diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 3675b5fc..1a484653 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.116 2002/06/03 00:46:08 niceass +// match scoreboard changes +// // Revision 1.115 2002/06/02 00:13:39 makro // Spectators can vote in TP, not just call a vote // @@ -298,16 +301,15 @@ void DeathmatchScoreboardMessage (gentity_t *ent) { } Com_sprintf (entry, sizeof(entry), - " %i %i %i %i %i %i %i %i %i %i %i %i %i %i", level.sortedClients[i], + " %i %i %i %i %i %i %i %i %i %i %i %i", level.sortedClients[i], cl->ps.persistant[PERS_SCORE], ping, (level.time - cl->pers.enterTime)/60000, scoreFlags, g_entities[level.sortedClients[i]].s.powerups, accuracy, cl->ps.persistant[PERS_KILLED], // NiceAss: Added for scoreboard cl->ps.persistant[PERS_DAMAGE_DELT], // JBravo: Added for scoreboard - cl->sess.sessionTeam != TEAM_SPECTATOR, // JBravo: Added for TP scoreboard - cl->sess.captain, //Slicer: Added for Matchmode Scoreboard - cl->sess.sub, //Slicer: Added for Matchmode Scoreboard - 0, - 0); + cl->sess.sessionTeam != TEAM_SPECTATOR, // JBravo: Added for TP scoreboard + cl->sess.captain, // Slicer: Added for Matchmode Scoreboard + cl->sess.sub // Slicer: Added for Matchmode Scoreboard + ); j = strlen(entry); if (stringlength + j > 1024) @@ -316,9 +318,10 @@ void DeathmatchScoreboardMessage (gentity_t *ent) { stringlength += j; } - trap_SendServerCommand(ent-g_entities, va("scores %i %i %i%s", i, - level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE], - string)); + trap_SendServerCommand(ent-g_entities, va("scores %i %i %i %i %i %i%s", i, + level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE], + g_RQ3_team1ready.integer, g_RQ3_team2ready.integer, + (int)level.matchTime, string)); } diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 5a1faa28..624b74d2 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.62 2002/06/03 00:49:07 niceass +// match scoreboard changes +// // Revision 1.61 2002/05/31 05:12:50 niceass // tpcountdown default 0!1@$@#%$ // @@ -379,7 +382,7 @@ static cvarTable_t gameCvarTable[] = { { &g_rankings, "g_rankings", "0", 0, 0, qfalse}, //Slicer: Matchmode - { &g_RQ3_matchmode, "g_RQ3_matchmode", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse }, + { &g_RQ3_matchmode, "g_RQ3_matchmode", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH | CVAR_SYSTEMINFO, 0, qfalse }, //Slicer: radio protect { &g_RQ3_radioFlood, "g_RQ3_radioFlood", "3", 0 , 0, qfalse }, { &g_RQ3_radioFloodTime, "g_RQ3_radioFloodTime", "2", 0 , 0, qfalse },