This commit is contained in:
azw 2023-03-22 07:32:52 +00:00
parent 819a370836
commit 9dfaa0d3a8
3 changed files with 27 additions and 1 deletions

View File

@ -3259,6 +3259,7 @@ void Human::CalcStats()
if (stats->pve_kill_boss) {
stats->victory = true;
stats->settlement_color = 1;
GetTeam()->settlement_color = 1;
GetTeam()->team_rank = 1;
}
} else {
@ -3267,17 +3268,20 @@ void Human::CalcStats()
GetTeam()->team_rank = room->GetAliveTeamNum();
stats->pvp_settlement_type = GetTeam()->GetMemberNum() > 1 ? 1 : 0;
stats->settlement_color = 1;
GetTeam()->settlement_color = 1;
} else {
if (room->GetAliveTeamNum() == 1) {
if (room->GetAliveTeam() == GetTeam()) {
GetTeam()->team_rank = 1;
stats->pvp_settlement_type = GetTeam()->GetMemberNum() > 1 ? 1 : 0;
stats->settlement_color = 1;
GetTeam()->settlement_color = 1;
}
}
}
if (rank < 10) {
stats->settlement_color = 1;
GetTeam()->settlement_color = 1;
}
if (stats->victory) {
GetTeam()->team_rank = 1;

View File

@ -208,7 +208,7 @@ void Team::GenBattleReportData(a8::MutableXObject* params)
params->SetVal("pve_max_wave", room->pve_data.max_wave);
} else {
params->SetVal("pvp_settelement_type", 1);
//params->SetVal("pvp_settelement_color", 1);
params->SetVal("pvp_settelement_color", settlement_color);
params->SetVal("pvp_team_rank", team_rank);
params->SetVal("pvp_total_human_num", room->GetHumanNum());
params->SetVal("pvp_alive_human_num", room->AliveCount());
@ -217,4 +217,25 @@ void Team::GenBattleReportData(a8::MutableXObject* params)
params->SetVal("pvp_team_kills", 0);
}
{
room->TraverseTeams
(
[params] (Team* team)
{
auto members_pb = a8::MutableXObject::CreateArray();
team->TraverseMembers
(
[members_pb] (Human* hum)
{
auto member_pb = a8::MutableXObject::CreateObject();
member_pb->SetVal("account_id", hum->account_id);
members_pb->Push(*member_pb);
return true;
});
auto team_pb = a8::MutableXObject::CreateObject();
team_pb->SetVal("team_id", team->GetTeamId());
team_pb->SetVal("members", *members_pb);
return true;
});
}
}

View File

@ -18,6 +18,7 @@ class Team
Room* room = nullptr;
int team_rank = 0;
std::map<int, glm::vec3> target_pos;
int settlement_color = 0;
bool sending_battlereport = false;
bool already_report_battle = false;