1
This commit is contained in:
parent
1e3b09e5cd
commit
6476ec80cc
@ -1103,6 +1103,8 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
a8::Vec2 old_dir = GetMoveDir();
|
a8::Vec2 old_dir = GetMoveDir();
|
||||||
a8::Vec2 old_pos = GetPos();
|
a8::Vec2 old_pos = GetPos();
|
||||||
if (CurrentSkill()->GetMinorType() == SMT_NONE) {
|
if (CurrentSkill()->GetMinorType() == SMT_NONE) {
|
||||||
|
int buff_id = phase->param2.GetInt();
|
||||||
|
TryAddBuff(this, buff_id);
|
||||||
_UpdateMove(phase->param1.GetInt());
|
_UpdateMove(phase->param1.GetInt());
|
||||||
a8::Vec2 pre_dir = old_dir;
|
a8::Vec2 pre_dir = old_dir;
|
||||||
a8::Vec2 pre_pos = old_pos;
|
a8::Vec2 pre_pos = old_pos;
|
||||||
@ -1110,13 +1112,14 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
|
|||||||
(
|
(
|
||||||
SMT_BLINK,
|
SMT_BLINK,
|
||||||
phase->param2.GetInt(),
|
phase->param2.GetInt(),
|
||||||
[this, pre_pos, pre_dir] () {
|
[this, pre_pos, pre_dir, buff_id] () {
|
||||||
a8::Vec2 old_dir = GetMoveDir();
|
a8::Vec2 old_dir = GetMoveDir();
|
||||||
a8::Vec2 old_pos = GetPos();
|
a8::Vec2 old_pos = GetPos();
|
||||||
float distance = GetPos().Distance(pre_pos);
|
float distance = GetPos().Distance(pre_pos);
|
||||||
if (distance > 0.0001f) {
|
if (distance > 0.0001f) {
|
||||||
a8::Vec2 new_dir = pre_pos - GetPos();
|
a8::Vec2 new_dir = pre_pos - GetPos();
|
||||||
new_dir.Normalize();
|
new_dir.Normalize();
|
||||||
|
TryAddBuff(this, buff_id);
|
||||||
_UpdateMove(distance);
|
_UpdateMove(distance);
|
||||||
}
|
}
|
||||||
SetMoveDir(old_dir);
|
SetMoveDir(old_dir);
|
||||||
@ -1342,13 +1345,15 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
|||||||
break;
|
break;
|
||||||
case kBET_FlashMove:
|
case kBET_FlashMove:
|
||||||
{
|
{
|
||||||
a8::Vec2 old_pos = GetPos();
|
if (buff->meta->int_param1 == 0) {
|
||||||
a8::Vec2 new_pos = GetPos() + skill_dir_ * std::max(skill_distance_, 300.0f);
|
a8::Vec2 old_pos = GetPos();
|
||||||
SetPos(new_pos);
|
a8::Vec2 new_pos = GetPos() + skill_dir_ * std::max(skill_distance_, 300.0f);
|
||||||
if (CollisonDetection()) {
|
SetPos(new_pos);
|
||||||
SetPos(old_pos);
|
if (CollisonDetection()) {
|
||||||
} else {
|
SetPos(old_pos);
|
||||||
room->grid_service->MoveCreature(this);
|
} else {
|
||||||
|
room->grid_service->MoveCreature(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user