#pragma once
-#ifdef SVQC
-#include <common/mutators/base.qh>
-#include <common/scores.qh>
-.float lms_spectate_warning;
-#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
-void lms_Initialize();
+#include <common/mapinfo.qh>
-REGISTER_MUTATOR(lms, false)
-{
- MUTATOR_STATIC();
- MUTATOR_ONADD
- {
- GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
- GameRules_limit_lead(0);
- GameRules_score_enabled(false);
- GameRules_scoring(0, 0, 0, {
- field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
- field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
- });
-
- lms_Initialize();
- }
- return 0;
-}
-
-// lives related defs
-float lms_lowest_lives;
-float LMS_NewPlayerLives();
-#endif
+CLASS(LastManStanding, Gametype)
+ INIT(LastManStanding)
+ {
+ this.gametype_init(this, _("Last Man Standing"),"lms","g_lms",GAMETYPE_FLAG_USEPOINTS | GAMETYPE_FLAG_HIDELIMITS,"","timelimit=20 lives=5 leadlimit=0",_("Survive and kill until the enemies have no lives left"));
+ }
+ METHOD(LastManStanding, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
+ {
+ return true;
+ }
+ METHOD(LastManStanding, m_configuremenu, void(Gametype this, entity menu, void(entity me, string pLabel, float pMin, float pMax, float pStep, string pCvar, string tCvar, string pTooltip) returns))
+ {
+ TC(Gametype, this);
+ returns(menu, _("Lives:"), 3, 50, 1, "g_lms_lives_override", string_null, string_null);
+ }
+ ATTRIB(LastManStanding, m_legacydefaults, string, "9 20 0");
+ENDCLASS(LastManStanding)
+REGISTER_GAMETYPE(LMS, NEW(LastManStanding));