Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
survival.qh
Go to the documentation of this file.
1#pragma once
2
4#include <common/mapinfo.qh>
5
6#ifdef CSQC
7void HUD_Mod_Survival(vector pos, vector mySize);
8#endif
11 {
12 this.gametype_init(this, _("Survival"), "surv", "g_survival", GAMETYPE_FLAG_USEPOINTS, "", "timelimit=20 pointlimit=12", _("Identify and eliminate all the hunters before all your allies are gone"));
13 }
14 METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
15 {
16 return true;
17 }
19 {
20 if(!cvar("g_survival_not_lms_maps"))
21 {
22 // if this is unset, all LMS maps support Survival too
23 if(!(MapInfo_Map_supportedGametypes & this.gametype_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.gametype_flags))
24 return true; // TODO: references another gametype (alternatively, we could check which gametypes are always enabled and append this if any are supported)
25 }
26 return false;
27 }
28#ifdef CSQC
29 ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival);
30#endif
33
34#ifdef GAMEQC
35// shared state signalling the player's survival status
37const int SURV_STATUS_PREY = 1;
38const int SURV_STATUS_HUNTER = 2;
39
40// hardcoded player colors for survival
41const int SURV_COLOR_PREY = 51; // green
42const int SURV_COLOR_HUNTER = 68; // red
43#endif
virtual void gametype_init()
Definition mapinfo.qh:117
virtual void m_isForcedSupported()
Definition survival.qh:18
virtual void m_isAlwaysSupported()
Definition survival.qh:14
int survival_status
Definition main.qc:569
vector MapInfo_Map_supportedGametypes
Definition mapinfo.qh:13
const int GAMETYPE_FLAG_USEPOINTS
Definition mapinfo.qh:20
#define REGISTER_GAMETYPE(NAME, inst)
Definition mapinfo.qh:149
vector gametype_flags
Definition mapinfo.qh:28
float cvar(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
const int SURV_COLOR_HUNTER
Definition survival.qh:42
const int SURV_STATUS_HUNTER
Definition survival.qh:38
const int SURV_COLOR_PREY
Definition survival.qh:41
void HUD_Mod_Survival(vector pos, vector mySize)
const int SURV_STATUS_PREY
Definition survival.qh:37