This commit is contained in:
aozhiwei 2022-12-08 17:10:38 +08:00
parent 2475503eab
commit 3e21e93834
2 changed files with 8 additions and 1 deletions

View File

@ -479,3 +479,8 @@ void Trigger::BulletHitBuff(Bullet* bullet)
{ {
DispatchEvent(kTriggerBulletHitBuffEvent, {bullet}); DispatchEvent(kTriggerBulletHitBuffEvent, {bullet});
} }
void Trigger::Attacked(Creature* sender)
{
DispatchEvent(kAttacked, {sender});
}

View File

@ -39,7 +39,8 @@ enum EventId_e
kFlyHookDestoryEvent, kFlyHookDestoryEvent,
kSkillBulletPreCreateEvent, kSkillBulletPreCreateEvent,
kUseSkillEvent, kUseSkillEvent,
kTriggerBulletHitBuffEvent kTriggerBulletHitBuffEvent,
kAttacked
}; };
class Weapon; class Weapon;
@ -76,6 +77,7 @@ public:
void FlyHookCreate(Bullet* bullet); void FlyHookCreate(Bullet* bullet);
void FlyHookDestory(); void FlyHookDestory();
void BulletHitBuff(Bullet* bullet); void BulletHitBuff(Bullet* bullet);
void Attacked(Creature* sender);
std::weak_ptr<EventHandlerPtr> AddListener(int event_id, CommonCbProc cb); std::weak_ptr<EventHandlerPtr> AddListener(int event_id, CommonCbProc cb);
void RemoveEventHandler(std::weak_ptr<EventHandlerPtr> handler_ptr); void RemoveEventHandler(std::weak_ptr<EventHandlerPtr> handler_ptr);