1
This commit is contained in:
parent
2b7f01cfe8
commit
a9b23fbf6f
@ -142,7 +142,59 @@ void CondAddBuff::ProcBulletEnd()
|
||||
|
||||
void CondAddBuff::ProcDisengageBattle()
|
||||
{
|
||||
#if 0
|
||||
const float disengate_time = meta->GetBuffParam2(this);
|
||||
|
||||
auto context = A8_MAKE_ANON_STRUCT_SHARED
|
||||
(
|
||||
);
|
||||
|
||||
std::get<0>(*context.get()) = 0;
|
||||
a8::XTimerWp timer = owner->room->xtimer.SetIntervalWpEx
|
||||
(
|
||||
disengate_time * 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;
|
||||
#if 0
|
||||
owner->AddEnergyShield(meta->_number_meta->shield() * owner->GetMaxHP());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
&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->GetTrigger()->AddListener
|
||||
(
|
||||
kDieEvent,
|
||||
cb
|
||||
);
|
||||
owner->GetTrigger()->AddListener
|
||||
(
|
||||
kReceiveDmgEvent,
|
||||
cb
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CondAddBuff::ProcLimitTimeKillTarget()
|
||||
|
@ -30,5 +30,4 @@ class CondAddBuff : public Buff
|
||||
|
||||
private:
|
||||
std::vector<std::weak_ptr<EventHandlerPtr>> handlers_;
|
||||
|
||||
};
|
||||
|
@ -16,81 +16,9 @@ void EventAddBuff::Activate()
|
||||
A8_ABORT();
|
||||
}
|
||||
list_add_tail(&cond_entry, &owner->cond_buffs_[meta->_int_buff_param1]);
|
||||
switch (meta->_int_buff_param1) {
|
||||
case kEventBuffDisengageBattle:
|
||||
{
|
||||
ProcDisengageBattle();
|
||||
}
|
||||
break;
|
||||
case kEventBuffLimitTimeKillTarget:
|
||||
{
|
||||
ProcLimitTimeSkillTarget();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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,9 +9,4 @@ class EventAddBuff : public Buff
|
||||
virtual void Activate() override;
|
||||
virtual void Deactivate() override;
|
||||
|
||||
private:
|
||||
|
||||
void ProcDisengageBattle();
|
||||
void ProcLimitTimeSkillTarget();
|
||||
|
||||
};
|
||||
|
@ -616,6 +616,12 @@ void Player::ProcInteraction()
|
||||
if (HasBuffEffect(kBET_Jump)) {
|
||||
return;
|
||||
}
|
||||
if (dead) {
|
||||
return;
|
||||
}
|
||||
if (downed) {
|
||||
return;
|
||||
}
|
||||
cs::SMGetItemNotify notify_msg;
|
||||
for (auto obj_id : interaction_objids) {
|
||||
Entity* entity = room->GetEntityByUniId(obj_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user