summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/itemdb.cpp8
-rw-r--r--src/resources/iteminfo.h26
2 files changed, 30 insertions, 4 deletions
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index 59d7e951c..ab38e282e 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -226,6 +226,10 @@ void ItemDB::load()
int attackRange = XML::getProperty(node, "attack-range", 0);
std::string missileParticle = XML::getProperty(
node, "missile-particle", "");
+ int hitEffectId = XML::getProperty(node, "hit-effect-id",
+ paths.getIntValue("hitEffectId"));
+ int criticalEffectId = XML::getProperty(node, "critical-hit-effect-id",
+ paths.getIntValue("criticalHitEffectId"));
SpriteDisplay display;
display.image = image;
@@ -283,7 +287,9 @@ void ItemDB::load()
itemInfo->setWeight(weight);
itemInfo->setAttackAction(attackAction);
itemInfo->setAttackRange(attackRange);
- itemInfo->setMissileParticle(missileParticle);
+ itemInfo->setMissileParticleFile(missileParticle);
+ itemInfo->setHitEffectId(hitEffectId);
+ itemInfo->setCriticalHitEffectId(criticalEffectId);
itemInfo->setDrawBefore(parseSpriteName(drawBefore));
itemInfo->setDrawAfter(parseSpriteName(drawAfter));
itemInfo->setDrawPriority(drawPriority);
diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h
index 8b276601c..01a4b5b9e 100644
--- a/src/resources/iteminfo.h
+++ b/src/resources/iteminfo.h
@@ -183,11 +183,25 @@ class ItemInfo
void setAttackAction(std::string attackAction);
// Handlers for seting and getting the string used for particles when attacking
- void setMissileParticle(std::string s) { mMissileParticle = s; }
+ void setMissileParticleFile(const std::string &s)
+ { mMissileParticleFile = s; }
- std::string getMissileParticle() const { return mMissileParticle; }
+ const std::string &getMissileParticleFile() const
+ { return mMissileParticleFile; }
- std::string getAttackAction() const
+ void setHitEffectId(int s)
+ { mHitEffectId = s; }
+
+ int getHitEffectId() const
+ { return mHitEffectId; }
+
+ void setCriticalHitEffectId(int s)
+ { mCriticalHitEffectId = s; }
+
+ int getCriticalHitEffectId() const
+ { return mCriticalHitEffectId; }
+
+ const std::string &getAttackAction() const
{ return mAttackAction; }
int getAttackRange() const
@@ -232,6 +246,9 @@ class ItemInfo
bool isRemoveItemId(int id) const;
+ /** Effects to be shown when weapon attacks - see also effects.xml */
+ std::string mMissileParticleFile;
+
int getReplaceToSpriteId(int id) const;
std::map<int, int> &addReplaceSprite(int sprite);
@@ -251,6 +268,9 @@ class ItemInfo
const std::string replaceColors(std::string str,
unsigned char color) const;
+ int mHitEffectId;
+ int mCriticalHitEffectId;
+
protected:
SpriteDisplay mDisplay; /**< Display info (like icon) */
std::string mName;