1
This commit is contained in:
parent
23142ccbfd
commit
0e8d740d6f
@ -506,6 +506,32 @@ void CallFuncBuff::ProcLightCircle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kStartJump,
|
||||||
|
[this, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
if (context->keep_buff_uniid) {
|
||||||
|
owner->RemoveBuffByUniId(context->keep_buff_uniid);
|
||||||
|
context->keep_buff_uniid = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
owner->GetTrigger()->AddListener
|
||||||
|
(
|
||||||
|
kEndJump,
|
||||||
|
[this, context] (const a8::Args& args) mutable
|
||||||
|
{
|
||||||
|
if (context->keep_buff_uniid) {
|
||||||
|
owner->RemoveBuffByUniId(context->keep_buff_uniid);
|
||||||
|
context->keep_buff_uniid = 0;
|
||||||
|
}
|
||||||
|
context->keep_buff_uniid = owner->TryAddBuff(GetCaster().Get(), meta->_int_buff_param4, skill_meta);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
context->keep_buff_uniid = owner->TryAddBuff(GetCaster().Get(), meta->_int_buff_param4, skill_meta);
|
context->keep_buff_uniid = owner->TryAddBuff(GetCaster().Get(), meta->_int_buff_param4, skill_meta);
|
||||||
|
@ -5,10 +5,11 @@
|
|||||||
#include "creature.h"
|
#include "creature.h"
|
||||||
#include "human.h"
|
#include "human.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
#include "trigger.h"
|
||||||
|
|
||||||
void JumpBuff::Activate()
|
void JumpBuff::Activate()
|
||||||
{
|
{
|
||||||
|
owner->GetTrigger()->StartJump(owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JumpBuff::Deactivate()
|
void JumpBuff::Deactivate()
|
||||||
@ -22,6 +23,7 @@ void JumpBuff::Deactivate()
|
|||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
if (c.Get()) {
|
if (c.Get()) {
|
||||||
c.Get()->OnLand();
|
c.Get()->OnLand();
|
||||||
|
c.Get()->GetTrigger()->EndJump(c.Get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -496,3 +496,13 @@ void Trigger::BulletBlock(IBullet* bullet, const glm::vec3& pos)
|
|||||||
{
|
{
|
||||||
DispatchEvent(kBulletBlockEvent, {bullet, pos});
|
DispatchEvent(kBulletBlockEvent, {bullet, pos});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Trigger::StartJump(Creature* sender)
|
||||||
|
{
|
||||||
|
DispatchEvent(kStartJump, {});
|
||||||
|
}
|
||||||
|
|
||||||
|
void Trigger::EndJump(Creature* sender)
|
||||||
|
{
|
||||||
|
DispatchEvent(kEndJump, {});
|
||||||
|
}
|
||||||
|
@ -38,7 +38,9 @@ enum EventId_e
|
|||||||
kDmgOutEvent,
|
kDmgOutEvent,
|
||||||
kHpChgEvent,
|
kHpChgEvent,
|
||||||
kRevive,
|
kRevive,
|
||||||
kAttacked
|
kAttacked,
|
||||||
|
kStartJump,
|
||||||
|
kEndJump,
|
||||||
};
|
};
|
||||||
|
|
||||||
class Weapon;
|
class Weapon;
|
||||||
@ -78,6 +80,8 @@ public:
|
|||||||
void Attacked(Creature* sender);
|
void Attacked(Creature* sender);
|
||||||
void DmgOut(Creature* target, float dmg);
|
void DmgOut(Creature* target, float dmg);
|
||||||
void BulletBlock(IBullet* bullet, const glm::vec3& pos);
|
void BulletBlock(IBullet* bullet, const glm::vec3& pos);
|
||||||
|
void StartJump(Creature* sender);
|
||||||
|
void EndJump(Creature* sender);
|
||||||
|
|
||||||
std::weak_ptr<EventHandlerPtr> AddListener(int event_id, a8::CommonCbProc cb);
|
std::weak_ptr<EventHandlerPtr> AddListener(int event_id, a8::CommonCbProc cb);
|
||||||
void RemoveEventHandler(std::weak_ptr<EventHandlerPtr> handler_ptr);
|
void RemoveEventHandler(std::weak_ptr<EventHandlerPtr> handler_ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user