1
This commit is contained in:
parent
7b6e5173e3
commit
b6086a0bae
@ -19,12 +19,9 @@ void SprintBuff::Activate()
|
||||
if (meta->_int_buff_param5) {
|
||||
owner->IncDisableMoveDirTimes();
|
||||
}
|
||||
|
||||
if (caster_.Get()->IsPlayer()) {
|
||||
SprintMove();
|
||||
CoCollisionCheck();
|
||||
}
|
||||
ProcSkill();
|
||||
move_distance_limit_ = skill_meta->_number_meta->_float_range;
|
||||
SprintMove();
|
||||
CoCollisionCheck();
|
||||
}
|
||||
|
||||
void SprintBuff::Deactivate()
|
||||
@ -32,22 +29,6 @@ void SprintBuff::Deactivate()
|
||||
if (meta->_int_buff_param5) {
|
||||
owner->DecDisableMoveDirTimes();
|
||||
}
|
||||
if (owner->AsHuman()) {
|
||||
owner->AsHuman()->last_shot_frameno_ = owner->room->GetFrameNo() + SERVER_FRAME_RATE;
|
||||
}
|
||||
if (skill_meta) {
|
||||
switch (skill_meta->GetMagicId()) {
|
||||
case MAGIC_20901_XIONG:
|
||||
{
|
||||
ProcXiongHun();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SprintBuff::SprintMove()
|
||||
@ -111,7 +92,7 @@ void SprintBuff::CoCollisionCheck()
|
||||
(int event, const a8::Args* args) mutable
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
if (!meta->_buff_param3_int_list.empty() || skill_meta) {
|
||||
if (!meta->_buff_param3_int_list.empty()) {
|
||||
Check(pre_pos, src_pos, hited_objects);
|
||||
}
|
||||
}
|
||||
@ -138,30 +119,21 @@ void SprintBuff::Check(Position& pre_pos, Position& src_pos, std::map<int, long
|
||||
return;
|
||||
}
|
||||
stop_times_ = 0;
|
||||
if (skill_meta) {
|
||||
switch (skill_meta->GetMagicId()) {
|
||||
case MAGIC_20901_XIONG:
|
||||
{
|
||||
float moved_distance = owner->GetPos().Distance2D2(src_pos);
|
||||
if (moved_distance >= skill_meta->_number_meta->_float_range) {
|
||||
owner->room->xtimer.SetTimeoutEx
|
||||
(
|
||||
1,
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
owner->RemoveBuffByUniId(buff_uniid);
|
||||
}
|
||||
},
|
||||
&xtimer_attacher);
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
|
||||
{
|
||||
float moved_distance = owner->GetPos().Distance2D2(src_pos);
|
||||
if (moved_distance >= move_distance_limit_) {
|
||||
owner->room->xtimer.SetTimeoutEx
|
||||
(
|
||||
1,
|
||||
[this] (int event, const a8::Args* args)
|
||||
{
|
||||
if (a8::TIMER_EXEC_EVENT == event) {
|
||||
owner->RemoveBuffByUniId(buff_uniid);
|
||||
}
|
||||
},
|
||||
&xtimer_attacher);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,6 +169,7 @@ void SprintBuff::OnEnemyHit(Creature* enemy)
|
||||
for (int buff_id : meta->_buff_param3_int_list) {
|
||||
enemy->TryAddBuff(owner, buff_id, skill_meta);
|
||||
}
|
||||
#if 0
|
||||
if (skill_meta) {
|
||||
switch (skill_meta->GetMagicId()) {
|
||||
case MAGIC_20901_XIONG:
|
||||
@ -223,8 +196,10 @@ void SprintBuff::OnEnemyHit(Creature* enemy)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
void SprintBuff::ProcSkill()
|
||||
{
|
||||
if (skill_meta) {
|
||||
@ -244,8 +219,9 @@ void SprintBuff::ProcSkill()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
void SprintBuff::ProcXiongHun()
|
||||
{
|
||||
owner->TryAddBuff(owner, 209016);
|
||||
@ -272,3 +248,4 @@ void SprintBuff::ProcXiongHun()
|
||||
}
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
@ -14,8 +14,11 @@ class SprintBuff : public Buff
|
||||
void CoCollisionCheck();
|
||||
void Check(Position& pre_pos, Position& src_pos, std::map<int, long long>& hited_objects);
|
||||
void OnEnemyHit(Creature* enemy);
|
||||
void ProcSkill();
|
||||
void ProcXiongHun();
|
||||
|
||||
int stop_times_ = 0;
|
||||
|
||||
private:
|
||||
|
||||
float move_distance_limit_ = 0.0f;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user