This commit is contained in:
aozhiwei 2023-12-22 15:57:33 +08:00
parent 17c91f3d93
commit 91f5a5813f
2 changed files with 29 additions and 9 deletions

View File

@ -3890,6 +3890,10 @@ float Creature::GetHeightOffset()
void Creature::SpecShot(const glm::vec3& pos, int max_bullet)
{
if (!GlmHelper::IsEqual2D(pos, GetPos().ToGlmVec3())) {
glm::vec3 dir = pos - GetPos().ToGlmVec3();
GlmHelper::Normalize(dir);
SetAttackDir(dir);
room->frame_event.AddPropChgEx
(
GetWeakPtrRef(),
@ -3899,4 +3903,5 @@ void Creature::SpecShot(const glm::vec3& pos, int max_bullet)
pos.y,
pos.z
);
}
}

View File

@ -1828,6 +1828,20 @@ void Player::_CMReportHookHitPos(f8::MsgHdr* hdr, const cs::CMReportHookHitPos&
void Player::_CMReportSpecShotHitPos(f8::MsgHdr* hdr, const cs::CMReportSpecShotHitPos& msg)
{
#if 1
for (int target_uniid : msg.target_list()) {
Creature* target = room->GetCreatureByUniId(target_uniid);
if (target && IsProperTarget(target)) {
glm::vec3 pos;
TypeConvert::FromPb(pos, &msg.bullet_pos());
if (target->GetPos().Distance2D2(pos) < 200) {
float real_dmg_out = 0.0f;
target->DecHP(100, GetUniId(), GetName(), VW_Weapon,
GetUniId(), GetName(), real_dmg_out);
}
}
}
#else
Buff* buff = GetBuffByEffectId(kBET_Floating);
if (buff && buff->meta->GetBuffParam4(buff) > 0) {
if (buff->GetV(0) < buff->meta->GetBuffParam5(buff)) {
@ -1846,6 +1860,7 @@ void Player::_CMReportSpecShotHitPos(f8::MsgHdr* hdr, const cs::CMReportSpecShot
buff->IncV(0, 1);
}
}
#endif
}
void Player::SetShotHold(bool hold)