1
This commit is contained in:
parent
17c91f3d93
commit
91f5a5813f
@ -3890,13 +3890,18 @@ float Creature::GetHeightOffset()
|
||||
|
||||
void Creature::SpecShot(const glm::vec3& pos, int max_bullet)
|
||||
{
|
||||
room->frame_event.AddPropChgEx
|
||||
(
|
||||
GetWeakPtrRef(),
|
||||
kPropSpecShot,
|
||||
0,
|
||||
pos.x,
|
||||
pos.y,
|
||||
pos.z
|
||||
);
|
||||
if (!GlmHelper::IsEqual2D(pos, GetPos().ToGlmVec3())) {
|
||||
glm::vec3 dir = pos - GetPos().ToGlmVec3();
|
||||
GlmHelper::Normalize(dir);
|
||||
SetAttackDir(dir);
|
||||
room->frame_event.AddPropChgEx
|
||||
(
|
||||
GetWeakPtrRef(),
|
||||
kPropSpecShot,
|
||||
0,
|
||||
pos.x,
|
||||
pos.y,
|
||||
pos.z
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user