This commit is contained in:
aozhiwei 2023-03-16 13:42:53 +08:00
parent 45f7431b67
commit 305bf55c54
3 changed files with 33 additions and 3 deletions

View File

@ -346,9 +346,15 @@ void CallFuncBuff::ProcLightCircle()
const mt::Skill* old_skill_meta = skill_meta;
skill_meta = curr_skill_meta;
if (context->active_skill_meta) {
for (int buff_id : meta->_buff_param3_int_list) {
o.buff_uniids.insert(hum->TryAddBuff(GetCaster().Get(), buff_id, skill_meta));
}
} else {
for (int buff_id : meta->_buff_param2_int_list) {
o.buff_uniids.insert(hum->TryAddBuff(GetCaster().Get(), buff_id, skill_meta));
}
}
skill_meta = old_skill_meta;
context->in_human_infos[hum->GetUniId()] = o;
@ -437,6 +443,9 @@ void CallFuncBuff::ProcLightCircle()
if (a8::TIMER_EXEC_EVENT == event) {
check_cb();
} else if (kActiveDjsSkillTimerEvent == event) {
for (auto& pair : context->in_human_infos) {
on_leave(pair.second.c.Get()->AsHuman());
}
context->in_human_infos.clear();
context->active_skill_meta = args->Get<const mt::Skill*>(0);
Buff* buff = owner->GetBuffByUniId(context->keep_buff_uniid);
@ -447,6 +456,9 @@ void CallFuncBuff::ProcLightCircle()
}
check_cb();
} else if (kDeactiveDjsSkillTimerEvent == event) {
for (auto& pair : context->in_human_infos) {
on_leave(pair.second.c.Get()->AsHuman());
}
context->in_human_infos.clear();
context->active_skill_meta = nullptr;
Buff* buff = owner->GetBuffByUniId(context->keep_buff_uniid);

View File

@ -3,12 +3,27 @@
#include "mt/Grasp.h"
IMPL_TABLE(mt::Grasp)
std::map<long long, std::set<int>> mt::Grasp::hero_id_lv_hash_;
namespace mt
{
void Grasp::Init1()
{
{
std::vector<std::string> strings;
a8::Split(add_buff_list(), strings, '|');
for (auto& str : strings) {
_add_buff_list.insert(a8::XValue(str));
}
}
{
std::vector<std::string> strings;
a8::Split(remove_buff_list(), strings, '|');
for (auto& str : strings) {
_remove_buff_list.insert(a8::XValue(str));
}
}
}
void Grasp::Init2()

View File

@ -20,7 +20,10 @@ namespace mt
std::set<int>* GetBuffs(int hero_id, int hero_lv);
private:
std::map<long long, std::set<int>> hero_id_lv_hash_;
static std::map<long long, std::set<int>> hero_id_lv_hash_;
std::set<int> _add_buff_list;
std::set<int> _remove_buff_list;
};