This commit is contained in:
aozhiwei 2024-01-17 11:24:31 +08:00
parent 00bf176e4f
commit 9de94b999d
3 changed files with 17 additions and 0 deletions

View File

@ -3821,6 +3821,13 @@ void Human::CalcStats()
}
} if (room->IsMobaModeRoom()) {
stats->victory = GetTeam() == room->GetVictoryTeam();
if (GetTeam() == room->GetVictoryTeam()) {
GetTeam()->team_rank = 1;
room->GetMobaEnemyTeam(GetTeam())->team_rank = 2;
} else {
GetTeam()->team_rank = 2;
room->GetMobaEnemyTeam(GetTeam())->team_rank = 1;
}
if (GetTeam()->team_rank == 1) {
stats->settlement_color = 1;
GetTeam()->settlement_color = 1;

View File

@ -3676,3 +3676,12 @@ int Room::GetMobaLeftTime()
long long remain_time = xtimer.GetRemainTime(moba_over_timer);
return (remain_time * FRAME_RATE_MS);
}
Team* Room::GetMobaEnemyTeam(Team* self_team)
{
if (self_team == GetMobaTeamA()) {
return GetMobaTeamB();
} else {
return GetMobaTeamA();
}
}

View File

@ -279,6 +279,7 @@ public:
int GetMobaLeftTime();
Team* GetMobaTeamA() { return moba_team_a_; }
Team* GetMobaTeamB() { return moba_team_b_; }
Team* GetMobaEnemyTeam(Team* self_team);
RoomAgent* GetRoomAgent() { return room_agent_; }
int GenShotUniid() { return ++current_shot_uniid_; }
int InitWithMobaBattle(long ip_saddr, int socket_handle, std::shared_ptr<cs::CMJoin> msg,