This commit is contained in:
aozhiwei 2021-04-13 16:43:36 +08:00
parent e79c487caf
commit 4efd559043
7 changed files with 17 additions and 0 deletions

View File

@ -501,6 +501,7 @@ void Creature::DoSkill(int skill_id,
skill_distance_ = skill_distance;
curr_skill_ = skill;
playing_skill = true;
buff_vec2_param1 = GetPos() + skill_dir_ * skill_distance_;
CurrentSkill()->last_use_frameno = room->GetFrameNo();
if (CurrentSkill()->meta->i->skill_target() == kST_Self
) {

View File

@ -696,6 +696,8 @@ void Human::FillSMGameOver(cs::SMGameOver& msg)
msg.set_game_over(room->IsGameOver());
msg.set_victory(!dead);
msg.set_room_uuid(a8::XValue(room->GetRoomUuid()));
msg.set_total_human_num(room->GetHumanNum());
msg.set_alive_human_num(room->AliveCount());
{
for (auto& itr : *team_members) {

View File

@ -64,11 +64,14 @@ void MolotorCocktailMiTask::Check()
}
}
);
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
sender.Get()->buff_vec2_param1 = sender.Get()->GetPos();
for (Creature* target : objects) {
if (!target->GetBuffById(meta->i->buffid())) {
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
}
}
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
}
}

View File

@ -64,11 +64,14 @@ void PosionGasMiTask::Check()
}
}
);
a8::Vec2 old_buff_vec2_param1 = sender.Get()->buff_vec2_param1;
sender.Get()->buff_vec2_param1 = sender.Get()->GetPos();
for (Creature* target : objects) {
if (!target->GetBuffById(meta->i->buffid())) {
target->MustBeAddBuff(sender.Get(), meta->i->buffid());
}
}
sender.Get()->buff_vec2_param1 = old_buff_vec2_param1;
}
}

View File

@ -171,6 +171,11 @@ int Room::GetPlayerNum()
return accountid_hash_.size();
}
int Room::GetHumanNum()
{
return human_hash_.size();
}
Player* Room::GetPlayerByAccountId(const std::string& accountid)
{
auto itr = accountid_hash_.find(accountid);

View File

@ -74,6 +74,7 @@ public:
#endif
int GetPlayerNum();
int GetHumanNum();
int AliveCount();
long long AliveCountChgFrameNo() { return alive_count_chged_frameno_; };
inline int RealAliveCount() { return alive_human_hash_.size(); }

View File

@ -1066,6 +1066,8 @@ message SMGameOver
optional int32 team_allcnt = 3;
optional bool game_over = 4; //
optional bool victory = 5; //
optional int32 total_human_num = 12; //
optional int32 alive_human_num = 13; //
repeated MFPlayerStats player_stats = 6; //
optional string room_uuid = 7; //id