]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/teamplay.qc
Let's not forget the fake prey
[voretournament/voretournament.git] / data / qcsrc / server / teamplay.qc
index 1bdef27dc627d74c0419b9d0a0634321fa730789..b0913fd73c1bef8db2db1de91e9029d4575192ac 100644 (file)
@@ -95,6 +95,7 @@ void WriteGameCvars()
        cvar_set("g_onslaught", ftos(g_onslaught));\r
        cvar_set("g_race", ftos(g_race));\r
        cvar_set("g_cts", ftos(g_cts));\r
+       cvar_set("g_rpg", ftos(g_rpg));\r
 }\r
 \r
 void ReadGameCvars()\r
@@ -119,6 +120,7 @@ void ReadGameCvars()
                found += (g_onslaught = (!found && (prev != GAME_ONSLAUGHT) && cvar("g_onslaught")));\r
                found += (g_race = (!found && (prev != GAME_RACE) && cvar("g_race")));\r
                found += (g_cts = (!found && (prev != GAME_CTS) && cvar("g_cts")));\r
+               found += (g_rpg = (!found && (prev != GAME_RPG) && cvar("g_rpg")));\r
 \r
                if(found)\r
                        break;\r
@@ -234,10 +236,7 @@ void InitGameplayMode()
                game = GAME_CTF;\r
                gamemode_name = "Capture the Flag";\r
                ActivateTeamplay();\r
-               if(cvar("g_campaign"))\r
-                       g_ctf_win_mode = 2;\r
-               else\r
-                       g_ctf_win_mode = cvar("g_ctf_win_mode");\r
+               g_ctf_win_mode = cvar("g_ctf_win_mode");\r
                g_ctf_ignore_frags = cvar("g_ctf_ignore_frags");\r
                if(g_ctf_win_mode == 2)\r
                {\r
@@ -343,6 +342,15 @@ void InitGameplayMode()
                leadlimit_override = 0;\r
        }\r
 \r
+       if(g_rpg)\r
+       {\r
+               game = GAME_RPG;\r
+               gamemode_name = "Role Play";\r
+               fraglimit_override = 0;\r
+               leadlimit_override = 0;\r
+               ScoreRules_rpg();\r
+       }\r
+\r
        if(teams_matter)\r
                entcs_init();\r
 \r
@@ -476,17 +484,21 @@ void PrintWelcomeMessage(entity pl)
                modifications = strcat(modifications, ", Bloodloss");\r
        if(g_jetpack)\r
                modifications = strcat(modifications, ", Jet pack");\r
-       if(cvar("g_balance_vore_weight_gravity") < 0)\r
-               modifications = strcat(modifications, ", Lighten");\r
+       if(!cvar("g_start_weapon_grabber"))\r
+               modifications = strcat(modifications, ", No start weapon");\r
+       if(!cvar("g_vore_digestion"))\r
+               modifications = strcat(modifications, ", Gentle Vore");\r
        if(cvar("g_balance_vore_digestion_damage") >= 1000)\r
                modifications = strcat(modifications, ", InstaDigestion");\r
+       if(cvar("g_balance_vore_weight_gravity") < 0)\r
+               modifications = strcat(modifications, ", Lighten");\r
        modifications = substring(modifications, 2, strlen(modifications) - 2);\r
 \r
        local string versionmessage;\r
        versionmessage = GetClientVersionMessage();\r
 \r
        s = strcat(s, NEWLINES, "This is Voretournament ", cvar_string("g_voretournamentversion"), "\n", versionmessage);\r
-       s = strcat(s, "^8\n\nmatch type is ^1", gamemode_name, "^8\n");\r
+       s = strcat(s, "^8\n\ngame type is ^1", gamemode_name, "^8\n");\r
 \r
        if(modifications != "")\r
                s = strcat(s, "^8\nactive modifications: ^3", modifications, "^8\n");\r
@@ -817,6 +829,33 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
        // find out what teams are available\r
        CheckAllowedTeams(pl);\r
 \r
+       // if we want the player in a certain team for campaign, force him there\r
+       if(cvar("g_campaign"))\r
+       if(clienttype(pl) == CLIENTTYPE_REAL) // only players, not bots\r
+       {\r
+               switch(cvar("g_campaign_forceteam"))\r
+               {\r
+                       case 1:\r
+                               SetPlayerColors(pl, COLOR_TEAM1 - 1);\r
+                               LogTeamchange(pl.playerid, pl.team, 2);\r
+                               return COLOR_TEAM1;\r
+                       case 2:\r
+                               SetPlayerColors(pl, COLOR_TEAM2 - 1);\r
+                               LogTeamchange(pl.playerid, pl.team, 2);\r
+                               return COLOR_TEAM2;\r
+                       case 3:\r
+                               SetPlayerColors(pl, COLOR_TEAM3 - 1);\r
+                               LogTeamchange(pl.playerid, pl.team, 2);\r
+                               return COLOR_TEAM3;\r
+                       case 4:\r
+                               SetPlayerColors(pl, COLOR_TEAM4 - 1);\r
+                               LogTeamchange(pl.playerid, pl.team, 2);\r
+                               return COLOR_TEAM4;\r
+                       default:\r
+                               break;\r
+               }\r
+       }\r
+\r
        // if we don't care what team he ends up on, put him on whatever team he entered as.\r
        // if he's not on a valid team, then let other code put him on the smallest team\r
        if(!forcebestteam)\r
@@ -849,7 +888,7 @@ float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
 \r
        smallest = FindSmallestTeam(pl, TRUE);\r
 \r
-       if(!only_return_best)\r
+       if(!only_return_best && !pl.bot_forced_team)\r
        {\r
                TeamchangeFrags(self);\r
                if(smallest == 1)\r