3 #include <common/gamemodes/gamemode/lms/lms.qh>
4 #include <common/mapinfo.qh>
7 void HUD_Mod_Survival(vector pos, vector mySize);
9 CLASS(Survival, Gametype)
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"));
14 METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
18 METHOD(Survival, m_isForcedSupported, bool(Gametype this))
20 if(!cvar("g_survival_not_lms_maps"))
22 // if this is unset, all LMS maps support Survival too
23 if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.m_flags))
24 return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
29 ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival);
32 REGISTER_GAMETYPE(SURVIVAL, NEW(Survival));
35 // shared state signalling the player's survival status
37 const int SURV_STATUS_PREY = 1;
38 const int SURV_STATUS_HUNTER = 2;
40 // hardcoded player colors for survival
41 const int SURV_COLOR_PREY = 51; // green
42 const int SURV_COLOR_HUNTER = 68; // red