// =================
// gamestart hooks
// =================
+seta cl_matchcount 0 // incremented by cl_hook_gameend and used by playerstats to know when to
alias _cl_hook_gamestart "set _cl_hook_gametype $1; _cl_hook_gamestart_stage2"
alias _cl_hook_gamestart_stage2 "cl_hook_gamestart_all; cl_hook_gamestart_${_cl_hook_gametype}"
alias cl_hook_gamestart_all
alias cl_hook_gamestart_ka
alias cl_hook_gamestart_ft
alias cl_hook_gamestart_inv
-alias cl_hook_gameend
+alias cl_hook_gameend "rpn /cl_matchcount dup load 1 + =" // increase match count every time a game ends
alias cl_hook_activeweapon
alias _sv_hook_gamestart "set _sv_hook_gametype $1; _sv_hook_gamestart_stage2"
// =====================
// gametype vote hooks
// =====================
-// these are called when the mode is switched via gametype vote screen, earlier than gamestart hooks (useful for enabling per-gamemode mutators)
-alias sv_vote_gametype_hook_all
+// These are called when the mode is switched via gametype vote screen,
+// earlier than gamestart hooks (useful for enabling per-gamemode mutators)
+// The _all hook is called before the specific one
+// here it sets g_maxplayers to undo what duel does
+alias sv_vote_gametype_hook_all "set g_maxplayers 0"
alias sv_vote_gametype_hook_as
alias sv_vote_gametype_hook_ca
alias sv_vote_gametype_hook_ctf
alias sv_vote_gametype_hook_rc
alias sv_vote_gametype_hook_tdm
+// Preset to allow duel to be used for the gametype voting screen
+// sv_vote_gametype_*_type Must be set to the name of the gametype the option is based on
+// sv_vote_gametype_*_name Contains a human-readable name of the gametype
+// sv_vote_gametype_*_description Contains a longer description
+set sv_vote_gametype_duel_type dm
+set sv_vote_gametype_duel_name Duel
+set sv_vote_gametype_duel_description "One vs One match"
+alias sv_vote_gametype_hook_duel "set g_maxplayers 2"
+
// ===========
// leadlimit
// ============
// clan arena
// ============
-set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round."
-set g_ca_point_limit 10 "point limit 10 is standard for clan arena"
-set g_ca_point_leadlimit 0
-set g_ca_spectate_enemies 0 "Allow spectating enemy player by dead player during clan arena games."
+set g_ca 0 "Clan Arena: Played in rounds, once you're dead you're out! The team with survivors wins the round"
+seta g_ca_point_limit -1 "Clan Arena point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+seta g_ca_point_leadlimit -1 "Clan Arena point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
+set g_ca_spectate_enemies 0 "Allow spectating enemy player by dead player during clan arena games"
set g_ca_warmup 10 "how long the players will have time to run around the map before the round starts"
set g_ca_damage2score_multiplier 0.01
set g_ca_round_timelimit 180 "round time limit in seconds"
// capture the flag
// ==================
set g_ctf 0 "Capture The Flag: take the enemy flag and bring it to yours at your base to score"
+set g_ctf_oneflag 1 "Allow oneflag CTF mode on maps that support it"
+set g_ctf_oneflag_reverse 0 "apply reverse mode to oneflag CTF (take flag to enemy bases to cap), overrides g_ctf_reverse only in oneflag, g_ctf_reverse still affects oneflag"
+set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate"
+set g_ctf_flag_return_carried_radius 100 "allow flags to be returned by carrier if base is within this radius"
set g_ctf_flag_return_time 15
set g_ctf_flag_return_dropped 100
set g_ctf_flag_return_damage 0
set g_ctf_flag_red_skin 0
set g_ctf_flag_blue_model "models/ctf/flags.md3"
set g_ctf_flag_blue_skin 1
+set g_ctf_flag_yellow_model "models/ctf/flags.md3"
+set g_ctf_flag_yellow_skin 2
+set g_ctf_flag_pink_model "models/ctf/flags.md3"
+set g_ctf_flag_pink_skin 3
+set g_ctf_flag_neutral_model "models/ctf/flags.md3"
+set g_ctf_flag_neutral_skin 4
set g_ctf_flag_glowtrails 1
set g_ctf_fullbrightflags 0
set g_ctf_dynamiclights 0