summaryrefslogtreecommitdiff
path: root/src/resources/beinginfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-15 19:25:09 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-15 19:25:09 +0300
commit649fdb1c512e9608aa05c99a08b867c8758eeaf8 (patch)
tree36aefb040eefdc08cef57f760b3ac67a842b56b8 /src/resources/beinginfo.cpp
parentffabda4c473711ffa8fdfe37c2a4460fe31347ac (diff)
downloadmanaverse-649fdb1c512e9608aa05c99a08b867c8758eeaf8.tar.gz
manaverse-649fdb1c512e9608aa05c99a08b867c8758eeaf8.tar.bz2
manaverse-649fdb1c512e9608aa05c99a08b867c8758eeaf8.tar.xz
manaverse-649fdb1c512e9608aa05c99a08b867c8758eeaf8.zip
Add support for monster look.
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r--src/resources/beinginfo.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index b1d6c1d0c..361dead4d 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -46,6 +46,7 @@ BeingInfo::BeingInfo() :
| Map::BLOCKMASK_MONSTER | Map::BLOCKMASK_AIR
| Map::BLOCKMASK_WATER),
mBlockType(Map::BLOCKTYPE_CHARACTER),
+ mColors(nullptr),
mTargetOffsetX(0),
mTargetOffsetY(0),
mMaxHP(0),
@@ -151,3 +152,23 @@ void BeingInfo::init()
empty->mMissEffectId = paths.getIntValue("missEffectId");
}
}
+
+void BeingInfo::setColorsList(const std::string &name)
+{
+ if (name.empty())
+ mColors = nullptr;
+ else
+ mColors = ColorDB::getColorsList(name);
+}
+
+std::string BeingInfo::getColor(const int idx) const
+{
+ if (!mColors)
+ return std::string();
+
+ const std::map <int, ColorDB::ItemColor>::const_iterator
+ it = mColors->find(idx);
+ if (it == mColors->end())
+ return std::string();
+ return it->second.color;
+}