]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/survival
authorMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 08:06:40 +0000 (18:06 +1000)
committerMario <mario.mario@y7mail.com>
Sat, 18 Jul 2020 08:06:40 +0000 (18:06 +1000)
1  2 
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/common/gamemodes/gamemode/survival/cl_survival.qh
qcsrc/common/gamemodes/gamemode/survival/survival.qh
qcsrc/menu/xonotic/util.qc
qcsrc/server/g_world.qc

Simple merge
index 6f70f09beec2219624baeca92e2cd7deaa104fb4,0000000000000000000000000000000000000000..057120a1fcf2aba34ba9700b9067bde3ec91561a
mode 100644,000000..100644
--- /dev/null
@@@ -1,1 -1,0 +1,3 @@@
 +#pragma once
++
++void HUD_Mod_Survival(vector pos, vector mySize);
index 2d111901d07296000ed6529779975cac1f49f035,0000000000000000000000000000000000000000..2176acbbd8b7338bf2e39cfb283e66900d9bf43a
mode 100644,000000..100644
--- /dev/null
@@@ -1,10 -1,0 +1,43 @@@
 +#pragma once
 +
++#include <common/gamemodes/gamemode/lms/lms.qh>
++#include <common/mapinfo.qh>
++
++#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
Simple merge
Simple merge