This commit is contained in:
aozhiwei 2023-02-28 17:41:23 +08:00
parent e2e59b506a
commit ecf5d6042f

View File

@ -93,30 +93,17 @@ void HoldShieldBuff::OnShieldDestory(const a8::Args& params)
e->SetThrough(true); e->SetThrough(true);
e->SetCustomCheckCb e->SetCustomCheckCb
( (
[sender] [this, sender]
(const a8::Args& args) mutable (const a8::Args& args) mutable
{ {
bool* is_hit = args.Get<bool*>(0); bool* is_hit = args.Get<bool*>(0);
Entity* e = args.Get<Entity*>(1); Entity* e = args.Get<Entity*>(1);
if (sender.Get() && e->IsCreature(sender.Get()->room)) { if (sender.Get() && e->IsCreature(sender.Get()->room)) {
Creature* c = (Creature*)e; Creature* c = (Creature*)e;
glm::vec3 target_pos = sender.Get()->GetPos().ToGlmVec3(); float distance = c->GetPos().Distance2D2(sender.Get()->GetPos());
#if 0 if (distance <= skill_meta->_number_meta->_float_range2) {
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) {
*is_hit = true; *is_hit = true;
} }
#endif
} }
} }
); );