]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move remaining gametype score rules to the respective gametype files
authorterencehill <piuntn@gmail.com>
Sun, 7 Dec 2014 14:29:55 +0000 (15:29 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 7 Dec 2014 14:29:55 +0000 (15:29 +0100)
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/scores_rules.qc

index 8b38ceb096a8cd537eda2238aad552d6fb7ae103..0f4689c63fc807f8f682aecadfae2183852c5f69 100644 (file)
@@ -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);
index ffdc1612dde1235608c2874da85eefc60dd37c15..96f227031991478ecd7f79888bc2397911924206 100644 (file)
@@ -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);
index ab67a4821259b27115be5a9e89c2001a9d3d04c2..0512fe3f0d7cbc7dff24dcddfadc2ea45b04eb57 100644 (file)
@@ -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()
index 8695ca31b2b95b13103f2735d46a0141ffc18a86..a32c99ac3abaf505a5ac1cd0dc4b73952e5b2d18 100644 (file)
@@ -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)
index fbbf93803707f0a406678b04776d79600a8cef02..6343625c0fd0e8f1c2e79f0b03b1fd6eb54711ba 100644 (file)
@@ -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();
-}