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