This commit is contained in:
aozhiwei 2023-05-23 15:28:37 +08:00
parent 65d0b4e7a2
commit 46450d8384
3 changed files with 17 additions and 0 deletions

View File

@ -3301,3 +3301,11 @@ Skill* Creature::GetMainSkill()
} }
return nullptr; return nullptr;
} }
void Creature::ClearGemStoneBuffs()
{
for (int buff_uniid : gemstone_hold_buffs) {
RemoveBuffByUniId(buff_uniid);
}
gemstone_hold_buffs.clear();
}

View File

@ -118,6 +118,7 @@ class Creature : public MoveableEntity
int shield_max_hp_ = 0; int shield_max_hp_ = 0;
int gemstone = 0; int gemstone = 0;
std::vector<int> gemstone_hold_buffs;
bool shot_start = false; bool shot_start = false;
bool shot_hold = false; bool shot_hold = false;
@ -357,6 +358,7 @@ class Creature : public MoveableEntity
void AdjustPos(); void AdjustPos();
void OnLand(); void OnLand();
std::shared_ptr<Compose> GetCompose() { return compose_; } std::shared_ptr<Compose> GetCompose() { return compose_; }
void ClearGemStoneBuffs();
protected: protected:
virtual void OnBuffRemove(Buff& buff); virtual void OnBuffRemove(Buff& buff);

View File

@ -3344,8 +3344,15 @@ void Human::ProcYellowStoneItem(AddItemDTO& dto)
GetMaxHP(), GetMaxHP(),
true); true);
#endif #endif
ClearGemStoneBuffs();
auto merge_item_meta = mt::MergeItem::GetById(mt::Equip::YELLOW_STONE_ID); auto merge_item_meta = mt::MergeItem::GetById(mt::Equip::YELLOW_STONE_ID);
if (merge_item_meta) { if (merge_item_meta) {
std::set<int>* buffs = merge_item_meta->GetBuffs(GetInventory(IS_YELLOW_STONE));
if (buffs) {
for (int buff_id : *buffs) {
gemstone_hold_buffs.push_back(TryAddBuff(this, buff_id, nullptr));
}
}
} }
SyncVolume(IS_YELLOW_STONE); SyncVolume(IS_YELLOW_STONE);
//刷新数量 //刷新数量