1
This commit is contained in:
parent
299d4da380
commit
9402eeef84
@ -55,18 +55,23 @@ bool Compose::CanAdd()
|
||||
void Compose::IncNum()
|
||||
{
|
||||
++num_;
|
||||
if (num_ % 3 == 0 && num_ <= 9) {
|
||||
TakeOnWeapon(owner_->GetCurrWeapon());
|
||||
}
|
||||
}
|
||||
|
||||
void Compose::TakeOnWeapon(Weapon* weapon)
|
||||
{
|
||||
std::set<int>* buffs = mt::MergeItem::GetBuffs(weapon->meta->id(),
|
||||
num_);
|
||||
Clear();
|
||||
auto merge_item_meta = mt::MergeItem::GetById(weapon->meta->id());
|
||||
if (merge_item_meta) {
|
||||
std::set<int>* buffs = merge_item_meta->GetBuffs(num_);
|
||||
if (buffs) {
|
||||
for (int buff_id : *buffs) {
|
||||
hold_buffs_.push_back(owner_->TryAddBuff(owner_, buff_id, nullptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Compose::Reset()
|
||||
|
@ -3,7 +3,6 @@
|
||||
#include "mt/MergeItem.h"
|
||||
|
||||
IMPL_TABLE(mt::MergeItem)
|
||||
std::map<int, std::set<int>> mt::MergeItem::gun_num_buff_hash_;
|
||||
|
||||
namespace mt
|
||||
{
|
||||
@ -12,7 +11,7 @@ namespace mt
|
||||
{
|
||||
}
|
||||
|
||||
std::set<int>* MergeItem::GetBuffs(int gun_id, int num)
|
||||
std::set<int>* MergeItem::GetBuffs(int num)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -13,14 +13,10 @@ namespace mt
|
||||
|
||||
void Init1();
|
||||
|
||||
static std::set<int>* GetBuffs(int gun_id, int num);
|
||||
std::set<int>* GetBuffs(int num);
|
||||
|
||||
private:
|
||||
static std::map<int, std::set<int>> gun_num_buff_hash_;
|
||||
|
||||
std::set<int> _add_buff_list;
|
||||
std::set<int> _remove_buff_list;
|
||||
|
||||
std::map<int, std::set<int>> gun_num_buff_hash_;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user