This commit is contained in:
aozhiwei 2024-04-30 14:53:31 +08:00
parent a89dfed350
commit 3981969dfd
3 changed files with 24 additions and 0 deletions

View File

@ -501,6 +501,17 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
for (auto& str : strings) {
SendDebugMsg("数值: " + str);
}
} else if (cmd == "moba_pingju" && cmds.size() >= 0) {
if (room->IsMobaModeRoom() && !room->IsGameOver()) {
room->TraverseTeams
(
[] (Team* team) -> bool
{
team->SetKillCount(5);
return true;
});
room->xtimer.Delete(room->moba_over_timer);
}
} else if (cmd == "findpath" && cmds.size() >= 3) {
float x = a8::XValue(cmds[1]).GetDouble();
float y = a8::XValue(cmds[2]).GetDouble();

View File

@ -537,6 +537,9 @@ void Team::IncKillCount()
#endif
++kill_count_;
last_kill_frameno_ = room->GetFrameNo();
if (room->IsMobaModeRoom() && room->GetMobaOvertimeRaceFrameNo() > 0) {
room->MobaOver();
}
}
int Team::GetAlivePlayerNum()
@ -828,3 +831,10 @@ void Team::GenRoomReportData(a8::MutableXObject* params)
params->SetVal("pvp_team_kills", pvp_team_kills);
}
}
#ifdef MYDEBUG
void Team::SetKillCount(int count)
{
kill_count_ = count;
}
#endif

View File

@ -56,6 +56,9 @@ class Team : public std::enable_shared_from_this<Team>
bool IsViewTeam() { return is_view_; }
void SetViewTeam() { is_view_ = true; }
void IncKillCount();
#ifdef MYDEBUG
void SetKillCount(int count);
#endif
int GetKillCount();
long long GetLastKillFrameNo() { return last_kill_frameno_; }
bool MemberHasOb();