1
This commit is contained in:
parent
cb32437987
commit
e0f9efedd1
@ -17,7 +17,7 @@ struct GraspBuff
|
||||
std::function<void()> on_remove;
|
||||
a8::Attacher xtimer_attacher;
|
||||
|
||||
void ProcSignet(GunGrasp* gun_grasp, int count)
|
||||
void ProcSignet(GunGrasp* gun_grasp, int count, Creature* enemy)
|
||||
{
|
||||
const mt::GraspBuff* buff1_meta = std::get<0>(buffs);
|
||||
const mt::GraspBuff* buff2_meta = std::get<1>(buffs);
|
||||
@ -36,15 +36,16 @@ struct GraspBuff
|
||||
&xtimer_attacher);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
void Active(GunGrasp* gun_grasp)
|
||||
void Active(GunGrasp* gun_grasp, Creature* enemy)
|
||||
{
|
||||
std::array<const mt::GraspBuff*, 2> grasp_triggers_ = {std::get<0>(buffs), std::get<1>(buffs)};
|
||||
for (auto& buff : grasp_triggers_) {
|
||||
if (buff) {
|
||||
int buff_time = buff->GetBuffTime(gun_grasp->GetHeroLv());
|
||||
int attr_num = buff->GetAttrNum(gun_grasp->GetHeroLv());
|
||||
if (buff->attr_id()) {
|
||||
switch (buff->attr_add_pattern()) {
|
||||
case 1:
|
||||
@ -162,8 +163,9 @@ void GunGrasp::ProcHit(GraspBuff* buff)
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
buff->Active(this);
|
||||
Creature* target = args.Get<Creature*>(0);
|
||||
buff->ProcSignet(this, 1, target);
|
||||
buff->Active(this, target);
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -177,16 +179,17 @@ void GunGrasp::ProcKill(GraspBuff* buff)
|
||||
kKillEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
buff->Active(this);
|
||||
Creature* target = args.Get<Creature*>(1);
|
||||
buff->ProcSignet(this, 1, target);
|
||||
buff->Active(this, target);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
void GunGrasp::ProcTakeOn(GraspBuff* buff)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
buff->Active(this);
|
||||
buff->ProcSignet(this, 1, nullptr);
|
||||
buff->Active(this, nullptr);
|
||||
}
|
||||
|
||||
void GunGrasp::ProcCond(GraspBuff* buff)
|
||||
@ -203,8 +206,9 @@ void GunGrasp::ProcHitAndEnd(GraspBuff* buff)
|
||||
kBulletHitEvent,
|
||||
[this, buff] (const a8::Args& args)
|
||||
{
|
||||
buff->ProcSignet(this, 1);
|
||||
buff->Active(this);
|
||||
Creature* target = args.Get<Creature*>(1);
|
||||
buff->ProcSignet(this, 1, target);
|
||||
buff->Active(this, target);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user