1
This commit is contained in:
parent
2bb43b3b8c
commit
291c4da50c
@ -8,9 +8,11 @@
|
|||||||
#include "skill.h"
|
#include "skill.h"
|
||||||
#include "movement.h"
|
#include "movement.h"
|
||||||
#include "mapinstance.h"
|
#include "mapinstance.h"
|
||||||
|
#include "trigger.h"
|
||||||
|
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
#include "mt/Skill.h"
|
#include "mt/Skill.h"
|
||||||
|
#include "mt/SkillNumber.h"
|
||||||
|
|
||||||
void CallFuncBuff::Activate()
|
void CallFuncBuff::Activate()
|
||||||
{
|
{
|
||||||
@ -300,4 +302,72 @@ void CallFuncBuff::ProcLightCircle()
|
|||||||
if (skill_meta->GetMagicId() != MAGIC_30601_DJS) {
|
if (skill_meta->GetMagicId() != MAGIC_30601_DJS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct InnerObject
|
||||||
|
{
|
||||||
|
CreatureWeakPtr c;
|
||||||
|
|
||||||
|
void OnEnter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnLeave()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
||||||
|
(
|
||||||
|
a8::XTimerWp passive_skill_timer;
|
||||||
|
a8::XTimerWp active_skill_timer;
|
||||||
|
std::vector<std::weak_ptr<Effect>> curr_effect_list;
|
||||||
|
std::map<int, InnerObject> in_human_infos;
|
||||||
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kUseSkillEvent,
|
||||||
|
[this, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
if (context->passive_skill_timer.expired()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Skill* skill = args.Get<Skill*>(0);
|
||||||
|
if (skill->meta->GetMagicId() == MAGIC_20601_DJS) {
|
||||||
|
if (!context->active_skill_timer.expired()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
a8::Args event_args({skill->meta});
|
||||||
|
owner->room->xtimer.FireEvent(context->passive_skill_timer,
|
||||||
|
kActiveDjsSkillTimerEvent,
|
||||||
|
&event_args);
|
||||||
|
context->active_skill_timer = owner->room->xtimer.SetTimeoutWpEx
|
||||||
|
(
|
||||||
|
skill->meta->_number_meta->_float_time / FRAME_RATE_MS,
|
||||||
|
[this, context] (int event, const a8::Args* args) mutable
|
||||||
|
{
|
||||||
|
if (a8::TIMER_DELETE_EVENT == event) {
|
||||||
|
a8::Args event_args({});
|
||||||
|
owner->room->xtimer.FireEvent(context->passive_skill_timer,
|
||||||
|
kDeactiveDjsSkillTimerEvent,
|
||||||
|
&event_args);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&xtimer_attacher);
|
||||||
|
for (auto effect : context->curr_effect_list) {
|
||||||
|
owner->RemoveEffect(effect);
|
||||||
|
}
|
||||||
|
context->curr_effect_list.clear();
|
||||||
|
for (int effect_id : skill->meta->_number_meta->_effect_list) {
|
||||||
|
context->curr_effect_list.push_back(owner->AddEffect(effect_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user