41 lines
986 B
C++
41 lines
986 B
C++
#pragma once
|
|
|
|
class Room;
|
|
class Human;
|
|
class Team;
|
|
|
|
class InGameVoice : public std::enable_shared_from_this<InGameVoice>
|
|
{
|
|
public:
|
|
|
|
InGameVoice(Room* room);
|
|
~InGameVoice();
|
|
|
|
void Init();
|
|
void UnInit();
|
|
|
|
void OnHumanBeKill(int killer_id, Human* deader);
|
|
void OnHumanRevive(Human* hum);
|
|
void Fail(Team* team);
|
|
void Victory(Team* team);
|
|
long long GetLastKillFrameNo(int killer_id);
|
|
|
|
private:
|
|
void UpdateTeamBeKillLastTime(int team_id);
|
|
void TriggerEvent(Human* killer, Human* deader);
|
|
bool IsSpecSeriesKill(Human* killer, Human* deader);
|
|
|
|
void Notify(Human* killer, Human* deader, const mt::InGameVoice* meta,
|
|
std::function<bool (Human*)>& filter_cb);
|
|
|
|
private:
|
|
|
|
Room* room_ = nullptr;
|
|
int global_kills_ = 0;
|
|
std::map<int, int> personal_kills_;
|
|
std::map<int, int> personal_series_kills_;
|
|
std::map<int, int> personal_nodead_series_kills_;
|
|
std::map<int, long long> personal_last_kill_frameno_;
|
|
|
|
};
|