diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-09-25 13:12:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-09-25 13:12:05 +0300 |
commit | 6fbd52540d4f2e94b4b8391110c83320557556eb (patch) | |
tree | 8d367db37230da2ab94a1158a29ed33b9d9bbf9e /src/being/being.cpp | |
parent | b1d25bc45df987a7e55ede2a0529fc90986ad1c7 (diff) | |
download | manaplus-6fbd52540d4f2e94b4b8391110c83320557556eb.tar.gz manaplus-6fbd52540d4f2e94b4b8391110c83320557556eb.tar.bz2 manaplus-6fbd52540d4f2e94b4b8391110c83320557556eb.tar.xz manaplus-6fbd52540d4f2e94b4b8391110c83320557556eb.zip |
Load data about homunculuses from homunculuses.xml.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 869d7d8b1..2626ca13a 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -72,6 +72,7 @@ #include "resources/db/avatardb.h" #include "resources/db/emotedb.h" +#include "resources/db/homunculusdb.h" #include "resources/db/itemdb.h" #include "resources/db/mercenarydb.h" #include "resources/db/monsterdb.h" @@ -224,7 +225,8 @@ Being::Being(const int id, if (mType == ActorType::Player || mType == ActorType::Mercenary - || mType == ActorType::Pet) + || mType == ActorType::Pet + || mType == ActorType::Homunculus) { mShowName = config.getBoolValue("visiblenames"); } @@ -303,7 +305,7 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look) mSubType = subtype; mLook = look; - if (mType == ActorType::Monster || mType == ActorType::Homunculus) + if (mType == ActorType::Monster) { mInfo = MonsterDB::get(mSubType); if (mInfo) @@ -336,6 +338,17 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look) mYDiff = mInfo->getSortOffsetY(); } } + if (mType == ActorType::Homunculus) + { + mInfo = HomunculusDB::get(mSubType); + if (mInfo) + { + setName(mInfo->getName()); + setupSpriteDisplay(mInfo->getDisplay(), true, 0, + mInfo->getColor(mLook)); + mYDiff = mInfo->getSortOffsetY(); + } + } else if (mType == ActorType::Npc) { mInfo = NPCDB::get(mSubType); @@ -579,7 +592,8 @@ void Being::takeDamage(Being *const attacker, const int amount, } else if (mType == ActorType::Monster || mType == ActorType::Mercenary - || mType == ActorType::Pet) + || mType == ActorType::Pet + || mType == ActorType::Homunculus) { if (attacker == localPlayer) { @@ -2945,6 +2959,7 @@ std::string Being::loadComment(const std::string &name, case ActorType::LocalPet: case ActorType::Avatar: case ActorType::Mercenary: + case ActorType::Homunculus: case ActorType::Pet: default: return ""; |