This commit is contained in:
aozhiwei 2021-09-07 09:48:35 +00:00
parent c4479f4473
commit d9c10334d5
8 changed files with 13 additions and 7 deletions

View File

@ -240,6 +240,8 @@ class Creature : public MoveableEntity
std::string DebugOutBuffList(); std::string DebugOutBuffList();
bool CanFollow(Creature* follower); bool CanFollow(Creature* follower);
void FollowToTarget(); void FollowToTarget();
int GetFollowTimes() { return follow_times_; };
void IncFollowTimes() { ++follow_times_; };
protected: protected:
virtual void OnBuffRemove(Buff& buff); virtual void OnBuffRemove(Buff& buff);
@ -300,6 +302,7 @@ private:
std::list<std::tuple<int, Hero*>> slave_heros_; std::list<std::tuple<int, Hero*>> slave_heros_;
std::list<std::tuple<int, RoomObstacle*>> slave_things_; std::list<std::tuple<int, RoomObstacle*>> slave_things_;
xtimer_list* auto_switch_weapon_timer_ = nullptr; xtimer_list* auto_switch_weapon_timer_ = nullptr;
int follow_times_ = 0;
a8::Vec2 skill_dir_; a8::Vec2 skill_dir_;
float skill_param1 = 0; float skill_param1 = 0;

View File

@ -81,6 +81,7 @@ class Human : public Creature
std::string session_id; std::string session_id;
std::string from_appid; std::string from_appid;
std::string team_uuid; std::string team_uuid;
int init_team_member_num = 1;
bool auto_fill = false; bool auto_fill = false;
int today_enter_times = 0; int today_enter_times = 0;
int account_registertime = 0; int account_registertime = 0;

View File

@ -368,11 +368,8 @@ public:
METAMGR_READ(incubator_canset_distance, 520); METAMGR_READ(incubator_canset_distance, 520);
METAMGR_READ(prebattle_can_use_skill, 1); METAMGR_READ(prebattle_can_use_skill, 1);
#ifdef DEBUG
METAMGR_READ(watchable, 1); METAMGR_READ(watchable, 1);
#else METAMGR_READ(prebattle_combine_team, 1);
METAMGR_READ(watchable, 0);
#endif
METAMGR_READ(refresh_view_time, 4); METAMGR_READ(refresh_view_time, 4);
{ {

View File

@ -179,6 +179,7 @@ class MetaMgr : public a8::Singleton<MetaMgr>
int prebattle_can_use_skill = 0; int prebattle_can_use_skill = 0;
int watchable = 0; int watchable = 0;
int prebattle_combine_team = 1;
private: private:
MetaDataLoader* loader_ = nullptr; MetaDataLoader* loader_ = nullptr;

View File

@ -1303,6 +1303,7 @@ void Player::UpdateFollow()
} }
} }
} }
IncFollowTimes();
follow = -1; follow = -1;
} }

View File

@ -579,9 +579,6 @@ std::string RoomMgr::GenTeamHashData(const std::string& team_uuid, std::map<std:
void RoomMgr::OnJoinRoomOk(const cs::CMJoin& msg, Player* hum) void RoomMgr::OnJoinRoomOk(const cs::CMJoin& msg, Player* hum)
{ {
if (msg.team_members().size() <= 1) {
return;
}
std::map<std::string, long long>* team_hash = nullptr; std::map<std::string, long long>* team_hash = nullptr;
{ {
auto itr = team_room_hash_.find(msg.team_uuid()); auto itr = team_room_hash_.find(msg.team_uuid());
@ -608,6 +605,7 @@ void RoomMgr::OnJoinRoomOk(const cs::CMJoin& msg, Player* hum)
if (!team_hash) { if (!team_hash) {
abort(); abort();
} }
hum->init_team_member_num = team_hash->size();
{ {
auto itr = team_hash->find(hum->account_id); auto itr = team_hash->find(hum->account_id);
if (itr != team_hash->end()) { if (itr != team_hash->end()) {

View File

@ -48,6 +48,9 @@ void Team::AddMember(Human* member)
member->team_id = team_id_; member->team_id = team_id_;
member->SetTeam(this); member->SetTeam(this);
members_.insert(member); members_.insert(member);
if (member->GetFollowTimes() <= 0) {
}
} }
bool Team::IsFull() bool Team::IsFull()

View File

@ -20,8 +20,10 @@ class Team
void CombineBornPoint(); void CombineBornPoint();
void CombineTeam(Team* b_team); void CombineTeam(Team* b_team);
Human* GetMemberByUniId(int member_id); Human* GetMemberByUniId(int member_id);
int GetInitTeamMemberNum() { return init_team_member_num_; };
private: private:
int team_id_ = 0; int team_id_ = 0;
int init_team_member_num_ = 0;
std::set<Human*> members_; std::set<Human*> members_;
}; };