merge dev

This commit is contained in:
aozhiwei 2021-04-14 11:22:21 +08:00
commit 5d1d4a986a
7 changed files with 20 additions and 0 deletions

View File

@ -1471,3 +1471,10 @@ void Creature::SetCurrWeapon(Weapon* weapon)
#endif
curr_weapon_ = weapon;
}
void Creature::ResetAllSkillCd()
{
for (auto& pair : skill_hash_) {
pair.second->ResetSkillCd();
}
}

View File

@ -139,6 +139,7 @@ class Creature : public MoveableEntity
Weapon* ChooseNextWeapon(int curr_weapon_slot_id, int begin_slot_id, int end_slot_id);
Weapon* GetCurrWeapon() { return curr_weapon_; };
void SetCurrWeapon(Weapon* weapon);
void ResetAllSkillCd();
private:

View File

@ -248,6 +248,7 @@ void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
stats_pb->set_player_avatar_url(avatar_url);
stats_pb->set_charid(meta->i->id());
stats_pb->set_team_id(team_id);
stats_pb->set_nickname(name);
if (!dead) {
stats_pb->set_time_alive(room->GetFrameNo() * 1000.0f / SERVER_FRAME_RATE);

View File

@ -1706,6 +1706,7 @@ void Room::ShuaPlane()
for (auto& pair : human_hash_) {
pair.second->MustBeAddBuff(pair.second, FLY_BUFFID);
pair.second->ResetAllSkillCd();
pair.second->SetPos(plane.curr_pos);
pair.second->attack_dir = plane.dir;
pair.second->SetMoveDir(plane.dir);

View File

@ -132,3 +132,11 @@ void Skill::NotifySkillState()
owner->room->frame_event.AddSkillCurrTimesChg(owner->AllocWeakPtr(), meta->i->skill_id(), GetCurrTimes());
}
}
void Skill::ResetSkillCd()
{
curr_times_ = 0;
if (inc_times_timer_) {
owner->room->xtimer.ModifyTimer(inc_times_timer_, GetCd() / FRAME_RATE_MS);
}
}

View File

@ -34,6 +34,7 @@ class Skill
int GetMaxTimes();
void DecTimes();
void FillMFSkill(cs::MFSkill* skill_pb);
void ResetSkillCd();
void ClearPassiveSkillBuff();
void AddPassiveSkillBuff();

View File

@ -669,6 +669,7 @@ message MFPlayerStats
optional int32 sex = 37 [default = 0]; //
optional int32 charid = 38; //id
optional int32 team_id = 39; //tamid
optional string nickname = 43; //
}
//