1
This commit is contained in:
parent
98298b8722
commit
1add2ffec0
@ -25,6 +25,7 @@
|
|||||||
#include "mt/Skill.h"
|
#include "mt/Skill.h"
|
||||||
#include "mt/SkillNumber.h"
|
#include "mt/SkillNumber.h"
|
||||||
#include "mt/Equip.h"
|
#include "mt/Equip.h"
|
||||||
|
#include "mt/MergeItem.h"
|
||||||
|
|
||||||
static int GetTraceTargetId(Creature* c)
|
static int GetTraceTargetId(Creature* c)
|
||||||
{
|
{
|
||||||
@ -504,7 +505,26 @@ void Skill::Active()
|
|||||||
NotifySkillState();
|
NotifySkillState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Skill::Clear()
|
||||||
|
{
|
||||||
|
for (int buff_uniid : hold_buffs_) {
|
||||||
|
owner->RemoveBuffByUniId(buff_uniid);
|
||||||
|
}
|
||||||
|
hold_buffs_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void Skill::LevelUp()
|
void Skill::LevelUp()
|
||||||
{
|
{
|
||||||
|
if (owner->GetInventory(IS_BLUE_STONE) % 3 == 0) {
|
||||||
|
Clear();
|
||||||
|
auto merge_item_meta = mt::MergeItem::GetById(mt::Equip::BLUE_STONE_ID);
|
||||||
|
if (merge_item_meta) {
|
||||||
|
std::set<int>* buffs = merge_item_meta->GetBuffs(owner->GetInventory(IS_BLUE_STONE));
|
||||||
|
if (buffs) {
|
||||||
|
for (int buff_id : *buffs) {
|
||||||
|
hold_buffs_.push_back(owner->TryAddBuff(owner, buff_id, nullptr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ class Skill
|
|||||||
void Deactive() { actived_ = false; }
|
void Deactive() { actived_ = false; }
|
||||||
bool IsMainSkill();
|
bool IsMainSkill();
|
||||||
void LevelUp();
|
void LevelUp();
|
||||||
|
void Clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InitActiveSkill();
|
void InitActiveSkill();
|
||||||
@ -73,6 +74,7 @@ private:
|
|||||||
int minor_cd_time_ = 0;
|
int minor_cd_time_ = 0;
|
||||||
long long minor_frameno_ = 0;
|
long long minor_frameno_ = 0;
|
||||||
std::function<void(int)> minor_cb_;
|
std::function<void(int)> minor_cb_;
|
||||||
|
std::vector<int> hold_buffs_;
|
||||||
|
|
||||||
friend class PBUtils;
|
friend class PBUtils;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user