1
This commit is contained in:
parent
6fe7e42743
commit
2afcf33ac6
@ -315,10 +315,12 @@ void Skill::Proc30101HL()
|
|||||||
void Skill::Proc30201HX()
|
void Skill::Proc30201HX()
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
a8::XTimerWp recover_timer = owner->room->xtimer.SetIntervalWpEx
|
auto context = std::make_shared<std::tuple<int, std::vector<int>>>();
|
||||||
|
std::get<0>(*context.get()) = 0;
|
||||||
|
a8::XTimerWp timer = owner->room->xtimer.SetIntervalWpEx
|
||||||
(
|
(
|
||||||
GetCd() / FRAME_RATE_MS,
|
meta->_number_meta->number() * SERVER_FRAME_RATE,
|
||||||
[this] (int event, const a8::Args* args)
|
[this, context] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
if (!owner->dead) {
|
if (!owner->dead) {
|
||||||
@ -328,16 +330,31 @@ void Skill::Proc30201HX()
|
|||||||
},
|
},
|
||||||
&xtimer_attacher);
|
&xtimer_attacher);
|
||||||
|
|
||||||
|
auto cb =
|
||||||
|
[this, timer, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
if (timer.expired()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
owner->room->xtimer.ResetTimer(timer);
|
||||||
|
if (std::get<0>(*context.get()) == 1) {
|
||||||
|
for (int buff_uniid : std::get<1>(*context.get())) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kDieEvent,
|
||||||
|
cb
|
||||||
|
);
|
||||||
owner->GetTrigger()->AddListener
|
owner->GetTrigger()->AddListener
|
||||||
(
|
(
|
||||||
kReceiveDmgEvent,
|
kReceiveDmgEvent,
|
||||||
[this, recover_timer] (const a8::Args& args) mutable
|
cb
|
||||||
{
|
|
||||||
if (!recover_timer.expired()) {
|
|
||||||
owner->room->xtimer.ResetTimer(recover_timer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
a8::XTimerWp add_speed_timer;
|
a8::XTimerWp add_speed_timer;
|
||||||
owner->GetTrigger()->AddListener
|
owner->GetTrigger()->AddListener
|
||||||
|
@ -69,7 +69,7 @@ struct Position
|
|||||||
|
|
||||||
glm::vec3 ToGlmVec3() const { return loc_; };
|
glm::vec3 ToGlmVec3() const { return loc_; };
|
||||||
|
|
||||||
const Position& AddGlmVec3(const glm::vec3& v) { loc_ += v; };
|
const Position& AddGlmVec3(const glm::vec3& v) { loc_ += v; return *this; };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
glm::vec3 loc_ = glm::vec3(0.0, 0.0, 0.0);
|
glm::vec3 loc_ = glm::vec3(0.0, 0.0, 0.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user