79 lines
1.5 KiB
C++
79 lines
1.5 KiB
C++
#pragma once
|
|
|
|
namespace MetaData
|
|
{
|
|
struct Skill;
|
|
}
|
|
|
|
namespace cs
|
|
{
|
|
class MFSkill;
|
|
}
|
|
|
|
enum SkillMinorType
|
|
{
|
|
SMT_NONE = 0,
|
|
SMT_BLINK = 1,
|
|
};
|
|
|
|
struct xtimer_list;
|
|
class Creature;
|
|
class Skill
|
|
{
|
|
public:
|
|
Creature* owner = nullptr;
|
|
MetaData::Skill* meta = nullptr;
|
|
long long last_use_frameno = 0;
|
|
a8::XTimerAttacher xtimer_attacher;
|
|
int force_use_times = 0;
|
|
|
|
void Initialzie();
|
|
int GetCd();
|
|
int GetLeftTime();
|
|
int GetPassedTime();
|
|
int GetCurrTimes();
|
|
int GetMaxTimes();
|
|
int GetCurrExp();
|
|
void SetCurrExp(int exp);
|
|
int GetMaxExp();
|
|
void DecTimes();
|
|
void FillMFSkill(cs::MFSkill* skill_pb);
|
|
void ResetSkillCd();
|
|
void Accelerate(int time);
|
|
void LockCastPhase();
|
|
int GetMinorType() { return minor_type_; }
|
|
void AddMinorMode(
|
|
int minor_type,
|
|
int minor_cd_time,
|
|
std::function<void()> cb
|
|
);
|
|
void DoMinorMode();
|
|
|
|
private:
|
|
void InitActiveSkill();
|
|
void InitPassiveSkill();
|
|
|
|
void NotifySkillState();
|
|
|
|
void ProcSJXY();
|
|
void ProcSSJS();
|
|
void ProcJSHX();
|
|
void ProcSWZB();
|
|
void ProcCMXD();
|
|
void ProcMYXY();
|
|
void ProcGZJS();
|
|
void ProcJYFH();
|
|
void ProcFH();
|
|
void ProcYSHF();
|
|
|
|
private:
|
|
int curr_times_ = 0;
|
|
xtimer_list* inc_times_timer_ = nullptr;
|
|
xtimer_list* minor_mode_timer_ = nullptr;
|
|
int curr_exp_ = 0;
|
|
int minor_type_ = 0;
|
|
int minor_cd_time_ = 0;
|
|
long long minor_frameno_ = 0;
|
|
std::function<void()> minor_cb_;
|
|
};
|