diff --git a/server/gameserver/metadata.cc b/server/gameserver/metadata.cc index 3a6be1f..16f3049 100644 --- a/server/gameserver/metadata.cc +++ b/server/gameserver/metadata.cc @@ -126,6 +126,28 @@ namespace MetaData airdrop_mon_list.push_back(a8::XValue(tmp_str)); } } + { + std::vector strings; + a8::Split(i->special_damage_type(), strings, '|'); + for (auto& str : strings) { + int n = a8::XValue(str); + if (n <= 0 || n > 63) { + abort(); + } + a8::SetBitFlag(special_damage_type, n); + } + } + { + std::vector strings; + a8::Split(i->receive_special_damage_type(), strings, '|'); + for (auto& str : strings) { + int n = a8::XValue(str); + if (n <= 0 || n > 63) { + abort(); + } + a8::SetBitFlag(receive_special_damage_type, n); + } + } } void Equip::Init() @@ -261,6 +283,17 @@ namespace MetaData ++j; } } + { + std::vector strings; + a8::Split(i->special_damage_type(), strings, '|'); + for (auto& str : strings) { + int n = a8::XValue(str); + if (n <= 0 || n > 63) { + abort(); + } + a8::SetBitFlag(special_damage_type, n); + } + } } int Equip::GetWeaponIdx() @@ -796,7 +829,6 @@ namespace MetaData std::get<0>(p) = rand_space; } } - int i = 0; } } } diff --git a/server/gameserver/metadata.h b/server/gameserver/metadata.h index 39aa66b..1f2f202 100755 --- a/server/gameserver/metadata.h +++ b/server/gameserver/metadata.h @@ -44,6 +44,8 @@ namespace MetaData const metatable::MapThing* i = nullptr; std::vector buff_list; std::vector airdrop_mon_list; + long long special_damage_type = 0; + long long receive_special_damage_type = 0; void Init(); }; @@ -75,6 +77,7 @@ namespace MetaData std::vector> car_buff_list; int car_active_buff_id = 0; int car_deactive_buff_id = 0; + long long special_damage_type = 0; void Init(); int GetWeaponIdx(); diff --git a/server/tools/protobuild/metatable.proto b/server/tools/protobuild/metatable.proto index 8ac6547..651d621 100755 --- a/server/tools/protobuild/metatable.proto +++ b/server/tools/protobuild/metatable.proto @@ -61,6 +61,8 @@ message MapThing optional int32 explosion_times = 19; optional int32 explosion_float = 20; optional string monster_list = 21; + optional string special_damage_type = 22; + optional string receive_special_damage_type = 23; } message SafeArea @@ -122,6 +124,7 @@ message Equip optional string power_buff = 53; optional int32 through_teammate = 54; optional int32 text_icon = 55; + optional string special_damage_type = 56; optional string inventory_slot = 31; //库存槽位 optional int32 _inventory_slot = 32; //库存槽位