Xonotic
sv_lms.qh File Reference
+ Include dependency graph for sv_lms.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define autocvar_g_lms_lives_override   cvar("g_lms_lives_override")
 

Functions

void lms_Initialize ()
 
int LMS_NewPlayerLives ()
 
 REGISTER_MUTATOR (lms, false)
 

Variables

string autocvar_g_lms_weaponarena = "most_available"
 
int lms_lowest_lives
 
int lms_spectate_warning
 

Macro Definition Documentation

◆ autocvar_g_lms_lives_override

#define autocvar_g_lms_lives_override   cvar("g_lms_lives_override")

Definition at line 11 of file sv_lms.qh.

Referenced by REGISTER_MUTATOR().

Function Documentation

◆ lms_Initialize()

void lms_Initialize ( )

Definition at line 531 of file sv_lms.qc.

References lms_lowest_lives.

Referenced by REGISTER_MUTATOR().

532 {
533  lms_lowest_lives = 999;
534 }
int lms_lowest_lives
Definition: sv_lms.qh:35
+ Here is the caller graph for this function:

◆ LMS_NewPlayerLives()

int LMS_NewPlayerLives ( )

Definition at line 17 of file sv_lms.qc.

References autocvar_g_lms_join_anytime, autocvar_g_lms_last_join, bound(), ClearWinners(), floor(), lms_lowest_lives, and max().

Referenced by lms_AddPlayer(), and WinningCondition_LMS().

18 {
19  int fl = floor(autocvar_fraglimit);
20  if(fl == 0 || fl > 999)
21  fl = 999;
22 
23  // first player has left the game for dying too much? Nobody else can get in.
24  if(lms_lowest_lives < 1)
25  return 0;
26 
29  return 0;
30 
31  return bound(1, lms_lowest_lives, fl);
32 }
int lms_lowest_lives
Definition: sv_lms.qh:35
bool autocvar_g_lms_join_anytime
Definition: sv_lms.qc:10
int autocvar_g_lms_last_join
Definition: sv_lms.qc:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( lms  ,
false   
)

Definition at line 16 of file sv_lms.qh.

References autocvar_g_lms_lives_override, GameRules_limit_lead(), GameRules_limit_score(), GameRules_score_enabled(), GameRules_scoring, lms_Initialize(), MUTATOR_ONADD, MUTATOR_STATIC, SFL_ALLOW_HIDE, SFL_LOWER_IS_BETTER, SFL_RANK, SFL_SORT_PRIO_PRIMARY, and SFL_SORT_PRIO_SECONDARY.

17 {
20  {
24  GameRules_scoring(0, 0, 0, {
25  field(SP_LMS_LIVES, "lives", SFL_SORT_PRIO_SECONDARY);
26  field(SP_LMS_RANK, "rank", SFL_LOWER_IS_BETTER | SFL_RANK | SFL_SORT_PRIO_PRIMARY | SFL_ALLOW_HIDE);
27  });
28 
30  }
31  return 0;
32 }
#define GameRules_scoring(teams, spprio, stprio, fields)
Definition: sv_rules.qh:53
#define MUTATOR_STATIC()
Definition: base.qh:288
const int SFL_SORT_PRIO_SECONDARY
Scoring priority (NOTE: PRIMARY is used for fraglimit)
Definition: scores.qh:126
void GameRules_limit_score(int limit)
Definition: sv_rules.qc:34
const int SFL_SORT_PRIO_PRIMARY
Definition: scores.qh:127
void lms_Initialize()
Definition: sv_lms.qc:531
void GameRules_score_enabled(bool value)
Disabling score disables the "score" column on the scoreboard.
Definition: sv_rules.qc:28
const int SFL_RANK
Display as a rank (with st, nd, rd, th suffix)
Definition: scores.qh:113
const int SFL_LOWER_IS_BETTER
Lower scores are better (e.g.
Definition: scores.qh:98
#define autocvar_g_lms_lives_override
Definition: sv_lms.qh:11
void GameRules_limit_lead(int limit)
Definition: sv_rules.qc:44
#define MUTATOR_ONADD
Definition: base.qh:284
const int SFL_ALLOW_HIDE
Allow a column to be hidden (do not automatically add it even if it is a sorting key) ...
Definition: scores.qh:108
+ Here is the call graph for this function:

Variable Documentation

◆ autocvar_g_lms_weaponarena

string autocvar_g_lms_weaponarena = "most_available"

Definition at line 12 of file sv_lms.qh.

Referenced by MUTATOR_HOOKFUNCTION().

◆ lms_lowest_lives

int lms_lowest_lives

Definition at line 35 of file sv_lms.qh.

Referenced by lms_Initialize(), LMS_NewPlayerLives(), and MUTATOR_HOOKFUNCTION().

◆ lms_spectate_warning

int lms_spectate_warning

Definition at line 9 of file sv_lms.qh.