X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fsurvival%2Fsurvival.qh;h=baddfb5c26ec7cacddc4e1748f9bd57ecfebf783;hb=refs%2Fheads%2FMario%2Fsurvival;hp=53763575bdd9e4f142ba22a39f3fe10286317e26;hpb=85ada36b5953658c1711e415bc3676aee32277bf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/survival/survival.qh b/qcsrc/common/gamemodes/gamemode/survival/survival.qh index 53763575bd..baddfb5c26 100644 --- a/qcsrc/common/gamemodes/gamemode/survival/survival.qh +++ b/qcsrc/common/gamemodes/gamemode/survival/survival.qh @@ -1,5 +1,37 @@ #pragma once +#include +#include + +#ifdef CSQC +void HUD_Mod_Survival(vector pos, vector mySize); +#endif +CLASS(Survival, Gametype) + INIT(Survival) + { + 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")); + } + METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter)) + { + return true; + } + METHOD(Survival, m_isForcedSupported, bool(Gametype this)) + { + if(!cvar("g_survival_not_lms_maps")) + { + // if this is unset, all LMS maps support Survival too + if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.m_flags)) + return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported) + } + return false; + } +#ifdef CSQC + ATTRIB(Survival, m_modicons, void(vector pos, vector mySize), HUD_Mod_Survival); +#endif +ENDCLASS(Survival) +REGISTER_GAMETYPE(SURVIVAL, NEW(Survival)); + +#ifdef GAMEQC // shared state signalling the player's survival status .int survival_status; const int SURV_STATUS_PREY = 1; @@ -8,3 +40,4 @@ const int SURV_STATUS_HUNTER = 2; // hardcoded player colors for survival const int SURV_COLOR_PREY = 51; // green const int SURV_COLOR_HUNTER = 68; // red +#endif