summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-04 02:58:12 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-04 22:00:41 +0300
commit46106e962bee32271ee644224c5ac525eb32f888 (patch)
treec098cb2aa421bff026e499b35f88b7185e995099 /src/being.cpp
parent28e10f7225551b1dc2e1f35b8d4d145db528e4c7 (diff)
downloadmanaplus-46106e962bee32271ee644224c5ac525eb32f888.tar.gz
manaplus-46106e962bee32271ee644224c5ac525eb32f888.tar.bz2
manaplus-46106e962bee32271ee644224c5ac525eb32f888.tar.xz
manaplus-46106e962bee32271ee644224c5ac525eb32f888.zip
Add different effects to npc depend on qests status (evol only)
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 7b494b4a7..b26b56c5d 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -247,9 +247,8 @@ Being::Being(const int id, const Type type, const uint16_t subtype,
mInactive(false),
mNumber(100),
mHairColor(0),
- mAfkParticle(nullptr)
+ mSpecialParticle(nullptr)
{
-
for (int f = 0; f < 20; f ++)
{
mSpriteRemap[f] = f;
@@ -2763,16 +2762,26 @@ int Being::getSpriteID(const int slot) const
void Being::addAfkEffect()
{
- if (effectManager && !mAfkParticle && mAwayEffect != -1)
- mAfkParticle = effectManager->triggerReturn(mAwayEffect, this);
+ addSpecialEffect(mAwayEffect);
}
void Being::removeAfkEffect()
{
- if (effectManager && mAfkParticle)
+ removeSpecialEffect();
+}
+
+void Being::addSpecialEffect(const int effect)
+{
+ if (effectManager && !mSpecialParticle && effect != -1)
+ mSpecialParticle = effectManager->triggerReturn(effect, this);
+}
+
+void Being::removeSpecialEffect()
+{
+ if (effectManager && mSpecialParticle)
{
- mChildParticleEffects.removeLocally(mAfkParticle);
- mAfkParticle = nullptr;
+ mChildParticleEffects.removeLocally(mSpecialParticle);
+ mSpecialParticle = nullptr;
}
}