]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qh
Fixed int/float mismatch in teamplay.qh.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qh
index e24005a3211336bc53a8c082751df9bf82eeac74..9c0b490b621d55502ee21ae29a7b4d48a277c88d 100644 (file)
@@ -6,7 +6,18 @@ string cache_lastmutatormsg;
 // client counts for each team
 //float c1, c2, c3, c4;
 // # of bots on those teams
-float cb1, cb2, cb3, cb4;
+float numbotsteam1;
+float numbotsteam2;
+float numbotsteam3;
+float numbotsteam4;
+entity lowestplayerteam1;
+entity lowestplayerteam2;
+entity lowestplayerteam3;
+entity lowestplayerteam4;
+entity lowestbotteam1;
+entity lowestbotteam2;
+entity lowestbotteam3;
+entity lowestbotteam4;
 
 int redowned, blueowned, yellowowned, pinkowned;
 
@@ -16,21 +27,31 @@ void TeamchangeFrags(entity e);
 
 void LogTeamchange(float player_id, float team_number, float type);
 
-void default_delayedinit();
+void default_delayedinit(entity this);
 
 void ActivateTeamplay();
 
-void SetLimits(int fraglimit_override, int leadlimit_override, float timelimit_override, float qualifying_override);
-
 void InitGameplayMode();
 
-string GetClientVersionMessage();
+string GetClientVersionMessage(entity this);
+
+string getwelcomemessage(entity this);
 
-string getwelcomemessage();
+void SetPlayerColors(entity player, float _color);
 
-void SetPlayerColors(entity pl, float _color);
+/// \brief Sets the team of the player.
+/// \param[in,out] player Player to adjust.
+/// \param[in] teamnum Team number to set. See TEAM_NUM constants.
+/// \return True if team switch was successful, false otherwise.
+bool SetPlayerTeamSimple(entity player, int teamnum);
 
-void SetPlayerTeam(entity pl, float t, float s, float noprint);
+/// \brief Sets the team of the player.
+/// \param[in,out] player Player to adjust.
+/// \param[in] destinationteam Team to set.
+/// \param[in] sourceteam Previous team of the player.
+/// \param[in] noprint Whether to print this event to players' console.
+/// \return No return.
+void SetPlayerTeam(entity player, int destinationteam, int sourceteam, bool noprint);
 
 // set c1...c4 to show what teams are allowed
 void CheckAllowedTeams (entity for_whom);
@@ -41,15 +62,48 @@ float PlayerValue(entity p);
 // teams that are allowed will now have their player counts stored in c1...c4
 void GetTeamCounts(entity ignore);
 
-float TeamSmallerEqThanTeam(float ta, float tb, entity e);
+/// \brief Returns whether one team is smaller than the other.
+/// \param[in] teama First team.
+/// \param[in] teamb Second team.
+/// \param[in] e Player to check.
+/// \param[in] usescore Whether to take into account team scores.
+/// \return True if first team is smaller than the second one, false otherwise.
+/// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
+/// been called.
+bool IsTeamSmallerThanTeam(int teama, int teamb, entity e, bool usescore);
+
+/// \brief Returns whether one team is equal to the other.
+/// \param[in] teama First team.
+/// \param[in] teamb Second team.
+/// \param[in] e Player to check.
+/// \param[in] usescore Whether to take into account team scores.
+/// \return True if first team is equal to the second one, false otherwise.
+/// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
+/// been called.
+bool IsTeamEqualToTeam(int teama, int teamb, entity e, bool usescore);
+
+/// \brief Returns the bitmask of the best teams for the player to join.
+/// \param[in] player Player to check.
+/// \param[in] usescore Whether to take into account team scores.
+/// \return Bitmask of the best teams for the player to join.
+/// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
+/// been called.
+int FindBestTeams(entity player, bool usescore);
 
 // returns # of smallest team (1, 2, 3, 4)
 // NOTE: Assumes CheckAllowedTeams has already been called!
 float FindSmallestTeam(entity pl, float ignore_pl);
 
-int JoinBestTeam(entity pl, bool only_return_best, bool forcebestteam);
+int JoinBestTeam(entity this, bool only_return_best, bool forcebestteam);
 
-//void() ctf_playerchanged;
-void SV_ChangeTeam(float _color);
+/// \brief Auto balances bots in teams after the player has changed team.
+/// \param[in] sourceteam Previous team of the player (1, 2, 3, 4).
+/// \param[in] destinationteam Current team of the player (1, 2, 3, 4).
+/// \return No return.
+/// \note This function assumes that CheckAllowedTeams and GetTeamCounts have
+/// been called.
+void AutoBalanceBots(int sourceteam, int destinationteam);
 
 void ShufflePlayerOutOfTeam (float source_team);
+
+void setcolor(entity this, int clr);