1
This commit is contained in:
parent
778a894a66
commit
0ae31ebc0d
@ -612,24 +612,39 @@ void Skill::Proc30601DJS()
|
||||
{
|
||||
a8::XTimerWp passive_skill_timer;
|
||||
{
|
||||
auto context = A8_MAKE_ANON_STRUCT_SHARED(
|
||||
int a = 0;
|
||||
);
|
||||
auto in_human_infos = std::make_shared<std::map<Human*, std::tuple<int, std::vector<int>>>>();
|
||||
auto on_enter =
|
||||
[this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
struct InnerObject
|
||||
{
|
||||
CreatureWeakPtr c;
|
||||
|
||||
void OnEnter()
|
||||
{
|
||||
if (in_human_infos->find(hum) != in_human_infos->end()) {
|
||||
|
||||
}
|
||||
|
||||
void OnLeave()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
||||
(
|
||||
std::map<int, InnerObject> in_human_infos;
|
||||
);
|
||||
auto on_enter =
|
||||
[this, context] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
{
|
||||
if (context->in_human_infos.find(hum->GetUniId()) != context->in_human_infos.end()) {
|
||||
abort();
|
||||
}
|
||||
if (active_skill_meta) {
|
||||
hum->GetAbility()->AddSpeedRuduce(active_skill_meta->_number_meta->_float_speed);
|
||||
}
|
||||
std::vector<int> buff_list;
|
||||
(*in_human_infos)[hum] = std::make_tuple(1, buff_list);
|
||||
context->in_human_infos[hum->GetUniId()] = InnerObject();
|
||||
context->in_human_infos[hum->GetUniId()].OnEnter();
|
||||
};
|
||||
auto on_stay =
|
||||
[this] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
[this, context] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
{
|
||||
if (hum->GetHP() < hum->GetMaxHP()) {
|
||||
if (active_skill_meta) {
|
||||
@ -641,15 +656,17 @@ void Skill::Proc30601DJS()
|
||||
}
|
||||
};
|
||||
auto on_leave =
|
||||
[this, in_human_infos] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
[this, context] (Human* hum, const mt::Skill* active_skill_meta)
|
||||
{
|
||||
if (in_human_infos->find(hum) == in_human_infos->end()) {
|
||||
auto itr = context->in_human_infos.find(hum->GetUniId());
|
||||
if (itr == context->in_human_infos.end()) {
|
||||
abort();
|
||||
}
|
||||
if (active_skill_meta) {
|
||||
hum->GetAbility()->DelSpeedRuduce(active_skill_meta->_number_meta->_float_speed);
|
||||
}
|
||||
in_human_infos->erase(hum);
|
||||
itr->second.OnLeave();
|
||||
context->in_human_infos.erase(itr);
|
||||
};
|
||||
auto check_cb =
|
||||
[this, on_enter, on_stay, on_leave]
|
||||
|
2
third_party/a8
vendored
2
third_party/a8
vendored
@ -1 +1 @@
|
||||
Subproject commit e7505277a1c15c785d6194dfee51e1dd2e6b84ec
|
||||
Subproject commit ee8724d50b4487d8684b9ad47942c5e622ce93b8
|
Loading…
x
Reference in New Issue
Block a user