From afd8e7bd62c7a4170ccad95d712262b35c193039 Mon Sep 17 00:00:00 2001 From: Scott Brooks Date: Sun, 3 Mar 2002 21:46:26 +0000 Subject: [PATCH] weapon stats, done, beta test for bugs --- reaction/cgame/cg_scoreboard.c | 161 ++++++++++++++++++--------------- reaction/cgame/cg_servercmds.c | 6 ++ reaction/game/bg_public.h | 7 +- reaction/game/g_cmds.c | 8 +- reaction/game/g_combat.c | 11 +++ 5 files changed, 117 insertions(+), 76 deletions(-) diff --git a/reaction/cgame/cg_scoreboard.c b/reaction/cgame/cg_scoreboard.c index 05d4730a..7931c804 100644 --- a/reaction/cgame/cg_scoreboard.c +++ b/reaction/cgame/cg_scoreboard.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.10 2002/03/03 21:44:01 blaze +// weapon stats, done, beta test for bugs +// // Revision 1.9 2002/03/02 01:16:30 blaze // weapons stats- reordered where the mp5 was to make it more consistant with the weapon selection page // @@ -733,7 +736,7 @@ CG_DrawWeaponStats ============================== */ #define WS_LEFTSIDE 20 -#define WS_TOP 230 +#define WS_TOP 200 #define WS_WIDTH 640 - WS_LEFTSIDE * 10 #define WS_LINE_WIDTH 1 #define WS_PADDING (WS_LINE_WIDTH+2) @@ -741,7 +744,7 @@ CG_DrawWeaponStats void CG_DrawWeaponStats(void) { - int i, red, blue, spec, score, deaths, offset; + int i, red, blue, spec, offset; float color[4], Alpha, Alpha2; clientInfo_t *ci; @@ -759,8 +762,9 @@ void CG_DrawWeaponStats(void) } //make room for 8 weapon stats size = (10*20)+SB_PADDING; - score = cg.snap->ps.persistant[PERS_SCORE]; - deaths = cg.snap->ps.persistant[PERS_KILLED]; + + + // Score bar - Red: MAKERGBA(color, 1.0f, 0.5f, 0.5f, 0.7f * Alpha); CG_FillRect(WS_LEFTSIDE, WS_TOP, @@ -777,7 +781,7 @@ void CG_DrawWeaponStats(void) WS_WIDTH, size, color); //box for weapon stuff MAKERGBA(color, 1.0f, 1.0f, 1.0f, 0.8f); - CG_DrawCleanRect( WS_LEFTSIDE, WS_TOP, + CG_DrawCleanRect( WS_LEFTSIDE, WS_TOP, WS_WIDTH, (SMALLCHAR_HEIGHT+WS_PADDING*2)*2+size, WS_LINE_WIDTH, color ); //box for score stuff @@ -796,41 +800,52 @@ void CG_DrawWeaponStats(void) //Fill in the top bar offset = 7; - MAKERGBA(color, 1.0f, 0.0f, 0.0f, 1.0f); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6, WS_TOP + SB_PADDING, "Score", color); - MAKERGBA(color, 0.0f, 1.0f, 0.0f, 1.0f); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7, WS_TOP + SB_PADDING, "Net", color); - MAKERGBA(color, 0.0f, 0.0f, 1.0f, 1.0f); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 2, WS_TOP + SB_PADDING, - "Kills", color); + "K/D/S", color); - MAKERGBA(color, 0.5f, 0.0f, 0.0f, 1.0f); + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 3, WS_TOP + SB_PADDING, - "Deaths", color); - - MAKERGBA(color, 0.0f, 0.5f, 0.0f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 4, WS_TOP + SB_PADDING, - "Sui", color); - - MAKERGBA(color, 0.0f, 0.0f, 0.5f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 5, WS_TOP + SB_PADDING, "TK's", color); - MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 6, WS_TOP + SB_PADDING, - "Efficiency", color); +// MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); +// CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 4, WS_TOP + SB_PADDING, +// "Efficiency", color); - Com_sprintf(String, sizeof(String), "%4i",score); - - + Com_sprintf(String, sizeof(String), "%4i",cg.snap->ps.persistant[PERS_SCORE]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 3 + SMALLCHAR_HEIGHT, String, color); + + Com_sprintf(String, sizeof(String), "%3i",cg.records[REC_KILLS] - cg.snap->ps.persistant[PERS_KILLED]); + + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 - 1, WS_TOP + SB_PADDING * 3 + SMALLCHAR_HEIGHT, + String, color); + + + Com_sprintf(String, sizeof(String), "%i/%i/%i",cg.records[REC_KILLS],cg.snap->ps.persistant[PERS_KILLED],cg.records[REC_SUICIDES]); + + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 2, WS_TOP + SB_PADDING * 3 + SMALLCHAR_HEIGHT, + String, color); + + Com_sprintf(String, sizeof(String), "%4i",cg.records[REC_TEAMKILLS]); + + MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 3, WS_TOP + SB_PADDING * 3 + SMALLCHAR_HEIGHT, + String, color); + + i=2; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); @@ -944,181 +959,181 @@ void CG_DrawWeaponStats(void) //Hits i=2; - offset=24; + offset=25; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Hits", color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFESLASHHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFETHROWHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFETHROWHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MK23HITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MK23HITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MP5HITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MP5HITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M3HITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M3HITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M4HITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M4HITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_HANDCANNONHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_HANDCANNONHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000HITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_SSG3000HITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_AKIMBOHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_GRENADEHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_GRENADEHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKHITS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KICKHITS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); //Shots i=2; - offset = 30; + offset = 32; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * (offset - 1), WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Shots", color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHSHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFESLASHSHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFETHROWSHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFETHROWSHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MK23SHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MK23SHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MP5SHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MP5SHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M3SHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M3SHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M4SHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M4SHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_HANDCANNONSHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_HANDCANNONSHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000SHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_SSG3000SHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOSHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_AKIMBOSHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_GRENADESHOTS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_GRENADESHOTS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); //Kills i=2; - offset = 37; + offset = 44; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * (offset - 1), WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Kills", color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFESLASHKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFETHROWKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFETHROWKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MK23KILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MK23KILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MP5KILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MP5KILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M3KILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M3KILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M4KILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M4KILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_HANDCANNONKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_HANDCANNONKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000KILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_SSG3000KILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_AKIMBOKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_GRENADEKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_GRENADEKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKKILLS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KICKKILLS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); @@ -1127,60 +1142,60 @@ void CG_DrawWeaponStats(void) i=2; offset = 45; MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); - CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, + CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * (offset -2), WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, "Deaths", color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHDEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFESLASHDEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFETHROWDEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KNIFETHROWDEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MK23DEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MK23DEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_MP5DEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_MP5DEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M3DEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M3DEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_M4DEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_M4DEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_HANDCANNONDEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_HANDCANNONDEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000DEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_SSG3000DEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBODEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_AKIMBODEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_GRENADEDEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_GRENADEDEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); - Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKDEATHS]); + Com_sprintf(String, sizeof(String), "%4d",cg.records[REC_KICKDEATHS]); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, String, color); diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index 5230502f..457da5fa 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.19 2002/03/03 21:44:01 blaze +// weapon stats, done, beta test for bugs +// // Revision 1.18 2002/02/28 05:41:54 blaze // weapons stats on client side // @@ -152,6 +155,9 @@ static void CG_ParseWeaponStats( void ) { cg.records[REC_GRENADESHOTS] = atoi( CG_Argv(i++)); cg.records[REC_GRENADEHITS] = atoi( CG_Argv(i++)); cg.records[REC_KICKHITS] = atoi( CG_Argv(i++)); + cg.records[REC_KILLS] = atoi( CG_Argv(i++)); + cg.records[REC_TEAMKILLS] = atoi( CG_Argv(i++)); + cg.records[REC_SUICIDES] = atoi( CG_Argv(i++)); } /* diff --git a/reaction/game/bg_public.h b/reaction/game/bg_public.h index 0a1aae33..7da8cdbf 100644 --- a/reaction/game/bg_public.h +++ b/reaction/game/bg_public.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.49 2002/03/03 21:46:26 blaze +// weapon stats, done, beta test for bugs +// // Revision 1.48 2002/02/26 02:58:47 jbravo // Fixing the spectator_free mode not being predicted in the client. // @@ -792,7 +795,9 @@ typedef enum { REC_FRAGSTEALS, // this is a derived record -- remove? REC_CHATCOUNT, REC_GESTURECOUNT, - + REC_KILLS, //How many kills - different then score + //how many TK's + REC_TEAMKILLS, REC_NUM_RECORDS } rq3record_t; diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index d475cff8..37843d79 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.66 2002/03/03 21:46:26 blaze +// weapon stats, done, beta test for bugs +// // Revision 1.65 2002/03/03 02:04:14 jbravo // Zcam tewaking // @@ -216,7 +219,7 @@ Request current weaponstats information void Cmd_WeaponStats_f( gentity_t *ent) { - trap_SendServerCommand( ent-g_entities, va("wstats %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", + trap_SendServerCommand( ent-g_entities, va("wstats %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", ent->client->pers.records[REC_KNIFETHROWSHOTS],ent->client->pers.records[REC_KNIFETHROWHITS], ent->client->pers.records[REC_KNIFESLASHSHOTS],ent->client->pers.records[REC_KNIFESLASHHITS], ent->client->pers.records[REC_MK23SHOTS],ent->client->pers.records[REC_MK23HITS], @@ -227,7 +230,8 @@ void Cmd_WeaponStats_f( gentity_t *ent) ent->client->pers.records[REC_HANDCANNONSHOTS],ent->client->pers.records[REC_HANDCANNONHITS], ent->client->pers.records[REC_AKIMBOSHOTS],ent->client->pers.records[REC_AKIMBOHITS], ent->client->pers.records[REC_GRENADESHOTS],ent->client->pers.records[REC_GRENADEHITS], - ent->client->pers.records[REC_KICKHITS])); + ent->client->pers.records[REC_KICKHITS],ent->client->pers.records[REC_KILLS], + ent->client->pers.records[REC_TEAMKILLS], ent->client->pers.records[REC_SUICIDES])); trap_SendServerCommand( ent-g_entities, va("wstats2 %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i %i", ent->client->pers.records[REC_KNIFETHROWDEATHS],ent->client->pers.records[REC_KNIFETHROWKILLS], diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index 37937862..bcd409cd 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.47 2002/03/03 21:46:26 blaze +// weapon stats, done, beta test for bugs +// // Revision 1.46 2002/03/01 18:21:26 jbravo // Cleanups and removal of g_RQ3_sniperup // @@ -789,6 +792,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int ent->r.svFlags = SVF_BROADCAST; // send to everyone self->enemy = attacker; self->client->ps.persistant[PERS_KILLED]++; + //Blaze: Give the attacker 1 kill + attacker->client->pers.records[REC_KILLS]++; if (attacker && attacker->client) { attacker->client->lastkilled_client = self->s.number; @@ -797,6 +802,10 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if (attacker == self || OnSameTeam (self, attacker)) { if (level.team_round_going) { AddScore(attacker, self->r.currentOrigin, -1); + //If the kill was a TK, remove 1 from REC_KILLS to negate the one given earlyier + attacker->client->pers.records[REC_KILLS]--; + //Also, increment the TK's record + attacker->client->pers.records[REC_TEAMKILLS]++; } } else { // Increase number of kills this life for attacker @@ -879,6 +888,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if (meansOfDeath == MOD_SUICIDE) { // Elder: Statistics tracking self->client->pers.records[REC_SUICIDES]++; + self->client->pers.records[REC_KILLS]--; + AddScore(self, self->r.currentOrigin, -1); if (g_gametype.integer != GT_TEAMPLAY) { if ( self->client->ps.powerups[PW_NEUTRALFLAG] ) { // only happens in One Flag CTF Team_ReturnFlag( TEAM_FREE );