summaryrefslogtreecommitdiff
path: root/src/resources/beinginfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-05 21:33:44 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-05 21:33:44 +0300
commite6d7fca349c28eaf98d643325dc99dd9d3a53568 (patch)
tree84ac779d45a0094dde45d9a05039db41d568adbf /src/resources/beinginfo.cpp
parenta48638c5e9bfc04876661ea938eed4a3ab9e5c42 (diff)
downloadmv-e6d7fca349c28eaf98d643325dc99dd9d3a53568.tar.gz
mv-e6d7fca349c28eaf98d643325dc99dd9d3a53568.tar.bz2
mv-e6d7fca349c28eaf98d643325dc99dd9d3a53568.tar.xz
mv-e6d7fca349c28eaf98d643325dc99dd9d3a53568.zip
first part for adding mobs particle effects.
Based on mana commit b35aef2d924f03d85eb44a2465be5a745444eafd by Yohann Ferreira
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r--src/resources/beinginfo.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index 5ffdb887d..992a43b5b 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -30,7 +30,7 @@
#include "debug.h"
BeingInfo *BeingInfo::unknown = nullptr;
-Attack *BeingInfo::empty = new Attack(SpriteAction::ATTACK, "", "");
+Attack *BeingInfo::empty = new Attack(SpriteAction::ATTACK, -1, std::string());
BeingInfo::BeingInfo() :
mName(_("unnamed")),
@@ -106,21 +106,20 @@ const std::string &BeingInfo::getSound(const SoundEvent event) const
i->second->at(rand() % i->second->size());
}
-const Attack *BeingInfo::getAttack(const int type) const
+const Attack *BeingInfo::getAttack(const int id) const
{
- const Attacks::const_iterator i = mAttacks.find(type);
+ const Attacks::const_iterator i = mAttacks.find(id);
return (i == mAttacks.end()) ? empty : (*i).second;
}
-void BeingInfo::addAttack(const int id, std::string action,
- const std::string &particleEffect,
+void BeingInfo::addAttack(const int id, std::string action, const int effectId,
const std::string &missileParticle)
{
if (mAttacks[id])
delete mAttacks[id];
- mAttacks[id] = new Attack(action, particleEffect, missileParticle);
+ mAttacks[id] = new Attack(action, effectId, missileParticle);
}
void BeingInfo::clear()