This commit is contained in:
aozhiwei 2024-01-09 10:49:51 +08:00
parent e43ea18c02
commit b00b313f21

View File

@ -359,7 +359,6 @@ void Ability::GMClearAttr()
std::vector<std::string> Ability::GMShowAttrs()
{
#if 0
std::vector<std::string> strings;
strings.push_back(a8::Format("curr_hp:%f max_hp:%f atk:%f def:%f block:%f crit:%f",
{
@ -373,105 +372,11 @@ std::vector<std::string> Ability::GMShowAttrs()
{
std::vector<std::string> tmp_strings;
int attr_id = 0;
for (auto& tuple : attr_abs_) {
list_head* head = &std::get<1>(tuple);
for (auto& list : attr_list_) {
list_head* head = &list;
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) {
AttrAbs* e = list_entry(pos,
AttrAbs,
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<std::string> tmp_strings;
int attr_id = 0;
for (auto& tuple : attr_rate_) {
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) {
AttrRate* e = list_entry(pos,
AttrRate,
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<std::string> 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<std::string> 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)});
std::string data = a8::Format("attr_id:%d value:%f [", {attr_id, GetAttr(attr_id)});
int i = 0;
list_for_each_safe(pos, next, head) {
AttrAddition* e = list_entry(pos,
@ -486,7 +391,7 @@ std::vector<std::string> Ability::GMShowAttrs()
}
++attr_id;
}
strings.push_back("成长属性增(虚):");
strings.push_back("属性:");
if (tmp_strings.empty()) {
strings.push_back("");
} else {
@ -495,74 +400,7 @@ std::vector<std::string> Ability::GMShowAttrs()
}
}
}
{
std::vector<std::string> 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<std::string> 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;
#endif
return strings;
}
void Ability::IncSwitch(int type)