1
This commit is contained in:
commit
1d9e75e5bf
@ -62,7 +62,6 @@ void Buff::FillMFBuff(cs::MFBuff* buff_pb)
|
||||
if (owner->IsHuman() &&
|
||||
(meta->i->buff_effect() == kBET_Driver ||
|
||||
meta->i->buff_effect() == kBET_Passenger)) {
|
||||
buff_pb->add_params(((Human*)owner)->GetCar()->meta->i->id());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1102,21 +1102,27 @@ void Creature::ProcSkillPhase(MetaData::SkillPhase* phase)
|
||||
{
|
||||
a8::Vec2 old_dir = GetMoveDir();
|
||||
a8::Vec2 old_pos = GetPos();
|
||||
if (CurrentSkill()->GetMinorType() != SMT_NONE) {
|
||||
if (CurrentSkill()->GetMinorType() == SMT_NONE) {
|
||||
int buff_id = phase->param3.GetInt();
|
||||
//TryAddBuff(this, buff_id);
|
||||
a8::XPrintf("old_pos:%f,%f", {GetPos().x, GetPos().y});
|
||||
_UpdateMove(phase->param1.GetInt());
|
||||
a8::Vec2 pre_dir = old_dir;
|
||||
a8::Vec2 pre_pos = old_pos;
|
||||
a8::XPrintf("new_pos:%f,%f", {GetPos().x, GetPos().y});
|
||||
CurrentSkill()->AddMinorMode
|
||||
(
|
||||
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();
|
||||
SetMoveDir(new_dir);
|
||||
//TryAddBuff(this, buff_id);
|
||||
_UpdateMove(distance);
|
||||
}
|
||||
SetMoveDir(old_dir);
|
||||
@ -1342,13 +1348,15 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
|
||||
break;
|
||||
case kBET_FlashMove:
|
||||
{
|
||||
a8::Vec2 old_pos = GetPos();
|
||||
a8::Vec2 new_pos = GetPos() + skill_dir_ * std::max(skill_distance_, 300.0f);
|
||||
SetPos(new_pos);
|
||||
if (CollisonDetection()) {
|
||||
SetPos(old_pos);
|
||||
} else {
|
||||
room->grid_service->MoveCreature(this);
|
||||
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);
|
||||
if (CollisonDetection()) {
|
||||
SetPos(old_pos);
|
||||
} else {
|
||||
room->grid_service->MoveCreature(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -658,7 +658,11 @@ void Human::GetAabbBox(AabbCollider& aabb_box)
|
||||
aabb_box._min.y = -meta->i->radius();
|
||||
aabb_box._max.x = meta->i->radius();
|
||||
aabb_box._max.y = meta->i->radius();
|
||||
#if 1
|
||||
aabb_box.MoveCenter(0, 0);
|
||||
#else
|
||||
aabb_box.MoveCenter(meta->i->move_offset_x(), meta->i->move_offset_y());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,11 @@ void Skill::FillMFSkill(cs::MFSkill* skill_pb)
|
||||
#if 1
|
||||
skill_pb->set_left_time(GetCd());
|
||||
#endif
|
||||
a8::XPrintf("type: %d, lefttime:%d cd_time:%d\n", {
|
||||
minor_type_,
|
||||
minor_left_time,
|
||||
minor_cd_time_
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,6 +217,7 @@ void Skill::AddMinorMode(
|
||||
.SetSender(this),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Skill* skill = (Skill*)param.sender.GetUserData();
|
||||
},
|
||||
&xtimer_attacher.timer_list_,
|
||||
[] (const a8::XParams& param)
|
||||
@ -224,6 +230,7 @@ void Skill::AddMinorMode(
|
||||
skill->minor_mode_timer_ = nullptr;
|
||||
}
|
||||
);
|
||||
owner->need_sync_active_player = true;
|
||||
}
|
||||
|
||||
void Skill::DoMinorMode()
|
||||
@ -234,5 +241,6 @@ void Skill::DoMinorMode()
|
||||
minor_cd_time_ = 0;
|
||||
minor_cb_ = nullptr;
|
||||
ResetSkillCd();
|
||||
owner->need_sync_active_player = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user