1
This commit is contained in:
parent
3170292d83
commit
e3b8cabcbc
@ -114,24 +114,30 @@ void GunGrasp::InstallTriggers()
|
||||
|
||||
void GunGrasp::ProcHit(GraspBuff* buff)
|
||||
{
|
||||
owner_->GetTrigger()->AddListener
|
||||
event_listeners_.push_back
|
||||
(
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
});
|
||||
owner_->GetTrigger()->AddListener
|
||||
(
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
void GunGrasp::ProcKill(GraspBuff* buff)
|
||||
{
|
||||
owner_->GetTrigger()->AddListener
|
||||
event_listeners_.push_back
|
||||
(
|
||||
kKillEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
});
|
||||
owner_->GetTrigger()->AddListener
|
||||
(
|
||||
kKillEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
void GunGrasp::ProcTakeOn(GraspBuff* buff)
|
||||
@ -146,13 +152,16 @@ void GunGrasp::ProcCond(GraspBuff* buff)
|
||||
|
||||
void GunGrasp::ProcHitAndEnd(GraspBuff* buff)
|
||||
{
|
||||
owner_->GetTrigger()->AddListener
|
||||
event_listeners_.push_back
|
||||
(
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
});
|
||||
owner_->GetTrigger()->AddListener
|
||||
(
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
void GunGrasp::AddSignet(int id, int count)
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "trigger.h"
|
||||
|
||||
struct GraspBuff;
|
||||
class Creature;
|
||||
class GunGrasp
|
||||
@ -28,6 +30,7 @@ class GunGrasp
|
||||
private:
|
||||
Creature* owner_ = nullptr;
|
||||
int hero_lv_ = 0;
|
||||
std::vector<std::weak_ptr<EventHandlerPtr>> event_listeners_;
|
||||
std::map<int, int> signet_hash_;
|
||||
std::array<list_head, (int)GraspBuffTrigger_e::kEnd> grasp_triggers_ = {};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user