1
This commit is contained in:
parent
e2e59b506a
commit
ecf5d6042f
@ -93,30 +93,17 @@ void HoldShieldBuff::OnShieldDestory(const a8::Args& params)
|
||||
e->SetThrough(true);
|
||||
e->SetCustomCheckCb
|
||||
(
|
||||
[sender]
|
||||
[this, sender]
|
||||
(const a8::Args& args) mutable
|
||||
{
|
||||
bool* is_hit = args.Get<bool*>(0);
|
||||
Entity* e = args.Get<Entity*>(1);
|
||||
if (sender.Get() && e->IsCreature(sender.Get()->room)) {
|
||||
Creature* c = (Creature*)e;
|
||||
glm::vec3 target_pos = sender.Get()->GetPos().ToGlmVec3();
|
||||
#if 0
|
||||
target_pos = target_pos + (sender.Get()->GetAttackDir() * (float)SkillHelper::GetCmxdRange(this_skill_meta) / 2.0f);
|
||||
bool ret = Collision::Check2dRotationRectangle
|
||||
(c->GetPos().GetX(),
|
||||
c->GetPos().GetY(),
|
||||
20,
|
||||
target_pos.x,
|
||||
target_pos.y,
|
||||
shield_buff_meta->_buff_param4,
|
||||
SkillHelper::GetCmxdRange(this_skill_meta),
|
||||
sender.Get()->GetAttackDirRotate() * 180.0f
|
||||
);
|
||||
if (ret) {
|
||||
float distance = c->GetPos().Distance2D2(sender.Get()->GetPos());
|
||||
if (distance <= skill_meta->_number_meta->_float_range2) {
|
||||
*is_hit = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user