This commit is contained in:
aozhiwei 2022-08-16 10:28:51 +08:00
parent 1e3b09e5cd
commit 6476ec80cc

View File

@ -1103,6 +1103,8 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
a8::Vec2 old_dir = GetMoveDir();
a8::Vec2 old_pos = GetPos();
if (CurrentSkill()->GetMinorType() == SMT_NONE) {
int buff_id = phase->param2.GetInt();
TryAddBuff(this, buff_id);
_UpdateMove(phase->param1.GetInt());
a8::Vec2 pre_dir = old_dir;
a8::Vec2 pre_pos = old_pos;
@ -1110,13 +1112,14 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
(
SMT_BLINK,
phase->param2.GetInt(),
[this, pre_pos, pre_dir] () {
[this, pre_pos, pre_dir, buff_id] () {
a8::Vec2 old_dir = GetMoveDir();
a8::Vec2 old_pos = GetPos();
float distance = GetPos().Distance(pre_pos);
if (distance > 0.0001f) {
a8::Vec2 new_dir = pre_pos - GetPos();
new_dir.Normalize();
TryAddBuff(this, buff_id);
_UpdateMove(distance);
}
SetMoveDir(old_dir);
@ -1342,6 +1345,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
break;
case kBET_FlashMove:
{
if (buff->meta->int_param1 == 0) {
a8::Vec2 old_pos = GetPos();
a8::Vec2 new_pos = GetPos() + skill_dir_ * std::max(skill_distance_, 300.0f);
SetPos(new_pos);
@ -1351,6 +1355,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
room->grid_service->MoveCreature(this);
}
}
}
break;
case kBET_BatchAddBuff:
{