Permalink
Browse files

mod: added most damage given award, refs #1197

  • Loading branch information...
rmarquis committed Feb 6, 2019
1 parent feea746 commit 2acfa7fa96bc204a6632fd58f260c80389098347
Showing with 44 additions and 4 deletions.
  1. +2 −1 src/cgame/cg_debriefing.c
  2. +2 −2 src/cgame/cg_local.h
  3. +40 −1 src/game/g_stats.c
@@ -3398,6 +3398,7 @@ const char *awardNames[NUM_ENDGAME_AWARDS] =
"Highest Accuracy",
"Highest Headshots Percentage",
"Best Survivor",
"Most Damage Given",
"Most Gibs",
"Most Selfkills",
"Most Deaths",
@@ -3442,7 +3443,7 @@ void CG_Debriefing_Awards_Draw(panel_button_t *button)
case TEAM_SPECTATOR: // fall through
default:
CG_DrawPic(button->rect.x + 6, y + 2, 18, 12, cgs.media.limboTeamButtonBack_on);
CG_DrawPic(button->rect.x + 6, y + 2, 18, 12, cgs.media.limboTeamButtonSpec); // TEAM_FREE shouldn't occure
CG_DrawPic(button->rect.x + 6, y + 2, 18, 12, cgs.media.limboTeamButtonSpec); // TEAM_FREE shouldn't occur
break;
}

@@ -1949,9 +1949,9 @@ typedef struct
} clientLocation_t;

#ifdef FEATURE_RATING
#define NUM_ENDGAME_AWARDS 20 ///< total number of endgame awards
#define NUM_ENDGAME_AWARDS 21 ///< total number of endgame awards
#else
#define NUM_ENDGAME_AWARDS 19 ///< total number of endgame awards
#define NUM_ENDGAME_AWARDS 20 ///< total number of endgame awards
#endif
#define NUMSHOW_ENDGAME_AWARDS 14 ///< number of awards to display that will fit on screen

@@ -1055,6 +1055,45 @@ void G_BuildEndgameStats(void)

best = NULL;

// most damage given - check damage given, then damage received
for (i = 0; i < level.numConnectedClients; i++)
{
gclient_t *cl = &level.clients[level.sortedClients[i]];

if (cl->sess.sessionTeam == TEAM_FREE)
{
continue;
}

if (cl->sess.damage_given <= 0)
{
continue;
}

if (!best || cl->sess.damage_given > best->sess.damage_given)
{
best = cl;
bestClientNum = level.sortedClients[i];
}
else if (cl->sess.damage_given == best->sess.damage_given && cl->sess.damage_received > best->sess.damage_received)
{
best = cl;
bestClientNum = level.sortedClients[i];
}
}

if (best)
{
best->hasaward = qtrue;
Q_strcat(buffer, 1024, va("%i %i %i ", bestClientNum, best->sess.damage_given, best->sess.sessionTeam));
}
else
{
Q_strcat(buffer, 1024, "-1 0 0 ");
}

best = NULL;

// most gibs - check gibs, then damage given
for (i = 0; i < level.numConnectedClients; i++)
{
@@ -1202,7 +1241,7 @@ void G_BuildEndgameStats(void)

best = NULL;

// welcome newbie! award - dont get this if any other award given or > 100 xp (this map)
// welcome newbie! award - don't get this if any other award given or > 100 xp (this map)
for (i = 0; i < level.numConnectedClients; i++)
{
gclient_t *cl = &level.clients[level.sortedClients[i]];

0 comments on commit 2acfa7f

Please sign in to comment.