#pragma once #include "weakptr.h" #include "weapon.h" namespace MetaData { struct Player; struct Equip; struct Dress; struct Skill; struct Tank; struct Buff; } namespace cs { class MFBuff; } struct RemoveBuffCbConext { list_head** next; list_head entry; }; class Human; class Creature; struct EventHandlerPtr; struct xtimer_list; class Buff { public: int buff_uniid = 0; Creature* owner = nullptr; MetaData::Buff* meta = nullptr; MetaData::Skill* skill_meta = nullptr; a8::XTimerAttacher xtimer_attacher; long long add_frameno = 0; list_head effect_entry; list_head depend_entry; list_head cond_entry; list_head on_remove_contexts; xtimer_list* remover_timer = nullptr; Buff(); void Init(); void UnInit(); int GetLeftTime(); int GetLastingTime(); bool NeedSync(Human* hum); void FillMFBuff(cs::MFBuff* buff_pb); bool FreezeOperate(); CreatureWeakPtr& GetCaster(); void SetCaster(Creature* caster); void ProcOnceChgAttr(); void ProcDelayAddBuff(); void ProcIntervalAddBuff(); void ProcBatchAddBuff(); void ProcSummonHero(); void ProcBeRecycle(); void ProcBecome(); void ProcRemoveBecome(); void ProcDriver(); void ProcRemoveDriver(); void ProcPassenger(); void ProcRemovePassenger(); void ProcSprint(); void ProcSeletTargetWithSelfPos(); void ProcTurnOver(); void ProcPullToWalkable(); void ProcAutoShot(); void ProcBeatBack(); void ProcDisperse(); void ProcDive(); void ProcRemoveDive(); void ProcInWater(); void ProcRemoveInWater(); void ProcReserve(); void ProcReserveMove(); void ProcMachineGun(); void ProcRemoveMachineGun(); void ProcHoldShield(); void ProcRemoveHoldShield(); void ProcHide(); void ProcRemoveHide(); void ProcRescuer(); void ProcRemoveRescuer(); void CalcPassengerShotOffset(); private: void InternalTimerAddBuff(); void RecoverHoldWeapons(); void ClearEventHandlers(); private: int hold_curr_weapon_idx_ = 0; std::list hold_weapons_; std::list> event_handlers_; CreatureWeakPtr caster_; };