From: terencehill Date: Sun, 7 Dec 2014 14:29:55 +0000 (+0100) Subject: Move remaining gametype score rules to the respective gametype files X-Git-Tag: xonotic-v0.8.0~116^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4f533c7987a0e841b03ff81a85a9eabb55a6bc1f;p=xonotic%2Fxonotic-data.pk3dir.git Move remaining gametype score rules to the respective gametype files --- diff --git a/qcsrc/server/mutators/gamemode_ca.qc b/qcsrc/server/mutators/gamemode_ca.qc index 8b38ceb09..0f4689c63 100644 --- a/qcsrc/server/mutators/gamemode_ca.qc +++ b/qcsrc/server/mutators/gamemode_ca.qc @@ -4,6 +4,14 @@ float redalive, bluealive, yellowalive, pinkalive; float ca_teams; float allowed_to_spawn; +#define ST_CA_ROUNDS 1 +void ca_ScoreRules(float teams) +{ + ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE); + ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY); + ScoreRules_basics_end(); +} + void CA_count_alive_players() { entity e; @@ -290,7 +298,7 @@ void ca_Initialize() ca_teams = autocvar_g_ca_teams; ca_teams = bound(2, ca_teams, 4); ret_float = ca_teams; - ScoreRules_ca(ca_teams); + ca_ScoreRules(ca_teams); round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart); round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit); diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index ffdc1612d..96f227031 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -5,6 +5,14 @@ #define ICE_MIN_ALPHA 0.1 float freezetag_teams; +#define SP_FREEZETAG_REVIVALS 4 +void freezetag_ScoreRules(float teams) +{ + ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY + ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0); + ScoreRules_basics_end(); +} + void freezetag_count_alive_players() { entity e; @@ -500,7 +508,7 @@ void freezetag_Initialize() if(freezetag_teams < 2) freezetag_teams = autocvar_g_freezetag_teams; freezetag_teams = bound(2, freezetag_teams, 4); - ScoreRules_freezetag(freezetag_teams); + freezetag_ScoreRules(freezetag_teams); round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null); round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit); diff --git a/qcsrc/server/mutators/gamemode_keyhunt.qc b/qcsrc/server/mutators/gamemode_keyhunt.qc index ab67a4821..0512fe3f0 100644 --- a/qcsrc/server/mutators/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/gamemode_keyhunt.qc @@ -67,6 +67,26 @@ string kh_sound_alarm = "kh/alarm.wav"; // the new siren/alarm float kh_key_dropped, kh_key_carried; +#define ST_KH_CAPS 1 +#define SP_KH_CAPS 4 +#define SP_KH_PUSHES 5 +#define SP_KH_DESTROYS 6 +#define SP_KH_PICKUPS 7 +#define SP_KH_KCKILLS 8 +#define SP_KH_LOSSES 9 +void kh_ScoreRules(float teams) +{ + ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); + ScoreInfo_SetLabel_TeamScore( ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); + ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); + ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0); + ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER); + ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0); + ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0); + ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER); + ScoreRules_basics_end(); +} + float kh_KeyCarrier_waypointsprite_visible_for_player(entity e) // runs all the time { if(!IS_PLAYER(e) || self.team != e.team) @@ -990,7 +1010,7 @@ void kh_Initialize() // sets up th KH environment addstat(STAT_KH_KEYS, AS_INT, kh_state); - ScoreRules_kh(kh_teams); + kh_ScoreRules(kh_teams); } void kh_finalize() diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 8695ca31b..a32c99ac3 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -22,6 +22,17 @@ float OtherTeam(float t) //works only if there are two teams on the map! return e.team; } +#define ST_NEXBALL_GOALS 1 +#define SP_NEXBALL_GOALS 4 +#define SP_NEXBALL_FAULTS 5 +void nb_ScoreRules(float teams) +{ + ScoreRules_basics(teams, 0, 0, TRUE); + ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); + ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); + ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER); + ScoreRules_basics_end(); +} void LogNB(string mode, entity actor) { @@ -457,16 +468,6 @@ void nb_spawnteams(void) } } -// scoreboard setup -void nb_ScoreRules(float teams) -{ - ScoreRules_basics(teams, 0, 0, TRUE); - ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); - ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); - ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER); - ScoreRules_basics_end(); -} - void nb_delayedinit(void) { if(find(world, classname, "nexball_team") == world) diff --git a/qcsrc/server/scores_rules.qc b/qcsrc/server/scores_rules.qc index fbbf93803..6343625c0 100644 --- a/qcsrc/server/scores_rules.qc +++ b/qcsrc/server/scores_rules.qc @@ -44,52 +44,3 @@ void ScoreRules_generic() ScoreRules_basics_end(); } -// Key hunt stuff -#define ST_KH_CAPS 1 -#define SP_KH_CAPS 4 -#define SP_KH_PUSHES 5 -#define SP_KH_DESTROYS 6 -#define SP_KH_PICKUPS 7 -#define SP_KH_KCKILLS 8 -#define SP_KH_LOSSES 9 -void ScoreRules_kh(float teams) -{ - ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); - ScoreInfo_SetLabel_TeamScore (ST_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); - ScoreInfo_SetLabel_PlayerScore(SP_KH_CAPS, "caps", SFL_SORT_PRIO_SECONDARY); - ScoreInfo_SetLabel_PlayerScore(SP_KH_PUSHES, "pushes", 0); - ScoreInfo_SetLabel_PlayerScore(SP_KH_DESTROYS, "destroyed", SFL_LOWER_IS_BETTER); - ScoreInfo_SetLabel_PlayerScore(SP_KH_PICKUPS, "pickups", 0); - ScoreInfo_SetLabel_PlayerScore(SP_KH_KCKILLS, "kckills", 0); - ScoreInfo_SetLabel_PlayerScore(SP_KH_LOSSES, "losses", SFL_LOWER_IS_BETTER); - ScoreRules_basics_end(); -} - -// Nexball stuff -#define ST_NEXBALL_GOALS 1 -#define SP_NEXBALL_GOALS 4 -#define SP_NEXBALL_FAULTS 5 -void ScoreRules_nexball(float teams) -{ - ScoreRules_basics(teams, 0, 0, TRUE); - ScoreInfo_SetLabel_TeamScore( ST_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); - ScoreInfo_SetLabel_PlayerScore( SP_NEXBALL_GOALS, "goals", SFL_SORT_PRIO_PRIMARY); - ScoreInfo_SetLabel_PlayerScore(SP_NEXBALL_FAULTS, "faults", SFL_SORT_PRIO_SECONDARY | SFL_LOWER_IS_BETTER); - ScoreRules_basics_end(); -} - -#define SP_FREEZETAG_REVIVALS 4 -void ScoreRules_freezetag(float teams) -{ - ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY - ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS, "revivals", 0); - ScoreRules_basics_end(); -} - -#define ST_CA_ROUNDS 1 -void ScoreRules_ca(float teams) -{ - ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE); - ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY); - ScoreRules_basics_end(); -}