Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
keyhunt.qh
Go to the documentation of this file.
1#pragma once
2
3#include <common/mapinfo.qh>
4
5#ifdef CSQC
6void HUD_Mod_KH(vector pos, vector mySize);
7#endif
10 {
11 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"));
12 }
13 METHOD(KeyHunt, m_parse_mapinfo, bool(string k, string v))
14 {
15 if (!k)
16 {
17 cvar_set("g_keyhunt_teams", cvar_defstring("g_keyhunt_teams"));
18 return true;
19 }
20 switch (k)
21 {
22 case "teams":
23 cvar_set("g_keyhunt_teams", v);
24 return true;
25 }
26 return false;
27 }
28 METHOD(KeyHunt, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
29 {
30 if(spawnpoints >= 12 && diameter > 5120)
31 return true;
32 return false;
33 }
34 METHOD(KeyHunt, m_setTeams, void(string sa))
35 {
36 cvar_set("g_keyhunt_teams", sa);
37 }
38 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))
39 {
40 TC(Gametype, this);
41 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"));
42 }
43#ifdef CSQC
44 ATTRIB(KeyHunt, m_modicons, void(vector pos, vector mySize), HUD_Mod_KH);
45#endif
46 ATTRIB(KeyHunt, m_legacydefaults, string, "1000 20 3 0");
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
virtual void gametype_init()
Definition mapinfo.qh:117
virtual void m_isAlwaysSupported()
Definition keyhunt.qh:28
virtual void m_configuremenu()
Definition keyhunt.qh:38
virtual void m_parse_mapinfo()
Definition keyhunt.qh:13
KeyHunt()
Definition keyhunt.qh:9
string m_legacydefaults
Definition keyhunt.qh:46
virtual void m_setTeams()
Definition keyhunt.qh:34
void HUD_Mod_KH(vector pos, vector mySize)
Definition cl_keyhunt.qc:8
#define TC(T, sym)
Definition _all.inc:82
const int GAMETYPE_FLAG_USEPOINTS
Definition mapinfo.qh:20
#define REGISTER_GAMETYPE(NAME, inst)
Definition mapinfo.qh:149
const int GAMETYPE_FLAG_TEAMPLAY
Definition mapinfo.qh:19
void cvar_set(string name, string value)
const string cvar_defstring(string name)
#define NEW(cname,...)
Definition oo.qh:117
#define INIT(cname)
Definition oo.qh:210
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
#define ATTRIB(...)
Definition oo.qh:148
vector
Definition self.qh:92