This commit is contained in:
aozhiwei 2021-05-06 11:53:01 +08:00
commit bb422ec177
4 changed files with 17 additions and 1 deletions

View File

@ -250,3 +250,10 @@ void Buff::RecoverHoldWeapons(Creature* caster)
caster->need_sync_active_player = true; caster->need_sync_active_player = true;
caster->SyncAroundPlayers(__FILE__, __LINE__, __func__); caster->SyncAroundPlayers(__FILE__, __LINE__, __func__);
} }
void Buff::ProcSprint(Creature* caster)
{
if (caster->IsPlayer()) {
Player* hum = (Player*)caster;
}
}

View File

@ -42,6 +42,7 @@ class Buff
void ProcRemoveBecome(Creature* caster); void ProcRemoveBecome(Creature* caster);
void ProcDriver(Creature* caster); void ProcDriver(Creature* caster);
void ProcRemoveDriver(Creature* caster); void ProcRemoveDriver(Creature* caster);
void ProcSprint(Creature* caster);
private: private:
void InternalTimerAddBuff(Creature* caster); void InternalTimerAddBuff(Creature* caster);

View File

@ -883,7 +883,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff)
break; break;
case kBET_Sprint: case kBET_Sprint:
{ {
buff->ProcSprint(caster);
} }
break; break;
case kBET_FlashMove: case kBET_FlashMove:
@ -930,6 +930,13 @@ void Creature::Initialize()
MoveableEntity::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) void Creature::AddSkill(int skill_id)
{ {
MetaData::Skill* skill_meta = MetaMgr::Instance()->GetSkill(skill_id); MetaData::Skill* skill_meta = MetaMgr::Instance()->GetSkill(skill_id);

View File

@ -56,6 +56,7 @@ class Creature : public MoveableEntity
Creature(); Creature();
virtual ~Creature() override; virtual ~Creature() override;
virtual void Initialize() override; virtual void Initialize() override;
virtual void SetMoveDir(const a8::Vec2& move_dir) override;
bool HasBuffEffect(int buff_effect_id); bool HasBuffEffect(int buff_effect_id);
Buff* GetBuffByEffectId(int effect_id); Buff* GetBuffByEffectId(int effect_id);
Buff* GetBuffById(int buff_id); Buff* GetBuffById(int buff_id);