1
This commit is contained in:
parent
0abb5bdb74
commit
e53900a672
@ -3,8 +3,12 @@
|
|||||||
#include "buff/event_add.h"
|
#include "buff/event_add.h"
|
||||||
|
|
||||||
#include "creature.h"
|
#include "creature.h"
|
||||||
|
#include "trigger.h"
|
||||||
|
#include "room.h"
|
||||||
|
|
||||||
#include "mt/Buff.h"
|
#include "mt/Buff.h"
|
||||||
|
#include "mt/Skill.h"
|
||||||
|
#include "mt/SkillNumber.h"
|
||||||
|
|
||||||
void EventAddBuff::Activate()
|
void EventAddBuff::Activate()
|
||||||
{
|
{
|
||||||
@ -12,9 +16,81 @@ void EventAddBuff::Activate()
|
|||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
}
|
}
|
||||||
list_add_tail(&cond_entry, &owner->cond_buffs_[meta->_int_buff_param1]);
|
list_add_tail(&cond_entry, &owner->cond_buffs_[meta->_int_buff_param1]);
|
||||||
|
switch (meta->_int_buff_param1) {
|
||||||
|
case kCondBuffDisengageBattle:
|
||||||
|
{
|
||||||
|
ProcDisengageBattle();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case kCondBuffLimitTimeKillTarget:
|
||||||
|
{
|
||||||
|
ProcLimitTimeSkillTarget();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EventAddBuff::Deactivate()
|
void EventAddBuff::Deactivate()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EventAddBuff::ProcDisengageBattle()
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
auto context = std::make_shared<std::tuple<int, std::vector<int>>>();
|
||||||
|
std::get<0>(*context.get()) = 0;
|
||||||
|
a8::XTimerWp timer = owner->room->xtimer.SetIntervalWpEx
|
||||||
|
(
|
||||||
|
skill_meta->_number_meta->number() * SERVER_FRAME_RATE,
|
||||||
|
[this, context] (int event, const a8::Args* args)
|
||||||
|
{
|
||||||
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
if (!owner->dead) {
|
||||||
|
if (std::get<0>(*context.get()) == 0) {
|
||||||
|
std::get<0>(*context.get()) = 1;
|
||||||
|
owner->AddEnergyShield(meta->_number_meta->shield() * owner->GetMaxHP());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
&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->RemoveBuffByUniId(buff_uniid);
|
||||||
|
}
|
||||||
|
std::get<0>(*context.get()) = 0;
|
||||||
|
std::get<1>(*context.get()).clear();
|
||||||
|
owner->ClearEnergyShield();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kDieEvent,
|
||||||
|
cb
|
||||||
|
);
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kReceiveDmgEvent,
|
||||||
|
cb
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void EventAddBuff::ProcLimitTimeSkillTarget()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -9,4 +9,9 @@ class EventAddBuff : public Buff
|
|||||||
virtual void Activate() override;
|
virtual void Activate() override;
|
||||||
virtual void Deactivate() override;
|
virtual void Deactivate() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
void ProcDisengageBattle();
|
||||||
|
void ProcLimitTimeSkillTarget();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -933,51 +933,6 @@ void Skill::Proc30801LONG()
|
|||||||
|
|
||||||
void Skill::Proc30901XIONG()
|
void Skill::Proc30901XIONG()
|
||||||
{
|
{
|
||||||
auto context = std::make_shared<std::tuple<int, std::vector<int>>>();
|
|
||||||
std::get<0>(*context.get()) = 0;
|
|
||||||
a8::XTimerWp timer = owner->room->xtimer.SetIntervalWpEx
|
|
||||||
(
|
|
||||||
meta->_number_meta->number() * SERVER_FRAME_RATE,
|
|
||||||
[this, context] (int event, const a8::Args* args)
|
|
||||||
{
|
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
|
||||||
if (!owner->dead) {
|
|
||||||
if (std::get<0>(*context.get()) == 0) {
|
|
||||||
std::get<0>(*context.get()) = 1;
|
|
||||||
owner->AddEnergyShield(meta->_number_meta->shield() * owner->GetMaxHP());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
&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->RemoveBuffByUniId(buff_uniid);
|
|
||||||
}
|
|
||||||
std::get<0>(*context.get()) = 0;
|
|
||||||
std::get<1>(*context.get()).clear();
|
|
||||||
owner->ClearEnergyShield();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
owner->GetTrigger()->AddListener
|
|
||||||
(
|
|
||||||
kDieEvent,
|
|
||||||
cb
|
|
||||||
);
|
|
||||||
owner->GetTrigger()->AddListener
|
|
||||||
(
|
|
||||||
kReceiveDmgEvent,
|
|
||||||
cb
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skill::ProcSkillPhase(const mt::SkillPhase* phase)
|
void Skill::ProcSkillPhase(const mt::SkillPhase* phase)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user