summaryrefslogtreecommitdiff
path: root/src/statuseffect.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-25 23:56:55 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-25 23:56:55 +0300
commit7cf334f49fe9157aabeef8eb1e69e115749d1b8f (patch)
tree7b5bb97a0b3079bf7e1aa6dcf277f8989952f98d /src/statuseffect.cpp
parente0ad1f9076f322f18b54c4f1e0894a9cdd52937c (diff)
downloadmv-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.gz
mv-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.bz2
mv-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.tar.xz
mv-7cf334f49fe9157aabeef8eb1e69e115749d1b8f.zip
If player poisoned, hightlight his life bar in social window with special color.
Diffstat (limited to 'src/statuseffect.cpp')
-rw-r--r--src/statuseffect.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp
index 647c6dd99..fd9f60851 100644
--- a/src/statuseffect.cpp
+++ b/src/statuseffect.cpp
@@ -47,7 +47,8 @@ StatusEffect::StatusEffect() :
mParticleEffect(),
mIcon(),
mAction(),
- mPersistentParticleEffect(false)
+ mPersistentParticleEffect(false),
+ mIsPoison(false)
{
}
@@ -153,9 +154,9 @@ void StatusEffect::loadXmlFile(const std::string &fileName)
{
if (xmlNameEqual(node, "include"))
{
- const std::string name = XML::getProperty(node, "name", "");
- if (!name.empty())
- loadXmlFile(name);
+ const std::string incName = XML::getProperty(node, "name", "");
+ if (!incName.empty())
+ loadXmlFile(incName);
continue;
}
@@ -181,11 +182,14 @@ void StatusEffect::loadXmlFile(const std::string &fileName)
{
StatusEffect *startEffect = (*the_map)[1][index];
StatusEffect *endEffect = (*the_map)[0][index];
+ const std::string name = XML::getProperty(node, "name", "");
if (!startEffect)
startEffect = new StatusEffect;
if (!endEffect)
endEffect = new StatusEffect;
+ startEffect->mIsPoison =
+ (name == paths.getStringValue("poisonEffectName"));
startEffect->mMessage = XML::getProperty(
node, "start-message", "");
startEffect->mSFXEffect = XML::getProperty(
@@ -198,6 +202,7 @@ void StatusEffect::loadXmlFile(const std::string &fileName)
startEffect->mPersistentParticleEffect = (XML::getProperty(
node, "persistent-particle-effect", "no")) != "no";
+ endEffect->mIsPoison = startEffect->mIsPoison;
endEffect->mMessage = XML::getProperty(node, "end-message", "");
endEffect->mSFXEffect = XML::getProperty(node, "end-audio", "");
endEffect->mParticleEffect = XML::getProperty(