X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fkeyhunt%2Fkeyhunt.qh;fp=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fkeyhunt%2Fkeyhunt.qh;h=cc9cecdaf2a19aaabf2281fcad12b4b7e104d22b;hb=4247727e85005eee923c6c3b3b3c25b58a94c42d;hp=6f70f09beec2219624baeca92e2cd7deaa104fb4;hpb=5b4dd1bb267836163dec0a6e1709721e645a43aa;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh b/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh index 6f70f09be..cc9cecdaf 100644 --- a/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh +++ b/qcsrc/common/gamemodes/gamemode/keyhunt/keyhunt.qh @@ -1 +1,46 @@ #pragma once + +#include + +#ifdef CSQC +void HUD_Mod_KH(vector pos, vector mySize); +#endif +CLASS(KeyHunt, Gametype) + INIT(KeyHunt) + { + this.gametype_init(this, _("Key Hunt"),"kh","g_keyhunt",GAMETYPE_FLAG_TEAMPLAY | GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=1000 teams=3 leadlimit=0",_("Gather all the keys to win the round")); + } + METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v)) + { + if (!k) { + cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams")); + return true; + } + switch (k) { + case "teams": + cvar_set("g_keyhunt_teams", v); + return true; + } + return false; + } + METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + if(spawnpoints >= 12 && diameter > 5120) + return true; + return false; + } + METHOD(KeyHunt, m_setTeams, void(string sa)) + { + cvar_set("g_keyhunt_teams", sa); + } + METHOD(KeyHunt, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns)) + { + TC(Gametype, this); + returns(menu, _("Point limit:"), 200, 1500, 50, "g_keyhunt_point_limit", "g_keyhunt_teams_override", _("The amount of points needed before the match will end")); + } +#ifdef CSQC + ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH); +#endif + ATTRIB(KeyHunt, m_legacydefaults, string, "1000 20 3 0"); +ENDCLASS(KeyHunt) +REGISTER_GAMETYPE(KEYHUNT, NEW(KeyHunt));