This commit is contained in:
aozhiwei 2023-04-11 12:05:17 +08:00
parent 39db9ad623
commit 54662c4ec2
3 changed files with 35 additions and 0 deletions

View File

@ -1238,6 +1238,25 @@ void Human::DeadDrop()
}
}
}
{
if (GetInventory(IS_GEMSTONE) > 0) {
room->frame_event.AddPropChg
(
GetWeakPtrRef(),
kPropGemstone,
0,
0,
false);
#if 0
SetMaxHP(GetMaxHP() + dto.item_meta->_max_hp * GetBattleContext()->GetMaxHP());
#endif
gemstone = 0;
DecInventory(IS_GEMSTONE, GetInventory(IS_GEMSTONE));
SyncVolume(IS_GEMSTONE);
}
}
MarkSyncActivePlayer(__FILE__, __LINE__, __func__);
}

View File

@ -5,6 +5,7 @@
IMPL_TABLE(mt::Equip)
std::map<int, const mt::Equip*> mt::Equip::slot_hash_;
const mt::Equip* mt::Equip::gem_stone_ = nullptr;
namespace mt
{
@ -324,4 +325,14 @@ namespace mt
});
}
void Equip::StaticPostInit()
{
gem_stone_ = GetById(GEMSTONE_ID);
}
const Equip* Equip::GetGemStone()
{
return gem_stone_;
}
}

View File

@ -10,6 +10,8 @@ namespace mt
"equip@equip.json",
"id")
public:
static const int GEMSTONE_ID = 31001;
int lock_time = 0;
//0,0,0,0,后座力,是否取消定身
std::vector<std::tuple<float, float, float, int, int, int>> _bullet_born_offset;
@ -42,8 +44,11 @@ namespace mt
bool Match(EventAddBuff_e event, int val, int val2) const;
static const Equip* GetByIdBySlotId(int slot_id);
static void AdjustMuzzlePos();
static const Equip* GetGemStone();
static void StaticPostInit();
private:
static const mt::Equip* gem_stone_;
static std::map<int, const mt::Equip*> slot_hash_;
std::map<int, std::shared_ptr<std::tuple<float, float, float>>> _gun_muzzle_position_hash_;
};