From: LegendaryGuard Date: Mon, 11 Jul 2022 19:07:30 +0000 (+0200) Subject: Comment and write TOFIX, teamplay code changed the sections X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1d85ba2a612697490053a8d902b972a0976733d9;p=xonotic%2Fxonotic-data.pk3dir.git Comment and write TOFIX, teamplay code changed the sections --- diff --git a/qcsrc/common/gamemodes/gamemode/mh/TODO.txt b/qcsrc/common/gamemodes/gamemode/mh/TODO.txt index a3192b817..cd448b62d 100644 --- a/qcsrc/common/gamemodes/gamemode/mh/TODO.txt +++ b/qcsrc/common/gamemodes/gamemode/mh/TODO.txt @@ -2,6 +2,7 @@ add g_mh_startitem cvars to the balance files +2 waypoint modes, waypoints for runners on round start always and waypoints for hunters when there are 3 or more hunters +only runners can see other runners but hunters don't see others rename teams as far as possible @@ -15,6 +16,15 @@ more dynamicity for the code :) add more TODO: notes -if player(runner) taunts, his autotaunt time is restarted. something similar to "voice taunt" +fix waypoint visibility, currently they are always visible to everyone. Fix them to not be visible for spectators of that player. -fix waypoint visibility, currently they are always visible to everyone. Fix them to not be visible for spectators of that player. \ No newline at end of file + +Message for Jaska: + +Hi, Jaska, thank you for the great work, I returned the stuff as should. +I was doing 'Prop Hunt' experiments after MH was completed, I shouldn't have touched the branch too much. +I consider leaving MH as completed, feel free to open a MR about that. The gamemode looks standardized. +Apologies for my experiments. + +Sincerely, +LegendGuard diff --git a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc index 2ab7bac54..ead343e1e 100644 --- a/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc +++ b/qcsrc/common/gamemodes/gamemode/mh/sv_mh.qc @@ -354,13 +354,17 @@ void MH_count_players() total_players = 0; for (int i = 1; i <= 2; ++i){ Team_SetNumberOfAlivePlayers(Team_GetTeamFromIndex(i), 0); - Team_SetNumberOfTotalPlayers(Team_GetTeamFromIndex(i), 0); + // TOFIX: After merging master, this function has been removed + //Team_SetNumberOfTotalPlayers(Team_GetTeamFromIndex(i), 0); } FOREACH_CLIENT(IS_PLAYER(it) && Entity_HasValidTeam(it),{ entity team_ = Entity_GetTeam(it); - int num_total = Team_GetNumberOfTotalPlayers(team_); + // TOFIX: After merging master, this function (Team_GetNumberOfTotalPlayers()) has been removed + //int num_total = Team_GetNumberOfTotalPlayers(team_); + int num_total = 1; ++num_total; - Team_SetNumberOfTotalPlayers(team_, num_total); + // TOFIX: After merging master, this function has been removed + //Team_SetNumberOfTotalPlayers(team_, num_total); ++total_players; if (IS_DEAD(it)){ continue; @@ -396,12 +400,16 @@ void MH_count_players() int MH_GetWinnerTeam() { //both teams have players - if ((Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(1)) >= 1) && (Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) >= 1)){ + // TOFIX: After merging master, this function (Team_GetNumberOfTotalPlayers()) has been removed + //if ((Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(1)) >= 1) && + if (Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) >= 1){ return Team_IndexToTeam(2); } //only hunters were alive - if ((Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(1)) >= 1) && (Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) == 0)){ + // TOFIX: After merging master, this function (Team_GetNumberOfTotalPlayers()) has been removed + //if ((Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(1)) >= 1) && + if (Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2)) == 0){ return Team_IndexToTeam(1); } @@ -431,7 +439,8 @@ float MH_CheckWinner() //(9 total players / 3 total runners) / 2 = 1.5 score per second (5v4 in the beginning and only 1 person has been tagged making it 6v3) //(10 total players / 1 total runner) / 2 = 5 score per second (5v5 in which only 1 runner is alive, they gain 5 score per second as last alive) //(10 total players / 9 total runners) / 2 = 0.55556 score per second(1 hunter and 9 runners, doesn't really award runners for stacking for that team) - float survivalscore = (((total_players/(Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(2))))/2)/(1/cvar("sys_ticrate"))); + // TOFIX: After merging master, this function (Team_GetNumberOfTotalPlayers()) has been removed + float survivalscore = (((total_players)/2)/(1/cvar("sys_ticrate"))); FOREACH_CLIENT(IS_PLAYER(it) && it.team == 14, { GameRules_scoring_add_team(it, SCORE, (survivalscore)); }); //add 1 score to each runner's score per second at 60 tickrate } @@ -487,7 +496,9 @@ bool MH_CheckTeams() static int prev_missing_teams_mask; allowed_to_spawn_untagged = true; MH_count_players(); - if (Team_GetNumberOfTotalTeams() == NumTeams(mh_teams)){ + // TOFIX: After merging master, this function has been removed + if ((Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(1)) + + Team_GetNumberOfAlivePlayers(Team_GetTeamFromIndex(2))) == NumTeams(mh_teams)){ if(prev_missing_teams_mask > 0) Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; @@ -501,8 +512,9 @@ bool MH_CheckTeams() } int missing_teams_mask = 0; for (int i = 1; i <= 2; ++i){ - if ((mh_teams & Team_IndexToBit(i)) && - (Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(i)) == 0)){ + if (mh_teams & Team_IndexToBit(i)) { // && + // TOFIX: After merging master, this function (Team_GetNumberOfTotalPlayers()) has been removed + //(Team_GetNumberOfTotalPlayers(Team_GetTeamFromIndex(i)) == 0)){ missing_teams_mask |= Team_IndexToBit(i); } } diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index e81beabb4..d96b7df4b 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -46,11 +46,6 @@ void Team_SetTeamScore(entity team_ent, float score); /// \return Number of alive players in a team. int Team_GetNumberOfAlivePlayers(entity team_ent); -/// \brief Returns the number of total players in a team. -/// \param[in] team_ent Team entity. -/// \return Number of total players in a team. -int Team_GetNumberOfTotalPlayers(entity team_ent); - /// \brief Sets the number of alive players in a team. /// \param[in,out] team_ent Team entity. /// \param[in] number Number of players to set.