case "bckills": return CTX(_("SCO^bckills"));
case "bctime": return CTX(_("SCO^bctime"));
case "caps": return CTX(_("SCO^caps"));
+ case "captime": return CTX(_("SCO^captime"));
case "deaths": return CTX(_("SCO^deaths"));
case "destroyed": return CTX(_("SCO^destroyed"));
case "drops": return CTX(_("SCO^drops"));
print(_("^3kd^7 The kill-death ratio\n"));
print(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
print(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
+ print(_("^3captime^7 Time of fastest cap (CTF)\n"));
print(_("^3fckills^7 Number of flag carrier kills\n"));
print(_("^3returns^7 Number of flag returns\n"));
print(_("^3drops^7 Number of flag drops\n"));
{
entity enemy_flag = ((capturetype == CAPTURE_NORMAL) ? toucher.flagcarried : toucher);
entity player = ((capturetype == CAPTURE_NORMAL) ? toucher : enemy_flag.ctf_dropper);
+ float old_time, new_time;
if not(player) { return; } // without someone to give the reward to, we can't possibly cap
PlayerTeamScore_AddScore(player, ctf_ReadScore("score_capture"));
PlayerTeamScore_Add(player, SP_CTF_CAPS, ST_CTF_CAPS, 1);
+ old_time = PlayerScore_Add(player, SP_CTF_CAPTIME, 0);
+ new_time = TIME_ENCODE(time - enemy_flag.ctf_pickuptime);
+ if(!old_time || new_time < old_time)
+ PlayerScore_Add(player, SP_CTF_CAPTIME, new_time - old_time);
+
// effects
if(autocvar_g_ctf_flag_capture_effects)
{
// g_ctf
#define ST_CTF_CAPS 1
#define SP_CTF_CAPS 4
-#define SP_CTF_PICKUPS 5
-#define SP_CTF_DROPS 6
-#define SP_CTF_FCKILLS 7
-#define SP_CTF_RETURNS 8
+#define SP_CTF_CAPTIME 5
+#define SP_CTF_PICKUPS 6
+#define SP_CTF_DROPS 7
+#define SP_CTF_FCKILLS 8
+#define SP_CTF_RETURNS 9
void ScoreRules_ctf()
{
CheckAllowedTeams(world);
- ScoreRules_basics(2 + (c3>=0), SFL_SORT_PRIO_PRIMARY, 0, TRUE); // NOTE this assumes that the rogue team is team 3
+ ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
ScoreInfo_SetLabel_TeamScore (ST_CTF_CAPS, "caps", SFL_SORT_PRIO_PRIMARY);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPS, "caps", SFL_SORT_PRIO_SECONDARY);
+ ScoreInfo_SetLabel_PlayerScore(SP_CTF_CAPTIME, "captime", SFL_LOWER_IS_BETTER | SFL_TIME);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_PICKUPS, "pickups", 0);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_FCKILLS, "fckills", 0);
ScoreInfo_SetLabel_PlayerScore(SP_CTF_RETURNS, "returns", 0);