1
This commit is contained in:
parent
ccd5f340e0
commit
d74a9971e4
@ -972,12 +972,23 @@ void Skill::ProcSkillPhase(const mt::SkillPhase* phase)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Skill::ProcShotPhase(const mt::SkillPhase* phase)
|
void Skill::ProcShotPhase(const mt::SkillPhase* phase)
|
||||||
|
{
|
||||||
|
if (meta->skill_target() == kST_SpecDir) {
|
||||||
|
ProcSpecDirShotPhase(phase);
|
||||||
|
} else {
|
||||||
|
ProcNormalShotPhase(phase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Skill::ProcSpecDirShotPhase(const mt::SkillPhase* phase)
|
||||||
{
|
{
|
||||||
const mt::Equip* weapon_meta = mt::Equip::GetById(phase->param1.GetInt());
|
const mt::Equip* weapon_meta = mt::Equip::GetById(phase->param1.GetInt());
|
||||||
if (weapon_meta) {
|
if (!weapon_meta) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const mt::Equip* bullet_meta =
|
const mt::Equip* bullet_meta =
|
||||||
mt::Equip::GetById(weapon_meta->use_bullet());
|
mt::Equip::GetById(weapon_meta->use_bullet());
|
||||||
if (meta->skill_target() == kST_SpecDir) {
|
|
||||||
if (std::abs(owner->skill_dir_.x) > FLT_EPSILON ||
|
if (std::abs(owner->skill_dir_.x) > FLT_EPSILON ||
|
||||||
std::abs(owner->skill_dir_.y) > FLT_EPSILON) {
|
std::abs(owner->skill_dir_.y) > FLT_EPSILON) {
|
||||||
float target_distance = 5;
|
float target_distance = 5;
|
||||||
@ -1035,7 +1046,17 @@ void Skill::ProcShotPhase(const mt::SkillPhase* phase)
|
|||||||
owner->SetAttackDir(old_attack_dir);
|
owner->SetAttackDir(old_attack_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
void Skill::ProcNormalShotPhase(const mt::SkillPhase* phase)
|
||||||
|
{
|
||||||
|
const mt::Equip* weapon_meta = mt::Equip::GetById(phase->param1.GetInt());
|
||||||
|
if (!weapon_meta) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const mt::Equip* bullet_meta =
|
||||||
|
mt::Equip::GetById(weapon_meta->use_bullet());
|
||||||
|
|
||||||
Entity* entity = owner->room->GetEntityByUniId(owner->skill_target_id_);
|
Entity* entity = owner->room->GetEntityByUniId(owner->skill_target_id_);
|
||||||
if (entity) {
|
if (entity) {
|
||||||
float target_distance = entity->GetPos().Distance2D2(owner->GetPos());
|
float target_distance = entity->GetPos().Distance2D2(owner->GetPos());
|
||||||
@ -1060,8 +1081,6 @@ void Skill::ProcShotPhase(const mt::SkillPhase* phase)
|
|||||||
owner->SetAttackDir(old_attack_dir);
|
owner->SetAttackDir(old_attack_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skill::ProcForthBackJumpPhase(const mt::SkillPhase* phase)
|
void Skill::ProcForthBackJumpPhase(const mt::SkillPhase* phase)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
namespace cs
|
namespace cs
|
||||||
{
|
{
|
||||||
class MFSkill;
|
class MFSkill;
|
||||||
@ -63,6 +62,8 @@ private:
|
|||||||
void ProcYSHF();
|
void ProcYSHF();
|
||||||
|
|
||||||
void ProcShotPhase(const mt::SkillPhase* phase);
|
void ProcShotPhase(const mt::SkillPhase* phase);
|
||||||
|
void ProcSpecDirShotPhase(const mt::SkillPhase* phase);
|
||||||
|
void ProcNormalShotPhase(const mt::SkillPhase* phase);
|
||||||
void ProcForthBackJumpPhase(const mt::SkillPhase* phase);
|
void ProcForthBackJumpPhase(const mt::SkillPhase* phase);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user