]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/gamemodes/gamemode/lms/sv_lms.qh
LMS: improve rank assignment to forfeiters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamemodes / gamemode / lms / sv_lms.qh
1 #pragma once
2
3 #include <common/mutators/base.qh>
4 #include <common/scores.qh>
5
6 // 1 when player presses F3 to spectate for the first time (he only gets a warning)
7 // 2 when player goes spectator (presses F3 to spectate for the second time)
8 // 3 when player disconnects
9 .int lms_spectate_warning;
10 .int lmsplayer;
11
12 #define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
13 string autocvar_g_lms_weaponarena = "most_available";
14
15 void lms_Initialize();
16
17 REGISTER_MUTATOR(lms, false)
18 {
19     MUTATOR_STATIC();
20         MUTATOR_ONADD
21         {
22         GameRules_limit_score(((!autocvar_g_lms_lives_override) ? -1 : autocvar_g_lms_lives_override));
23         GameRules_limit_lead(0);
24         GameRules_score_enabled(false);
25         GameRules_scoring(0, 0, 0, {
26             field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
27             field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
28         });
29
30                 lms_Initialize();
31         }
32         return 0;
33 }
34
35 // lives related defs
36 int lms_lowest_lives;
37 int LMS_NewPlayerLives();