From 1ad105df3c45c7733b694c81192e7cf94a22402a Mon Sep 17 00:00:00 2001 From: yangduo Date: Fri, 18 Apr 2025 18:40:25 +0800 Subject: [PATCH] talent & skin attr --- server/gameserver/human.cc | 10 ++++++++++ server/gameserver/human.h | 7 +++++++ server/gameserver/playermgr.cc | 4 ++++ server/tools/protobuild/cs_proto.proto | 1 + 4 files changed, 22 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index ca22334..52a0e94 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2090,6 +2090,16 @@ bool Human::IsEnemy(Human* hum) } } + void Human::RecalTalentAttr() + { + + } + + void Human::RecalSkinAttr() + { + + } + void Human::_InternalUpdateMove(float speed) { float nx = move_dir.x * speed; diff --git a/server/gameserver/human.h b/server/gameserver/human.h index b2f3fe7..573bd16 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -152,6 +152,8 @@ class Human : public MoveableEntity int kill_times = 0; int rank = 0; + int maxtalent = 0; + std::function on_grid_chg; Human(); @@ -295,6 +297,9 @@ class Human : public MoveableEntity void DeadDrop(); bool IsEnemy(Human* hum); + void RecalTalentAttr(); + void RecalSkinAttr(); + protected: void _InternalUpdateMove(float speed); void ProcLootSkin(Loot* entity, MetaData::Equip* item_meta); @@ -398,6 +403,8 @@ private: std::array buff_attr_abs_ = {}; std::array buff_attr_rate_ = {}; + std::array talent_attr_abs_ = {}; + std::array skin_attr_abs_ = {}; std::array fixed_object_sync_flags_ = {}; diff --git a/server/gameserver/playermgr.cc b/server/gameserver/playermgr.cc index 7ea63c6..bdd2646 100644 --- a/server/gameserver/playermgr.cc +++ b/server/gameserver/playermgr.cc @@ -116,6 +116,10 @@ Player* PlayerMgr::CreatePlayerByCMJoin(Player* hum, #else hum->SetSkinInfo(msg.baseskin()); #endif + hum->maxtalent = msg.talent(); + hum->RecalTalentAttr(); + hum->RecalSkinAttr(); + socket_hash_[socket] = hum; return hum; } diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 845a2bb..53f63ad 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -739,6 +739,7 @@ message CMJoin optional bool force_entry_newbie_room = 50; //是否强制进新手房 repeated MFTeamMember team_members = 51; //包括自己 optional int32 room_mode = 52; //0:吃鸡模式 1:僵尸模式 + optional int32 talent = 53; //已激活天赋max id } //断线重连