]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/survival/survival.qh
Replace 'sv' into 'surv' to avoid possible future confusions
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / survival / survival.qh
1 #pragma once
2
3 #include <common/gamemodes/gamemode/lms/lms.qh>
4 #include <common/mapinfo.qh>
5
6 #ifdef CSQC
7 void HUD_Mod_Survival(vector pos, vector mySize);
8 #endif
9 CLASS(Survival, Gametype)
10     INIT(Survival)
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     }
18     METHOD(Survival, m_isForcedSupported, bool(Gametype this))
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.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)
25         }
26         return false;
27     }
28 #ifdef CSQC
29     ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival);
30 #endif
31 ENDCLASS(Survival)
32 REGISTER_GAMETYPE(SURVIVAL, NEW(Survival));
33
34 #ifdef GAMEQC
35 // shared state signalling the player's survival status
36 .int survival_status;
37 const int SURV_STATUS_PREY = 1;
38 const int SURV_STATUS_HUNTER = 2;
39
40 // hardcoded player colors for survival
41 const int SURV_COLOR_PREY = 51; // green
42 const int SURV_COLOR_HUNTER = 68; // red
43 #endif