From: Mario Date: Sat, 18 Jul 2020 08:06:40 +0000 (+1000) Subject: Merge branch 'master' into Mario/survival X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0954810d77ef0295dca4959eb6cdd6bbbcfd800f;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into Mario/survival --- 0954810d77ef0295dca4959eb6cdd6bbbcfd800f diff --cc qcsrc/common/gamemodes/gamemode/survival/cl_survival.qh index 6f70f09be,000000000..057120a1f mode 100644,000000..100644 --- a/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qh +++ b/qcsrc/common/gamemodes/gamemode/survival/cl_survival.qh @@@ -1,1 -1,0 +1,3 @@@ +#pragma once ++ ++void HUD_Mod_Survival(vector pos, vector mySize); diff --cc qcsrc/common/gamemodes/gamemode/survival/survival.qh index 2d111901d,000000000..2176acbbd mode 100644,000000..100644 --- a/qcsrc/common/gamemodes/gamemode/survival/survival.qh +++ b/qcsrc/common/gamemodes/gamemode/survival/survival.qh @@@ -1,10 -1,0 +1,43 @@@ +#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"),"sv","g_survival",GAMETYPE_FLAG_USEPOINTS,"","timelimit=20 pointlimit=20",_("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 SV_STATUS_PREY = 1; +const int SV_STATUS_HUNTER = 2; + +// hardcoded player colors for survival +const int SV_COLOR_PREY = 51; // green +const int SV_COLOR_HUNTER = 68; // red ++#endif