diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/iteminfo.cpp | 10 | ||||
-rw-r--r-- | src/resources/iteminfo.h | 7 | ||||
-rw-r--r-- | src/resources/itemmanager.cpp | 4 | ||||
-rw-r--r-- | src/resources/itemmanager.h | 2 |
4 files changed, 22 insertions, 1 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index bceeffef..e23be049 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -70,6 +70,16 @@ std::string ItemInfo::getDescription() return description; } +void ItemInfo::setEffect(const std::string &effect) +{ + this->effect = effect; +} + +std::string ItemInfo::getEffect() +{ + return effect; +} + void ItemInfo::setType(short type) { this->type = type; diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index c9c5c85c..f634025f 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -53,7 +53,11 @@ class ItemInfo void setDescription(const std::string &description); std::string getDescription(); - + + void setEffect(const std::string &effect); + + std::string getEffect(); + void setType(short type); short getType(); @@ -76,6 +80,7 @@ class ItemInfo short image, art; std::string name; std::string description; + std::string effect; short type, weight; char slot; diff --git a/src/resources/itemmanager.cpp b/src/resources/itemmanager.cpp index f56968cf..7d9c5ef5 100644 --- a/src/resources/itemmanager.cpp +++ b/src/resources/itemmanager.cpp @@ -68,6 +68,9 @@ ItemManager::ItemManager() prop = xmlGetProp(node, BAD_CAST "description"); std::string description((const char*)prop); xmlFree(prop); + prop = xmlGetProp(node, BAD_CAST "effect"); + std::string effect((const char*)prop); + xmlFree(prop); prop = xmlGetProp(node, BAD_CAST "type"); int type = atoi((const char*)prop); xmlFree(prop); @@ -83,6 +86,7 @@ ItemManager::ItemManager() itemInfo->setArt(art); itemInfo->setName(name); itemInfo->setDescription(description); + itemInfo->setEffect(effect); itemInfo->setType(type); itemInfo->setWeight(weight); itemInfo->setSlot(slot); diff --git a/src/resources/itemmanager.h b/src/resources/itemmanager.h index ed4889a6..124b2afd 100644 --- a/src/resources/itemmanager.h +++ b/src/resources/itemmanager.h @@ -45,6 +45,8 @@ class ItemManager ~ItemManager(); ItemInfo *getItemInfo(int id); + + ItemInfo *getItemEffect(int id); protected: // Items database |