.float weapons; // game type ID
.string netname; // game type name as in cvar (with g_ prefix)
.string mdl; // game type short name
-.string message; // game type defaults
+.string message; // human readable name
+.string model2; // game type defaults
-#define REGISTER_GAMETYPE(sname,g_name,NAME,defaults) \
+#define REGISTER_GAMETYPE(hname,sname,g_name,NAME,defaults) \
var float MAPINFO_TYPE_##NAME; \
var entity MapInfo_Type##g_name; \
void RegisterGametypes_##g_name() \
MapInfo_Type##g_name.weapons = MAPINFO_TYPE_##NAME; \
MapInfo_Type##g_name.netname = #g_name; \
MapInfo_Type##g_name.mdl = #sname; \
- MapInfo_Type##g_name.message = defaults; \
+ MapInfo_Type##g_name.message = hname; \
+ MapInfo_Type##g_name.model2 = defaults; \
if(!MapInfo_Type_first) \
MapInfo_Type_first = MapInfo_Type##g_name; \
if(MapInfo_Type_last) \
#define IS_GAMETYPE(NAME) \
(MapInfo_LoadedGametype == MAPINFO_TYPE_##NAME)
-REGISTER_GAMETYPE(dm,g_dm,DEATHMATCH,"timelimit=20 pointlimit=30 leadlimit=0")
+REGISTER_GAMETYPE(_("Deathmatch"),dm,g_dm,DEATHMATCH,"timelimit=20 pointlimit=30 leadlimit=0")
#define g_dm IS_GAMETYPE(DEATHMATCH)
-REGISTER_GAMETYPE(lms,g_lms,LMS,"timelimit=20 lives=9 leadlimit=0")
+REGISTER_GAMETYPE(_("Last Man Standing"),lms,g_lms,LMS,"timelimit=20 lives=9 leadlimit=0")
#define g_lms IS_GAMETYPE(LMS)
-REGISTER_GAMETYPE(arena,g_arena,ARENA,"timelimit=20 pointlimit=10 leadlimit=0")
+REGISTER_GAMETYPE(_("Arena"),arena,g_arena,ARENA,"timelimit=20 pointlimit=10 leadlimit=0")
#define g_arena IS_GAMETYPE(ARENA)
-REGISTER_GAMETYPE(rune,g_runematch,RUNEMATCH,"timelimit=20 pointlimit=200 leadlimit=0")
+REGISTER_GAMETYPE(_("Runematch"),rune,g_runematch,RUNEMATCH,"timelimit=20 pointlimit=200 leadlimit=0")
#define g_runematch IS_GAMETYPE(RUNEMATCH)
-REGISTER_GAMETYPE(rc,g_race,RACE,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0")
+REGISTER_GAMETYPE(_("Race"),rc,g_race,RACE,"timelimit=20 qualifying_timelimit=5 laplimit=7 teamlaplimit=15 leadlimit=0")
#define g_race IS_GAMETYPE(RACE)
-REGISTER_GAMETYPE(cts,g_cts,CTS,"timelimit=20 skill=-1")
+REGISTER_GAMETYPE(_("Race CTS"),cts,g_cts,CTS,"timelimit=20 skill=-1")
#define g_cts IS_GAMETYPE(CTS)
-REGISTER_GAMETYPE(tdm,g_tdm,TEAM_DEATHMATCH,"timelimit=20 pointlimit=50 teams=2 leadlimit=0")
+REGISTER_GAMETYPE(_("Team Deathmatch"),tdm,g_tdm,TEAM_DEATHMATCH,"timelimit=20 pointlimit=50 teams=2 leadlimit=0")
#define g_tdm IS_GAMETYPE(TEAM_DEATHMATCH)
-REGISTER_GAMETYPE(ctf,g_ctf,CTF,"timelimit=20 pointlimit=300 caplimit=10 leadlimit=0")
+REGISTER_GAMETYPE(_("Capture the Flag"),ctf,g_ctf,CTF,"timelimit=20 pointlimit=300 caplimit=10 leadlimit=0")
#define g_ctf IS_GAMETYPE(CTF)
-REGISTER_GAMETYPE(ca,g_ca,CA,"timelimit=20 pointlimit=10 leadlimit=0")
+REGISTER_GAMETYPE(_("Clan Arena"),ca,g_ca,CA,"timelimit=20 pointlimit=10 leadlimit=0")
#define g_ca IS_GAMETYPE(CA)
-REGISTER_GAMETYPE(dom,g_domination,DOMINATION,"timelimit=20 pointlimit=200 teams=2 leadlimit=0")
+REGISTER_GAMETYPE(_("Domination"),dom,g_domination,DOMINATION,"timelimit=20 pointlimit=200 teams=2 leadlimit=0")
#define g_domination IS_GAMETYPE(DOMINATION)
-REGISTER_GAMETYPE(kh,g_keyhunt,KEYHUNT,"timelimit=20 pointlimit=1000 teams=3 leadlimit=0")
+REGISTER_GAMETYPE(_("Key Hunt"),kh,g_keyhunt,KEYHUNT,"timelimit=20 pointlimit=1000 teams=3 leadlimit=0")
#define g_keyhunt IS_GAMETYPE(KEYHUNT)
-REGISTER_GAMETYPE(as,g_assault,ASSAULT,"timelimit=20")
+REGISTER_GAMETYPE(_("Assault"),as,g_assault,ASSAULT,"timelimit=20")
#define g_assault IS_GAMETYPE(ASSAULT)
-REGISTER_GAMETYPE(ons,g_onslaught,ONSLAUGHT,"timelimit=20")
+REGISTER_GAMETYPE(_("Onslaught"),ons,g_onslaught,ONSLAUGHT,"timelimit=20")
#define g_onslaught IS_GAMETYPE(ONSLAUGHT)
-REGISTER_GAMETYPE(nexball,g_nexball,NEXBALL,"timelimit=20 pointlimit=5 leadlimit=0")
+REGISTER_GAMETYPE(_("Nexball"),nexball,g_nexball,NEXBALL,"timelimit=20 pointlimit=5 leadlimit=0")
#define g_nexball IS_GAMETYPE(NEXBALL)
-REGISTER_GAMETYPE(freezetag,g_freezetag,FREEZETAG,"timelimit=20 pointlimit=10 teams=2 leadlimit=0")
+REGISTER_GAMETYPE(_("Freeze Tag"),freezetag,g_freezetag,FREEZETAG,"timelimit=20 pointlimit=10 teams=2 leadlimit=0")
#define g_freezetag IS_GAMETYPE(FREEZETAG)
-REGISTER_GAMETYPE(keepaway,g_keepaway,KEEPAWAY,"timelimit=20 pointlimit=30")
+REGISTER_GAMETYPE(_("Keepaway"),keepaway,g_keepaway,KEEPAWAY,"timelimit=20 pointlimit=30")
#define g_keepaway IS_GAMETYPE(KEEPAWAY)
float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps
// gets a gametype from a string
float MapInfo_Type_FromString(string t);
string MapInfo_Type_ToString(float t);
+string MapInfo_Type_ToText(float t);
void MapInfo_SwitchGameType(float t);
// to be called from worldspawn to set up cvars
// note: include only those that should be in the menu!
#define GAMETYPES \
- GAMETYPE(MAPINFO_TYPE_ARENA, _("Arena")) \
- GAMETYPE(MAPINFO_TYPE_ASSAULT, _("Assault")) \
- GAMETYPE(MAPINFO_TYPE_CTF, _("Capture The Flag")) \
- GAMETYPE(MAPINFO_TYPE_CA, _("Clan Arena")) \
- GAMETYPE(MAPINFO_TYPE_DEATHMATCH, _("Deathmatch")) \
- GAMETYPE(MAPINFO_TYPE_DOMINATION, _("Domination")) \
- GAMETYPE(MAPINFO_TYPE_FREEZETAG, _("Freeze Tag")) \
- GAMETYPE(MAPINFO_TYPE_KEEPAWAY, _("Keepaway")) \
- GAMETYPE(MAPINFO_TYPE_KEYHUNT, _("Key Hunt")) \
- GAMETYPE(MAPINFO_TYPE_LMS, _("Last Man Standing")) \
- GAMETYPE(MAPINFO_TYPE_NEXBALL, _("Nexball")) \
- GAMETYPE(MAPINFO_TYPE_ONSLAUGHT, _("Onslaught")) \
- GAMETYPE(MAPINFO_TYPE_RACE, _("Race")) \
- GAMETYPE(MAPINFO_TYPE_CTS, _("Race CTS")) \
- GAMETYPE(MAPINFO_TYPE_RUNEMATCH, _("Runematch")) \
- GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH, _("Team Deathmatch")) \
+ GAMETYPE(MAPINFO_TYPE_ARENA) \
+ GAMETYPE(MAPINFO_TYPE_ASSAULT) \
+ GAMETYPE(MAPINFO_TYPE_CTF) \
+ GAMETYPE(MAPINFO_TYPE_CA) \
+ GAMETYPE(MAPINFO_TYPE_DEATHMATCH) \
+ GAMETYPE(MAPINFO_TYPE_DOMINATION) \
+ GAMETYPE(MAPINFO_TYPE_FREEZETAG) \
+ GAMETYPE(MAPINFO_TYPE_KEEPAWAY) \
+ GAMETYPE(MAPINFO_TYPE_KEYHUNT) \
+ GAMETYPE(MAPINFO_TYPE_LMS) \
+ GAMETYPE(MAPINFO_TYPE_NEXBALL) \
+ GAMETYPE(MAPINFO_TYPE_ONSLAUGHT) \
+ GAMETYPE(MAPINFO_TYPE_RACE) \
+ GAMETYPE(MAPINFO_TYPE_CTS) \
+ GAMETYPE(MAPINFO_TYPE_RUNEMATCH) \
+ GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH) \
/* nothing */
float GameType_GetID(float cnt)
{
float i;
i = 0;
-#define GAMETYPE(id,name) if(i++ == cnt) return id;
+#define GAMETYPE(id) if(i++ == cnt) return id;
GAMETYPES
#undef GAMETYPE
return 0;
}
-string GameType_GetName(float cnt)
-{
- float i;
- i = 0;
-#define GAMETYPE(id,name) if(i++ == cnt) return name;
- GAMETYPES
-#undef GAMETYPE
- return _("@!#%'n Tuba Throwing");
-}
float GameType_GetCount()
{
float i;
i = 0;
-#define GAMETYPE(id,name) ++i;
+#define GAMETYPE(id) ++i;
GAMETYPES
#undef GAMETYPE
return i;
timelimit_override = autocvar_timelimit_override;
fraglimit_override = autocvar_fraglimit_override;
leadlimit_override = autocvar_leadlimit_override;
+ gamemode_name = MapInfo_Type_ToText(MapInfo_LoadedGametype);
if(g_dm)
{
- gamemode_name = "Deathmatch";
}
if(g_tdm)
{
- gamemode_name = "Team Deathmatch";
ActivateTeamplay();
tdm_init();
if(autocvar_g_tdm_team_spawns)
if(g_domination)
{
- gamemode_name = "Domination";
ActivateTeamplay();
fraglimit_override = autocvar_g_domination_point_limit;
leadlimit_override = autocvar_g_domination_point_leadlimit;
if(g_ctf)
{
- gamemode_name = "Capture the Flag";
ActivateTeamplay();
g_ctf_ignore_frags = autocvar_g_ctf_ignore_frags;
if(g_ctf_win_mode == 2)
if(g_runematch)
{
- gamemode_name = "Rune Match";
// ActivateTeamplay();
fraglimit_override = autocvar_g_runematch_point_limit;
leadlimit_override = autocvar_g_runematch_point_leadlimit;
if(g_lms)
{
- gamemode_name = "Last Man Standing";
fraglimit_override = autocvar_g_lms_lives_override;
leadlimit_override = 0; // not supported by LMS
if(fraglimit_override == 0)
if(g_arena)
{
- gamemode_name = "Arena";
fraglimit_override = autocvar_g_arena_point_limit;
leadlimit_override = autocvar_g_arena_point_leadlimit;
maxspawned = autocvar_g_arena_maxspawned;
if(g_ca)
{
- gamemode_name = "Clan Arena";
ActivateTeamplay();
fraglimit_override = autocvar_g_ca_point_limit;
leadlimit_override = autocvar_g_ca_point_leadlimit;
}
if(g_keyhunt)
{
- gamemode_name = "Key Hunt";
ActivateTeamplay();
fraglimit_override = autocvar_g_keyhunt_point_limit;
leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
if(g_freezetag)
{
- gamemode_name = "Freeze Tag";
ActivateTeamplay();
fraglimit_override = autocvar_g_freezetag_point_limit;
leadlimit_override = autocvar_g_freezetag_point_leadlimit;
if(g_assault)
{
- gamemode_name = "Assault";
ActivateTeamplay();
ScoreRules_assault();
have_team_spawns = -1; // request team spawns
if(g_onslaught)
{
- gamemode_name = "Onslaught";
ActivateTeamplay();
have_team_spawns = -1; // request team spawns
}
if(g_race)
{
- gamemode_name = "Race";
if(autocvar_g_race_teams)
{
if(g_cts)
{
- gamemode_name = "CTS";
g_race_qualifying = 1;
fraglimit_override = 0;
leadlimit_override = 0;
if(g_nexball)
{
- gamemode_name = "Nexball";
fraglimit_override = autocvar_g_nexball_goallimit;
leadlimit_override = autocvar_g_nexball_goalleadlimit;
ActivateTeamplay();
if(g_keepaway)
{
- gamemode_name = "Keepaway";
MUTATOR_ADD(gamemode_keepaway);
}