This commit is contained in:
aozhiwei 2023-10-11 12:45:58 +08:00
parent 6bcb50de9e
commit 8c7006d072
3 changed files with 10 additions and 0 deletions

View File

@ -499,3 +499,9 @@ int Team::GetKillCount()
{
return kill_count_;
}
void Team::IncKillCount()
{
++kill_count_;
last_kill_frameno_ = room->GetFrameNo();
}

View File

@ -52,7 +52,9 @@ class Team
void RunAway(Human* hum);
bool AllIsRunAway();
bool IsViewTeam() { return is_view_; }
void IncKillCount();
int GetKillCount();
long long GetLastKillFrameNo() { return last_kill_frameno_; }
private:
int team_id_ = 0;
@ -63,4 +65,5 @@ class Team
Human* first_member_ = nullptr;
bool auto_fill_ = false;
int kill_count_ = 0;
long long last_kill_frameno_ = 0;
};

View File

@ -148,6 +148,7 @@ void Trigger::Kill(Creature* target, int weapon_id)
owner_hum->CalcAssists(target_hum);
if (target->GetUniId() != owner_->GetUniId()) {
owner_->AsHuman()->stats->kills++;
owner_->AsHuman()->GetTeam()->IncKillCount();
}
owner_->AsHuman()->stats->last_kill_frameno = owner_->room->GetFrameNo();
owner_->AsHuman()->kill_humans.insert(target->AsHuman());