From ca53f58ac66a9bf0f858f456d28367bb3397cc60 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 26 Apr 2024 15:26:31 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/Hero.h | 16 ++++++++++++++++ server/gameserver/mtb/Hero.h | 5 ++++- server/gameserver/mtb/mtb.all.cc | 3 ++- server/tools/protobuild/mt.proto | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/server/gameserver/mt/Hero.h b/server/gameserver/mt/Hero.h index 3cf0701e..dbd2d6d9 100644 --- a/server/gameserver/mt/Hero.h +++ b/server/gameserver/mt/Hero.h @@ -8,10 +8,23 @@ namespace mt class BattleBasicAttribute; + const int SHOT_HAND_RIGHT = 0; + const int SHOT_HAND_LEFT = 1; + + struct HeroShotAnimationOther + { + int hand = 0; + int t = 0; + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; + }; + struct HeroShotAnimation { int id = 0; int t = 0; + int is_other = 0; float r_x = 0; float r_y = 0; @@ -33,6 +46,7 @@ namespace mt float p5_y = 0; float p5_z = 0; + std::vector other_list; }; DECLARE_ID_TABLE(Hero, mtb::Hero, @@ -47,7 +61,9 @@ namespace mt bool HasDrop() const { return !_dead_drop.empty();}; std::tuple _pve_score; std::map shot_animations; + std::map other_shot_animations; std::vector _drop_list; + std::vector _other_keys; void Init1(); static void StaticPostInit(); diff --git a/server/gameserver/mtb/Hero.h b/server/gameserver/mtb/Hero.h index 20e58d57..c1149a14 100644 --- a/server/gameserver/mtb/Hero.h +++ b/server/gameserver/mtb/Hero.h @@ -53,6 +53,7 @@ namespace mtb const std::string bt() const { return bt_; }; const std::string drop() const { return drop_; }; const std::string new_bt() const { return new_bt_; }; + const std::string other_key_time() const { return other_key_time_; }; bool has_id() const { return __flags__.test(0);}; bool has_radius() const { return __flags__.test(1);}; @@ -97,6 +98,7 @@ namespace mtb bool has_bt() const { return __flags__.test(40);}; bool has_drop() const { return __flags__.test(41);}; bool has_new_bt() const { return __flags__.test(42);}; + bool has_other_key_time() const { return __flags__.test(43);}; protected: @@ -143,9 +145,10 @@ namespace mtb std::string bt_; std::string drop_; std::string new_bt_; + std::string other_key_time_; public: - std::bitset<43> __flags__; + std::bitset<44> __flags__; }; }; diff --git a/server/gameserver/mtb/mtb.all.cc b/server/gameserver/mtb/mtb.all.cc index e3194fee..ff2096cf 100644 --- a/server/gameserver/mtb/mtb.all.cc +++ b/server/gameserver/mtb/mtb.all.cc @@ -388,7 +388,7 @@ namespace mtb { std::shared_ptr meta_class = nullptr; if (!meta_class) { - meta_class = std::make_shared("Hero", 43, 0); + meta_class = std::make_shared("Hero", 44, 0); meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(Hero, id_)); meta_class->SetSimpleField(1, "radius", a8::reflect::ET_FLOAT, my_offsetof2(Hero, radius_)); meta_class->SetSimpleField(2, "move_speed", a8::reflect::ET_FLOAT, my_offsetof2(Hero, move_speed_)); @@ -432,6 +432,7 @@ namespace mtb meta_class->SetSimpleField(40, "bt", a8::reflect::ET_STRING, my_offsetof2(Hero, bt_)); meta_class->SetSimpleField(41, "drop", a8::reflect::ET_STRING, my_offsetof2(Hero, drop_)); meta_class->SetSimpleField(42, "new_bt", a8::reflect::ET_STRING, my_offsetof2(Hero, new_bt_)); + meta_class->SetSimpleField(43, "other_key_time", a8::reflect::ET_STRING, my_offsetof2(Hero, other_key_time_)); } return meta_class; } diff --git a/server/tools/protobuild/mt.proto b/server/tools/protobuild/mt.proto index ac088461..66241f28 100755 --- a/server/tools/protobuild/mt.proto +++ b/server/tools/protobuild/mt.proto @@ -326,6 +326,7 @@ message Hero optional string drop = 71; optional string new_bt = 72; + optional string other_key_time = 73; } message Robot