1
This commit is contained in:
parent
baabbb4328
commit
b41a83eea2
@ -1446,16 +1446,60 @@ void CallFuncBuff::Shot()
|
|||||||
float z = meta->GetBuffParam5(this);
|
float z = meta->GetBuffParam5(this);
|
||||||
const mt::Equip* bullet_meta = mt::Equip::GetById(id);
|
const mt::Equip* bullet_meta = mt::Equip::GetById(id);
|
||||||
if (bullet_meta) {
|
if (bullet_meta) {
|
||||||
glm::vec3 target_pos = glm::vec3(x, y, z);
|
bool force_client_report = meta->_buff_param6_int_set.find(1) != meta->_buff_param6_int_set.end();
|
||||||
glm::vec3 attack_dir = target_pos - owner->GetPos().ToGlmVec3();
|
bool spec_target_pos = meta->_buff_param6_int_set.find(2) != meta->_buff_param6_int_set.end();
|
||||||
glm::vec3 old_attack_dir = owner->GetAttackDir();
|
bool ignore_original_dmg = meta->_buff_param6_int_set.find(3) != meta->_buff_param6_int_set.end();
|
||||||
float fly_distance = 0.0f;
|
bool no_adjust_attack_dir = meta->_buff_param6_int_set.find(4) != meta->_buff_param6_int_set.end();
|
||||||
if (GlmHelper::IsZero(attack_dir)) {
|
|
||||||
attack_dir = owner->GetAttackDir();
|
if (force_client_report) {
|
||||||
} else {
|
owner->GetAbility()->IncSwitch(kForceClientReportBullet);
|
||||||
GlmHelper::Normalize(attack_dir);
|
}
|
||||||
|
if (ignore_original_dmg) {
|
||||||
|
owner->GetAbility()->IncSwitch(kIgnoreOriginalDmg);
|
||||||
|
}
|
||||||
|
auto on_bullet_exit =
|
||||||
|
[] (Bullet* bullet)
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
glm::vec3 old_attack_dir = owner->GetAttackDir();
|
||||||
|
if (spec_target_pos) {
|
||||||
|
glm::vec3 target_pos = glm::vec3(x, y, z);
|
||||||
|
glm::vec3 attack_dir = target_pos - owner->GetPos().ToGlmVec3();
|
||||||
|
float fly_distance = 0.0f;
|
||||||
|
if (GlmHelper::IsZero(attack_dir)) {
|
||||||
|
attack_dir = owner->GetAttackDir();
|
||||||
|
} else {
|
||||||
|
GlmHelper::Normalize(attack_dir);
|
||||||
|
}
|
||||||
|
fly_distance = std::max(1.0f, fly_distance);
|
||||||
|
InternalShot(owner,
|
||||||
|
owner->GetCurrWeapon()->meta,
|
||||||
|
bullet_meta,
|
||||||
|
skill_meta,
|
||||||
|
fly_distance,
|
||||||
|
owner->GetCurrWeapon()->weapon_uniid,
|
||||||
|
0,
|
||||||
|
on_bullet_exit);
|
||||||
|
} else {
|
||||||
|
InternalShot(owner,
|
||||||
|
owner->GetCurrWeapon()->meta,
|
||||||
|
owner->GetCurrWeapon()->bullet_meta,
|
||||||
|
skill_meta,
|
||||||
|
0,
|
||||||
|
owner->GetCurrWeapon()->weapon_uniid,
|
||||||
|
0,
|
||||||
|
on_bullet_exit);
|
||||||
|
}
|
||||||
|
if (force_client_report) {
|
||||||
|
owner->GetAbility()->DecSwitch(kForceClientReportBullet);
|
||||||
|
}
|
||||||
|
if (ignore_original_dmg) {
|
||||||
|
owner->GetAbility()->DecSwitch(kIgnoreOriginalDmg);
|
||||||
|
}
|
||||||
|
if (!no_adjust_attack_dir) {
|
||||||
|
owner->SetAttackDir(old_attack_dir);
|
||||||
}
|
}
|
||||||
owner->SetAttackDir(old_attack_dir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,6 +511,8 @@ enum SwitchTimesType_e
|
|||||||
kImmuneGasTimes,
|
kImmuneGasTimes,
|
||||||
kAniHideTimes,
|
kAniHideTimes,
|
||||||
kAccumulatePowerTimes,
|
kAccumulatePowerTimes,
|
||||||
|
kForceClientReportBullet,
|
||||||
|
kIgnoreOriginalDmg,
|
||||||
kSwitchTimeEnd,
|
kSwitchTimeEnd,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -323,7 +323,8 @@ void InternalShot(Creature* c,
|
|||||||
const mt::Skill* skill_meta,
|
const mt::Skill* skill_meta,
|
||||||
float fly_distance,
|
float fly_distance,
|
||||||
long long weapon_uniid,
|
long long weapon_uniid,
|
||||||
int trace_target_uniid)
|
int trace_target_uniid,
|
||||||
|
std::function<void(Bullet*)> on_bullet_exit)
|
||||||
{
|
{
|
||||||
bool is_player = c->IsPlayer();
|
bool is_player = c->IsPlayer();
|
||||||
bool is_car = c->IsCar();
|
bool is_car = c->IsCar();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
class Creature;
|
class Creature;
|
||||||
|
class Bullet;
|
||||||
|
|
||||||
void InternalShot(Creature* sender,
|
void InternalShot(Creature* sender,
|
||||||
const mt::Equip* weapon_meta,
|
const mt::Equip* weapon_meta,
|
||||||
@ -8,4 +9,5 @@ void InternalShot(Creature* sender,
|
|||||||
const mt::Skill* skill_meta,
|
const mt::Skill* skill_meta,
|
||||||
float fly_distance,
|
float fly_distance,
|
||||||
long long weapon_uniid,
|
long long weapon_uniid,
|
||||||
int trace_target_uniid);
|
int trace_target_uniid,
|
||||||
|
std::function<void(Bullet*)> on_bullet_exit = nullptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user