This commit is contained in:
aozhiwei 2022-10-18 20:21:24 +08:00
parent 6347baa5a4
commit fe2924f943
3 changed files with 22 additions and 1 deletions

View File

@ -940,6 +940,9 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
}); });
} }
if (CurrentSkill()->meta->GetMagicId() == MAGIC_YLZ) {
target_distance = std::max(0.0001f, target_distance);
}
if (bullet_meta && target_distance > 0.00001f) { if (bullet_meta && target_distance > 0.00001f) {
a8::Vec2 old_attack_dir = GetAttackDir(); a8::Vec2 old_attack_dir = GetAttackDir();
a8::Vec2 attack_dir = skill_dir_; a8::Vec2 attack_dir = skill_dir_;

View File

@ -11,6 +11,7 @@
#include "buff.h" #include "buff.h"
#include "human.h" #include "human.h"
#include "bullet.h" #include "bullet.h"
#include "collider.h"
void Skill::Initialzie() void Skill::Initialzie()
{ {
@ -545,18 +546,34 @@ void Skill::ProcCMXD()
Buff* hold_shield_buff = owner->GetBuffByEffectId(kBET_HoldShield); Buff* hold_shield_buff = owner->GetBuffByEffectId(kBET_HoldShield);
if (hold_shield_buff) { if (hold_shield_buff) {
MetaData::Skill* skill_meta = hold_shield_buff->skill_meta; MetaData::Skill* skill_meta = hold_shield_buff->skill_meta;
MetaData::Skill* this_skill_meta = meta;
MetaData::Buff* shield_buff_meta = hold_shield_buff->meta;
CreatureWeakPtr sender = owner->GetWeakPtrRef(); CreatureWeakPtr sender = owner->GetWeakPtrRef();
std::shared_ptr<Explosion> e = EntityFactory::Instance()->MakeExplosion(); std::shared_ptr<Explosion> e = EntityFactory::Instance()->MakeExplosion();
e->SetThrough(true); e->SetThrough(true);
e->SetCustomCheckCb e->SetCustomCheckCb
( (
[sender, skill_meta] (const std::vector<std::any>& params) mutable [sender, skill_meta, this_skill_meta, shield_buff_meta] (const std::vector<std::any>& params) mutable
{ {
bool* is_hit = std::any_cast<bool*>(params.at(0)); bool* is_hit = std::any_cast<bool*>(params.at(0));
Entity* e = std::any_cast<Entity*>(params.at(1)); Entity* e = std::any_cast<Entity*>(params.at(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;
bool ret = Check2dRotationRectangle
(c->GetPos().x,
c->GetPos().y,
20,
sender.Get()->GetPos().x,
sender.Get()->GetPos().y,
shield_buff_meta->param4,
SkillHelper::GetCmxdRange(this_skill_meta),
sender.Get()->GetAttackDirRotate() * 180.0f
);
if (ret) {
*is_hit = true;
}
} }
} }
); );

View File

@ -868,6 +868,7 @@ message MFOverRewardItem
{ {
optional string obtain_gold = 1 [default = "0"]; // optional string obtain_gold = 1 [default = "0"]; //
optional string gold_limit = 2 [default = "0"]; // optional string gold_limit = 2 [default = "0"]; //
optional int32 id = 3; //id
} }
// //