From 3589bb9fa0800650accc124ea6820d5834c27e43 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Jun 2016 02:16:34 +0300 Subject: Dont add basic stats into item attributes. From now need add all stats to item attributes in xml file. --- src/resources/basicstat.h | 5 +---- src/resources/db/itemdb.cpp | 18 ++---------------- src/resources/db/statdb.cpp | 28 +++++++--------------------- 3 files changed, 10 insertions(+), 41 deletions(-) (limited to 'src') diff --git a/src/resources/basicstat.h b/src/resources/basicstat.h index a57581ffe..14ad90f03 100644 --- a/src/resources/basicstat.h +++ b/src/resources/basicstat.h @@ -33,17 +33,14 @@ struct BasicStat final { BasicStat(const AttributesT attr0, const std::string &tag0, - const std::string &name0, - const std::string &format0) : + const std::string &name0) : tag(tag0), name(name0), - format(format0), attr(attr0) {} std::string tag; std::string name; - std::string format; AttributesT attr; }; diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 4218771d6..aa6f66d6d 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -32,13 +32,12 @@ #include "resources/iteminfo.h" #include "resources/itemtypemapdata.h" +#include "resources/db/itemfielddb.h" + #include "resources/item/itemfieldtype.h" #include "resources/sprite/spritereference.h" -#include "resources/db/itemfielddb.h" -#include "resources/db/statdb.h" - #include "net/serverfeatures.h" #include "utils/checkutils.h" @@ -513,19 +512,6 @@ void ItemDB::loadXmlFile(const std::string &fileName, std::string effect; readFields(effect, node, requiredFields); readFields(effect, node, addFields); - const std::vector &extraStats = StatDb::getExtraStats(); - FOR_EACH (std::vector::const_iterator, it, extraStats) - { - std::string value = XML::getProperty( - node, it->tag.c_str(), ""); - if (value.empty()) - continue; - if (!effect.empty()) - effect.append(" / "); - if (isDigit(value)) - value = "+" + value; - effect.append(strprintf(it->format.c_str(), value.c_str())); - } std::string temp = XML::langProperty(node, "effect", ""); if (!effect.empty() && !temp.empty()) effect.append(" / "); diff --git a/src/resources/db/statdb.cpp b/src/resources/db/statdb.cpp index 064ae0b84..e079d323a 100644 --- a/src/resources/db/statdb.cpp +++ b/src/resources/db/statdb.cpp @@ -44,39 +44,27 @@ void StatDb::addBasicStats() mBasicStats.push_back(BasicStat(Attributes::STR, "str", // TRANSLATORS: player stat - _("Strength"), - // TRANSLATORS: player stat - _("Strength %s"))); + _("Strength"))); mBasicStats.push_back(BasicStat(Attributes::AGI, "agi", // TRANSLATORS: player stat - _("Agility"), - // TRANSLATORS: player stat - _("Agility %s"))); + _("Agility"))); mBasicStats.push_back(BasicStat(Attributes::VIT, "vit", // TRANSLATORS: player stat - _("Vitality"), - // TRANSLATORS: player stat - _("Vitality %s"))); + _("Vitality"))); mBasicStats.push_back(BasicStat(Attributes::INT, "int", // TRANSLATORS: player stat - _("Intelligence"), - // TRANSLATORS: player stat - _("Intelligence %s"))); + _("Intelligence"))); mBasicStats.push_back(BasicStat(Attributes::DEX, "dex", // TRANSLATORS: player stat - _("Dexterity"), - // TRANSLATORS: player stat - _("Dexterity %s"))); + _("Dexterity"))); mBasicStats.push_back(BasicStat(Attributes::LUK, "luk", // TRANSLATORS: player stat - _("Luck"), - // TRANSLATORS: player stat - _("Luck %s"))); + _("Luck"))); } const std::vector &StatDb::getExtraStats() @@ -109,11 +97,9 @@ static void loadBasicStats(const XmlNodePtr rootNode) continue; const std::string tag = XML::getProperty(node, "tag", ""); const std::string name = XML::getProperty(node, "name", ""); - const std::string format = XML::getProperty(node, "format", ""); mBasicStats.push_back(BasicStat(static_cast(id), tag, - name, - format)); + name)); } } } -- cgit v1.2.3-70-g09d2