From 2647518269a88f61b5ed25be93c164fa179e35ed Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 28 Mar 2023 19:21:44 +0800 Subject: [PATCH] 1 --- server/gameserver/ability.cc | 149 ++++++++++++++++++++++++++++++++++- 1 file changed, 147 insertions(+), 2 deletions(-) diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index 1cb15b88..2ab57f47 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -714,7 +714,7 @@ std::vector Ability::GMShowAttrs() list_head* head = &std::get<1>(tuple); list_head* pos = nullptr; list_head* next = nullptr; - std::string data = a8::Format("定值 attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); + std::string data = a8::Format("attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); int i = 0; list_for_each_safe(pos, next, head) { AttrAbs* e = list_entry(pos, @@ -729,6 +729,14 @@ std::vector Ability::GMShowAttrs() } ++attr_id; } + strings.push_back("基础属性定值:"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } } { std::vector tmp_strings; @@ -737,7 +745,7 @@ std::vector Ability::GMShowAttrs() list_head* head = &std::get<1>(tuple); list_head* pos = nullptr; list_head* next = nullptr; - std::string data = a8::Format("百分比 attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); + std::string data = a8::Format("attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); int i = 0; list_for_each_safe(pos, next, head) { AttrRate* e = list_entry(pos, @@ -752,6 +760,143 @@ std::vector Ability::GMShowAttrs() } ++attr_id; } + strings.push_back("基础属性百分比:"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } } + { + std::vector tmp_strings; + int attr_id = 0; + for (auto& tuple : attr_add_) { + list_head* head = &std::get<1>(tuple); + list_head* pos = nullptr; + list_head* next = nullptr; + std::string data = a8::Format("attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); + int i = 0; + list_for_each_safe(pos, next, head) { + AttrAddition* e = list_entry(pos, + AttrAddition, + entry); + data += "" + a8::XValue(e->value).GetString() + ","; + ++i; + } + if (i > 0) { + data += "]"; + tmp_strings.push_back(data); + } + ++attr_id; + } + strings.push_back("成长属性增:"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } + } + { + std::vector tmp_strings; + int attr_id = 0; + for (auto& tuple : vattr_add_) { + list_head* head = &std::get<1>(tuple); + list_head* pos = nullptr; + list_head* next = nullptr; + std::string data = a8::Format("attr_id:%d value:%f [", {attr_id + kHVAT_Begin, + std::get<0>(tuple)}); + int i = 0; + list_for_each_safe(pos, next, head) { + AttrAddition* e = list_entry(pos, + AttrAddition, + entry); + data += "" + a8::XValue(e->value).GetString() + ","; + ++i; + } + if (i > 0) { + data += "]"; + tmp_strings.push_back(data); + } + ++attr_id; + } + strings.push_back("成长属性增(虚):"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } + } + + { + std::vector tmp_strings; + int attr_id = 0; + for (auto& tuple : attr_dec_) { + list_head* head = &std::get<1>(tuple); + list_head* pos = nullptr; + list_head* next = nullptr; + std::string data = a8::Format("attr_id:%d value:%f [", {attr_id, std::get<0>(tuple)}); + int i = 0; + list_for_each_safe(pos, next, head) { + AttrRuduce* e = list_entry(pos, + AttrRuduce, + entry); + data += "" + a8::XValue(e->value).GetString() + ","; + ++i; + } + if (i > 0) { + data += "]"; + tmp_strings.push_back(data); + } + ++attr_id; + } + strings.push_back("成长属性减:"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } + } + + { + std::vector tmp_strings; + int attr_id = 0; + for (auto& tuple : vattr_dec_) { + list_head* head = &std::get<1>(tuple); + list_head* pos = nullptr; + list_head* next = nullptr; + std::string data = a8::Format("减 attr_id:%d value:%f [", {attr_id + kHVAT_Begin, + std::get<0>(tuple)}); + int i = 0; + list_for_each_safe(pos, next, head) { + AttrRuduce* e = list_entry(pos, + AttrRuduce, + entry); + data += "" + a8::XValue(e->value).GetString() + ","; + ++i; + } + if (i > 0) { + data += "]"; + tmp_strings.push_back(data); + } + ++attr_id; + } + strings.push_back("成长属性减(虚):"); + if (tmp_strings.empty()) { + strings.push_back("无"); + } else { + for (auto& str : tmp_strings) { + strings.push_back(str); + } + } + } + return strings; }