From e4dcc54a6daec8e7e467993db95b1096f9dc63b0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 30 Apr 2021 19:48:05 +0800 Subject: [PATCH] 1 --- server/gameserver/buff.cc | 7 +++++++ server/gameserver/buff.h | 1 + server/gameserver/creature.cc | 9 ++++++++- server/gameserver/creature.h | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/server/gameserver/buff.cc b/server/gameserver/buff.cc index d395964..11ab08c 100644 --- a/server/gameserver/buff.cc +++ b/server/gameserver/buff.cc @@ -250,3 +250,10 @@ void Buff::RecoverHoldWeapons(Creature* caster) caster->need_sync_active_player = true; caster->SyncAroundPlayers(__FILE__, __LINE__, __func__); } + +void Buff::ProcSprint(Creature* caster) +{ + if (caster->IsPlayer()) { + Player* hum = (Player*)caster; + } +} diff --git a/server/gameserver/buff.h b/server/gameserver/buff.h index 655b333..a95c5d1 100644 --- a/server/gameserver/buff.h +++ b/server/gameserver/buff.h @@ -42,6 +42,7 @@ class Buff void ProcRemoveBecome(Creature* caster); void ProcDriver(Creature* caster); void ProcRemoveDriver(Creature* caster); + void ProcSprint(Creature* caster); private: void InternalTimerAddBuff(Creature* caster); diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 941261c..79b7f7c 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -883,7 +883,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff) break; case kBET_Sprint: { - + buff->ProcSprint(caster); } break; case kBET_FlashMove: @@ -930,6 +930,13 @@ void Creature::Initialize() MoveableEntity::Initialize(); } +void Creature::SetMoveDir(const a8::Vec2& move_dir) +{ + if (!GetBuffByEffectId(kBET_Sprint)) { + MoveableEntity::SetMoveDir(move_dir); + } +} + void Creature::AddSkill(int skill_id) { MetaData::Skill* skill_meta = MetaMgr::Instance()->GetSkill(skill_id); diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index ec5415f..abb785b 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -56,6 +56,7 @@ class Creature : public MoveableEntity Creature(); virtual ~Creature() override; virtual void Initialize() override; + virtual void SetMoveDir(const a8::Vec2& move_dir) override; bool HasBuffEffect(int buff_effect_id); Buff* GetBuffByEffectId(int effect_id); Buff* GetBuffById(int buff_id);